Title: [106848] branches/chromium/1025/Source/WebCore
- Revision
- 106848
- Author
- [email protected]
- Date
- 2012-02-06 14:06:43 -0800 (Mon, 06 Feb 2012)
Log Message
Merge 106846 - Before accessing a frame's script controller in V8 bindings, first check that the frame actually exists
https://bugs.webkit.org/show_bug.cgi?id=77370
Reviewed by Adam Barth.
I don't have a working reproduction of the crash yet. As soon as I have
one, I will add new layout tests.
* bindings/v8/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::addListener):
* bindings/v8/ScheduledAction.cpp:
(WebCore::ScheduledAction::execute):
* bindings/v8/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::restore):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer): remove temporary debug code
Review URL: https://chromiumcodereview.appspot.com/9340005
Modified Paths
Diff
Modified: branches/chromium/1025/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp (106847 => 106848)
--- branches/chromium/1025/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp 2012-02-06 21:59:08 UTC (rev 106847)
+++ branches/chromium/1025/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp 2012-02-06 22:06:43 UTC (rev 106848)
@@ -76,10 +76,12 @@
void PageScriptDebugServer::addListener(ScriptDebugListener* listener, Page* page)
{
+ V8Proxy* proxy = V8Proxy::retrieve(page->mainFrame());
+ if (!proxy)
+ return;
ScriptController* scriptController = page->mainFrame()->script();
if (!scriptController->canExecuteScripts(NotAboutToExecuteScript))
return;
- V8Proxy* proxy = V8Proxy::retrieve(page->mainFrame());
v8::HandleScope scope;
v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
Modified: branches/chromium/1025/Source/WebCore/bindings/v8/ScheduledAction.cpp (106847 => 106848)
--- branches/chromium/1025/Source/WebCore/bindings/v8/ScheduledAction.cpp 2012-02-06 21:59:08 UTC (rev 106847)
+++ branches/chromium/1025/Source/WebCore/bindings/v8/ScheduledAction.cpp 2012-02-06 22:06:43 UTC (rev 106848)
@@ -96,6 +96,8 @@
{
if (context->isDocument()) {
Frame* frame = static_cast<Document*>(context)->frame();
+ if (!frame)
+ return;
ScriptController* scriptController = frame->script();
if (!scriptController->canExecuteScripts(NotAboutToExecuteScript))
return;
Modified: branches/chromium/1025/Source/WebCore/bindings/v8/ScriptCachedFrameData.cpp (106847 => 106848)
--- branches/chromium/1025/Source/WebCore/bindings/v8/ScriptCachedFrameData.cpp 2012-02-06 21:59:08 UTC (rev 106847)
+++ branches/chromium/1025/Source/WebCore/bindings/v8/ScriptCachedFrameData.cpp 2012-02-06 22:06:43 UTC (rev 106848)
@@ -59,7 +59,7 @@
if (m_context.get().IsEmpty())
return;
- if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript))
+ if (!frame || !frame->script()->canExecuteScripts(NotAboutToExecuteScript))
return;
v8::HandleScope handleScope;
Modified: branches/chromium/1025/Source/WebCore/page/DOMTimer.cpp (106847 => 106848)
--- branches/chromium/1025/Source/WebCore/page/DOMTimer.cpp 2012-02-06 21:59:08 UTC (rev 106847)
+++ branches/chromium/1025/Source/WebCore/page/DOMTimer.cpp 2012-02-06 22:06:43 UTC (rev 106848)
@@ -27,7 +27,6 @@
#include "config.h"
#include "DOMTimer.h"
-#include "Document.h"
#include "InspectorInstrumentation.h"
#include "ScheduledAction.h"
#include "ScriptExecutionContext.h"
@@ -71,9 +70,6 @@
, m_originalInterval(interval)
, m_shouldForwardUserGesture(shouldForwardUserGesture(interval, m_nestingLevel))
{
- // FIXME: remove once we found out the root cause for http://webkit.org/b/77370
- if (scriptExecutionContext()->isDocument() && !static_cast<Document*>(scriptExecutionContext())->frame())
- CRASH();
scriptExecutionContext()->addTimeout(m_timeoutId, this);
double intervalMilliseconds = intervalClampedToMinimum(interval, context->minimumTimerInterval());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes