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

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

Issue 2301213003: Add tests for trace wrappers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix StringView problem Created 4 years, 3 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/V8GCController.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
index c1f74c4286e808879c9edb1af455d55690c9cafd..420c665889d4ffd4de3d201c126ef8136fc42b2c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
@@ -392,12 +392,14 @@ void V8GCController::gcEpilogue(v8::Isolate* isolate, v8::GCType type, v8::GCCal
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data());
}
-void V8GCController::collectGarbage(v8::Isolate* isolate)
+void V8GCController::collectGarbage(v8::Isolate* isolate, bool onlyMinorGc)
haraken 2016/09/02 10:53:14 onlyMinorGC
Marcel Hlopko 2016/09/02 12:12:40 Done.
{
v8::HandleScope handleScope(isolate);
RefPtr<ScriptState> scriptState = ScriptState::create(v8::Context::New(isolate), DOMWrapperWorld::create(isolate));
ScriptState::Scope scope(scriptState.get());
- V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, "if (gc) gc();"), isolate);
+ String flag = onlyMinorGc ? "true" : "false";
+ V8ScriptRunner::compileAndRunInternalScript(
+ v8String(isolate, (String) ("if (gc) gc(" + flag + ")")), isolate);
haraken 2016/09/02 10:53:14 Use StringBuilder instead. StringBuilder builder
Marcel Hlopko 2016/09/02 12:12:40 Done.
scriptState->disposePerContextData();
}

Powered by Google App Engine
This is Rietveld 408576698