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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2633253002: Split content script injections into multiple tasks (Closed)
Patch Set: comments addressed Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.h ('k') | third_party/WebKit/public/web/WebFrameClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 7a7841640270a41d56da11201296ccc46917fdb7..2da2a9d14dbe9054e784e8c4008477faf059f46b 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -754,8 +754,9 @@ void WebLocalFrameImpl::requestExecuteScriptAndReturnValue(
WebScriptExecutionCallback* callback) {
DCHECK(frame());
- SuspendableScriptExecutor::createAndRun(
+ SuspendableScriptExecutor* executor = SuspendableScriptExecutor::create(
frame(), 0, createSourcesVector(&source, 1), userGesture, callback);
+ executor->run();
}
void WebLocalFrameImpl::requestExecuteV8Function(
@@ -803,14 +804,26 @@ void WebLocalFrameImpl::requestExecuteScriptInIsolatedWorld(
const WebScriptSource* sourcesIn,
unsigned numSources,
bool userGesture,
+ ScriptExecutionType option,
WebScriptExecutionCallback* callback) {
DCHECK(frame());
CHECK_GT(worldID, 0);
CHECK_LT(worldID, DOMWrapperWorld::EmbedderWorldIdLimit);
- SuspendableScriptExecutor::createAndRun(
+ SuspendableScriptExecutor* executor = SuspendableScriptExecutor::create(
frame(), worldID, createSourcesVector(sourcesIn, numSources), userGesture,
callback);
+ switch (option) {
+ case AsynchronousBlockingOnload:
+ executor->runAsync(SuspendableScriptExecutor::OnloadBlocking);
+ break;
+ case Asynchronous:
+ executor->runAsync(SuspendableScriptExecutor::NonBlocking);
+ break;
+ case Synchronous:
+ executor->run();
+ break;
+ }
}
// TODO(bashi): Consider returning MaybeLocal.
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.h ('k') | third_party/WebKit/public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698