Changeset 62962 in webkit


Ignore:
Timestamp:
Jul 9, 2010 10:06:04 AM (14 years ago)
Author:
vitalyr@chromium.org
Message:

2010-07-09 Vitaly Repeshko <vitalyr@chromium.org>

Reviewed by Pavel Feldman.

[v8] Call JS gc in a fresh context to avoid retaining the current one.
https://bugs.webkit.org/show_bug.cgi?id=41963
http://crbug.com/46571

  • bindings/v8/ScriptController.cpp: (WebCore::ScriptController::collectGarbage):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r62961 r62962  
     12010-07-09  Vitaly Repeshko  <vitalyr@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        [v8] Call JS gc in a fresh context to avoid retaining the current one.
     6        https://bugs.webkit.org/show_bug.cgi?id=41963
     7        http://crbug.com/46571
     8
     9        * bindings/v8/ScriptController.cpp:
     10        (WebCore::ScriptController::collectGarbage):
     11
    1122010-07-09  Kenneth Russell  <kbr@google.com>
    213
  • trunk/WebCore/bindings/v8/ScriptController.cpp

    r62380 r62962  
    291291{
    292292    v8::HandleScope handleScope;
    293     v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(m_proxy->frame());
     293
     294    v8::Persistent<v8::Context> v8Context = v8::Context::New();
    294295    if (v8Context.IsEmpty())
    295296        return;
    296 
    297     v8::Context::Scope scope(v8Context);
    298 
    299     m_proxy->evaluate(ScriptSourceCode("if (window.gc) void(gc());"), 0);
     297    {
     298        v8::Context::Scope scope(v8Context);
     299        v8::Local<v8::String> source = v8::String::New("if (gc) gc();");
     300        v8::Local<v8::String> name = v8::String::New("gc");
     301        v8::Handle<v8::Script> script = v8::Script::Compile(source, name);
     302        if (!script.IsEmpty())
     303            script->Run();
     304    }
     305    v8Context.Dispose();
    300306}
    301307
Note: See TracChangeset for help on using the changeset viewer.