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

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

Issue 2049003002: Wrap GCed raw pointer parameters of WTF::bind with Persistent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. split RejectedPromise case to another CL. use wrapPersistent in HTMLSlotElement. Created 4 years, 6 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/V8ScriptRunner.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
index 2eee4629034ffe67c7656d0092d67e5dde55812e..f082d78e42e52dc04ed328bbbf62df5f58cc8fb9 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -296,7 +296,7 @@ std::unique_ptr<CompileFn> selectCompileFunction(V8CacheOptions cacheOptions, Ca
switch (cacheOptions) {
case V8CacheOptionsParse:
// Use parser-cache; in-memory only.
- return bind(compileAndConsumeOrProduce, cacheHandler, cacheTag(CacheTagParser, cacheHandler), v8::ScriptCompiler::kConsumeParserCache, v8::ScriptCompiler::kProduceParserCache, CachedMetadataHandler::CacheLocally);
+ return bind(compileAndConsumeOrProduce, wrapCrossThreadPersistent(cacheHandler), cacheTag(CacheTagParser, cacheHandler), v8::ScriptCompiler::kConsumeParserCache, v8::ScriptCompiler::kProduceParserCache, CachedMetadataHandler::CacheLocally);
break;
case V8CacheOptionsDefault:
@@ -307,12 +307,12 @@ std::unique_ptr<CompileFn> selectCompileFunction(V8CacheOptions cacheOptions, Ca
unsigned codeCacheTag = cacheTag(CacheTagCode, cacheHandler);
CachedMetadata* codeCache = cacheHandler->cachedMetadata(codeCacheTag);
if (codeCache)
- return bind(compileAndConsumeCache, cacheHandler, codeCacheTag, v8::ScriptCompiler::kConsumeCodeCache);
+ return bind(compileAndConsumeCache, wrapCrossThreadPersistent(cacheHandler), codeCacheTag, v8::ScriptCompiler::kConsumeCodeCache);
if (cacheOptions != V8CacheOptionsAlways && !isResourceHotForCaching(cacheHandler, hotHours)) {
V8ScriptRunner::setCacheTimeStamp(cacheHandler);
return bind(compileWithoutOptions, V8CompileHistogram::Cacheable);
}
- return bind(compileAndProduceCache, cacheHandler, codeCacheTag, v8::ScriptCompiler::kProduceCodeCache, CachedMetadataHandler::SendToPlatform);
+ return bind(compileAndProduceCache, wrapCrossThreadPersistent(cacheHandler), codeCacheTag, v8::ScriptCompiler::kProduceCodeCache, CachedMetadataHandler::SendToPlatform);
break;
}
@@ -338,7 +338,7 @@ std::unique_ptr<CompileFn> selectCompileFunction(V8CacheOptions cacheOptions, Sc
ASSERT(!resource->errorOccurred());
ASSERT(streamer->isFinished());
ASSERT(!streamer->streamingSuppressed());
- return WTF::bind<v8::Isolate*, v8::Local<v8::String>, v8::ScriptOrigin>(postStreamCompile, cacheOptions, resource->cacheHandler(), streamer);
+ return WTF::bind<v8::Isolate*, v8::Local<v8::String>, v8::ScriptOrigin>(postStreamCompile, cacheOptions, wrapCrossThreadPersistent(resource->cacheHandler()), wrapCrossThreadPersistent(streamer));
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698