Index: Source/bindings/core/v8/ScriptController.cpp |
diff --git a/Source/bindings/core/v8/ScriptController.cpp b/Source/bindings/core/v8/ScriptController.cpp |
index 30482004680d0ffe285856ea4f2d91cca0fb404e..0168b8920c82ba1242108a0baeb956ee5b5c0891 100644 |
--- a/Source/bindings/core/v8/ScriptController.cpp |
+++ b/Source/bindings/core/v8/ScriptController.cpp |
@@ -54,6 +54,7 @@ |
#include "core/dom/ScriptableDocumentParser.h" |
#include "core/events/Event.h" |
#include "core/events/EventListener.h" |
+#include "core/frame/FrameProtector.h" |
#include "core/frame/LocalDOMWindow.h" |
#include "core/frame/LocalFrame.h" |
#include "core/frame/Settings.h" |
@@ -142,7 +143,7 @@ void ScriptController::updateSecurityOrigin(SecurityOrigin* origin) |
v8::Local<v8::Value> ScriptController::callFunction(v8::Handle<v8::Function> function, v8::Handle<v8::Value> receiver, int argc, v8::Handle<v8::Value> info[]) |
{ |
// Keep LocalFrame (and therefore ScriptController) alive. |
- RefPtr<LocalFrame> protect(m_frame); |
+ FrameProtector protect(m_frame); |
return ScriptController::callFunction(m_frame->document(), function, receiver, argc, info, m_isolate); |
} |
@@ -189,7 +190,7 @@ v8::Local<v8::Value> ScriptController::executeScriptAndReturnValue(v8::Handle<v8 |
v8::Handle<v8::Script> script = V8ScriptRunner::compileScript(source, m_isolate, corsStatus, v8CacheOptions); |
// Keep LocalFrame (and therefore ScriptController) alive. |
- RefPtr<LocalFrame> protect(m_frame); |
+ FrameProtector protect(m_frame); |
result = V8ScriptRunner::runCompiledScript(script, m_frame->document(), m_isolate); |
ASSERT(!tryCatch.HasCaught() || result.IsEmpty()); |
} |
@@ -533,7 +534,7 @@ bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) |
// We need to hold onto the LocalFrame here because executing script can |
// destroy the frame. |
- RefPtr<LocalFrame> protector(m_frame); |
+ FrameProtector protect(m_frame); |
RefPtrWillBeRawPtr<Document> ownerDocument(m_frame->document()); |
const int javascriptSchemeLength = sizeof("javascript:") - 1; |
@@ -596,7 +597,7 @@ v8::Local<v8::Value> ScriptController::evaluateScriptInMainWorld(const ScriptSou |
ScriptState* scriptState = ScriptState::from(context); |
ScriptState::Scope scope(scriptState); |
- RefPtr<LocalFrame> protect(m_frame); |
+ FrameProtector protect(m_frame); |
if (m_frame->loader().stateMachine()->isDisplayingInitialEmptyDocument()) |
m_frame->loader().didAccessInitialDocument(); |