Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 1878943003: Remove RawPtr from bindings/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698