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

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

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
Patch Set: Rebase 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6eb2f137f27a4ac94ec4d790f2321ec1fce2df7e..5923debc33f925a6ec04057d59abcb3c41bd9af9 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -263,9 +263,9 @@ typedef Function<v8::MaybeLocal<v8::Script>(v8::Isolate*, v8::Local<v8::String>,
// This version isn't quite as smart as the real WTF::bind, though, so you
// sometimes may still have to call the original.
template<typename... A>
-PassOwnPtr<CompileFn> bind(const A&... args)
+PassOwnPtr<CompileFn> bind(A&&... args)
{
- return WTF::bind<v8::Isolate*, v8::Local<v8::String>, v8::ScriptOrigin>(args...);
+ return WTF::bind<v8::Isolate*, v8::Local<v8::String>, v8::ScriptOrigin>(std::forward<A>(args)...);
}
// Select a compile function from any of the above, mainly depending on
@@ -291,7 +291,7 @@ PassOwnPtr<CompileFn> selectCompileFunction(V8CacheOptions cacheOptions, CachedM
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, retainedRef(cacheHandler), cacheTag(CacheTagParser, cacheHandler), v8::ScriptCompiler::kConsumeParserCache, v8::ScriptCompiler::kProduceParserCache, CachedMetadataHandler::CacheLocally);
break;
case V8CacheOptionsDefault:
@@ -301,12 +301,12 @@ PassOwnPtr<CompileFn> selectCompileFunction(V8CacheOptions cacheOptions, CachedM
unsigned codeCacheTag = cacheTag(CacheTagCode, cacheHandler);
CachedMetadata* codeCache = cacheHandler->cachedMetadata(codeCacheTag);
if (codeCache)
- return bind(compileAndConsumeCache, cacheHandler, codeCacheTag, v8::ScriptCompiler::kConsumeCodeCache);
+ return bind(compileAndConsumeCache, retainedRef(cacheHandler), codeCacheTag, v8::ScriptCompiler::kConsumeCodeCache);
if (!isResourceHotForCaching(cacheHandler, hotHours)) {
V8ScriptRunner::setCacheTimeStamp(cacheHandler);
return bind(compileWithoutOptions, V8CompileHistogram::Cacheable);
}
- return bind(compileAndProduceCache, cacheHandler, codeCacheTag, v8::ScriptCompiler::kProduceCodeCache, CachedMetadataHandler::SendToPlatform);
+ return bind(compileAndProduceCache, retainedRef(cacheHandler), codeCacheTag, v8::ScriptCompiler::kProduceCodeCache, CachedMetadataHandler::SendToPlatform);
break;
}
@@ -332,7 +332,7 @@ PassOwnPtr<CompileFn> selectCompileFunction(V8CacheOptions cacheOptions, ScriptR
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, retainedRef(resource->cacheHandler()), retainedRef(streamer));
}
} // namespace
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698