Changeset 90407 in webkit


Ignore:
Timestamp:
Jul 5, 2011 3:13:41 PM (13 years ago)
Author:
hans@chromium.org
Message:

2011-07-05 Hans Wennborg <hans@chromium.org>

[V8][Chromium] Remove use of OwnHandle from V8LocalContext
https://bugs.webkit.org/show_bug.cgi?id=63925

Reviewed by Adam Barth.

Replace the OwnHandle<> member in V8LocalContext with
v8::Persistent<v8::Context>.
The code that used OwnHandle<> would not correctly Dispose
of the Context, which would cause the memory to fill up when creating
and destructing many V8LocalContext objects, such as in the case
of IndexedDB.

  • bindings/v8/V8Utilities.cpp: (WebCore::V8LocalContext::V8LocalContext): (WebCore::V8LocalContext::~V8LocalContext):
  • bindings/v8/V8Utilities.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90406 r90407  
     12011-07-05  Hans Wennborg  <hans@chromium.org>
     2
     3        [V8][Chromium] Remove use of OwnHandle from V8LocalContext
     4        https://bugs.webkit.org/show_bug.cgi?id=63925
     5
     6        Reviewed by Adam Barth.
     7
     8        Replace the OwnHandle<> member in V8LocalContext with
     9        v8::Persistent<v8::Context>.
     10        The code that used OwnHandle<> would not correctly Dispose
     11        of the Context, which would cause the memory to fill up when creating
     12        and destructing many V8LocalContext objects, such as in the case
     13        of IndexedDB.
     14
     15        * bindings/v8/V8Utilities.cpp:
     16        (WebCore::V8LocalContext::V8LocalContext):
     17        (WebCore::V8LocalContext::~V8LocalContext):
     18        * bindings/v8/V8Utilities.h:
     19
    1202011-07-05  Igor Oliveira  <igor.oliveira@openbossa.org>
    221
  • trunk/Source/WebCore/bindings/v8/V8Utilities.cpp

    r88731 r90407  
    5050
    5151V8LocalContext::V8LocalContext()
     52    : m_context(v8::Context::New())
    5253{
    5354    V8BindingPerIsolateData::ensureInitialized(v8::Isolate::GetCurrent());
    54     m_context.set(v8::Context::New());
    55     m_context.get()->Enter();
     55    m_context->Enter();
    5656}
    5757
    5858
    59 V8LocalContext::~V8LocalContext() 
     59V8LocalContext::~V8LocalContext()
    6060{
    61     m_context.get()->Exit();
     61    m_context->Exit();
     62    m_context.Dispose();
    6263}
    6364
  • trunk/Source/WebCore/bindings/v8/V8Utilities.h

    r88731 r90407  
    7272    private:
    7373        v8::HandleScope m_handleScope;
    74         OwnHandle<v8::Context> m_context;
     74        v8::Persistent<v8::Context> m_context;
    7575    };
    7676
Note: See TracChangeset for help on using the changeset viewer.