| Index: Source/bindings/v8/V8GCController.cpp
|
| diff --git a/Source/bindings/v8/V8GCController.cpp b/Source/bindings/v8/V8GCController.cpp
|
| index fc53af3a550380da85782aa3f3a16158c512c709..c2f21131afd3c5b5a8d168427d0a6993051c2b4f 100644
|
| --- a/Source/bindings/v8/V8GCController.cpp
|
| +++ b/Source/bindings/v8/V8GCController.cpp
|
| @@ -34,6 +34,7 @@
|
| #include "V8MessagePort.h"
|
| #include "V8MutationObserver.h"
|
| #include "V8Node.h"
|
| +#include "V8ScriptRunner.h"
|
| #include "bindings/v8/RetainedDOMInfo.h"
|
| #include "bindings/v8/V8AbstractEventListener.h"
|
| #include "bindings/v8/V8Binding.h"
|
| @@ -415,28 +416,9 @@ void V8GCController::hintForCollectGarbage()
|
| v8::V8::IdleNotification(longIdlePauseInMS);
|
| }
|
|
|
| -void V8GCController::collectGarbage()
|
| +void V8GCController::collectGarbage(v8::Isolate* isolate)
|
| {
|
| - v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
| - v8::HandleScope handleScope(isolate);
|
| -
|
| - ScopedPersistent<v8::Context> context;
|
| - context.set(v8::Context::New(isolate));
|
| - if (context.isEmpty())
|
| - return;
|
| -
|
| - {
|
| - v8::Context::Scope scope(context.get());
|
| - v8::Local<v8::String> source = v8::String::New("if (gc) gc();");
|
| - v8::Local<v8::String> name = v8::String::New("gc");
|
| - v8::Handle<v8::Script> script = v8::Script::Compile(source, name);
|
| - if (!script.IsEmpty()) {
|
| - V8RecursionScope::MicrotaskSuppression scope;
|
| - script->Run();
|
| - }
|
| - }
|
| -
|
| - context.clear();
|
| + V8ScriptRunner::compileAndRunInternalScript(v8String("if (gc) gc();", isolate), isolate);
|
| }
|
|
|
| } // namespace WebCore
|
|
|