| Index: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
|
| index 1bfbdbd0bbbbaa5a955eeb6b01e820afb8f7af51..ae4beb6a02c8e9980a8cdb720723e187a726ccd6 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
|
| @@ -116,8 +116,6 @@ void ScriptController::updateSecurityOrigin(SecurityOrigin* origin)
|
|
|
| v8::MaybeLocal<v8::Value> ScriptController::callFunction(v8::Local<v8::Function> function, v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> info[])
|
| {
|
| - // Keep LocalFrame (and therefore ScriptController) alive.
|
| - RawPtr<LocalFrame> protect(frame());
|
| return ScriptController::callFunction(frame()->document(), function, receiver, argc, info, isolate());
|
| }
|
|
|
| @@ -152,8 +150,6 @@ v8::Local<v8::Value> ScriptController::executeScriptAndReturnValue(v8::Local<v8:
|
| if (compilationFinishTime) {
|
| *compilationFinishTime = WTF::monotonicallyIncreasingTime();
|
| }
|
| - // Keep LocalFrame (and therefore ScriptController) alive.
|
| - RawPtr<LocalFrame> protect(frame());
|
| if (!v8Call(V8ScriptRunner::runCompiledScript(isolate(), script, frame()->document()), result, tryCatch))
|
| return result;
|
| }
|
| @@ -348,10 +344,7 @@ bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url)
|
| if (progressNotificationsNeeded)
|
| frame()->loader().progress().progressStarted();
|
|
|
| - // We need to hold onto the LocalFrame here because executing script can
|
| - // destroy the frame.
|
| - RawPtr<LocalFrame> protect(frame());
|
| - RawPtr<Document> ownerDocument(frame()->document());
|
| + Document* ownerDocument = frame()->document();
|
|
|
| const int javascriptSchemeLength = sizeof("javascript:") - 1;
|
|
|
| @@ -378,7 +371,7 @@ bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url)
|
| if (!locationChangeBefore && frame()->navigationScheduler().locationChangePending())
|
| return true;
|
|
|
| - frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResult, ownerDocument.get());
|
| + frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResult, ownerDocument);
|
| return true;
|
| }
|
|
|
| @@ -410,7 +403,6 @@ v8::Local<v8::Value> ScriptController::evaluateScriptInMainWorld(const ScriptSou
|
| v8::EscapableHandleScope handleScope(isolate());
|
| ScriptState::Scope scope(scriptState);
|
|
|
| - RawPtr<LocalFrame> protect(frame());
|
| if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument())
|
| frame()->loader().didAccessInitialDocument();
|
|
|
|
|