Changeset 146295 in webkit


Ignore:
Timestamp:
Mar 19, 2013, 7:38:54 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Cache a pointer to V8DOMActivityLogger in PerContextData.
https://bugs.webkit.org/show_bug.cgi?id=112719

Patch by Ankur Taly <ataly@google.com> on 2013-03-19
Reviewed by Kentaro Hara.

Adds a data member (and getter, setter methods) to V8PerContextData
that holds a pointer to a V8DOMActivityLogger. This member is set while
initializing the context for a V8DOMWindowShell. Ownership of the pointer
is still retained by the HashMap in DOMWrapperWorld.
As a result of this patch, subsequent patches that will implement logging
for DOM API access (See bug 107207) will be able to obtain a reference to
the logger directly from PerContextData. This will benefit performance as it
will be faster than looking up the logger in the DOMActivityLoggerMap in
DOMWrapperWorld.

There are no new tests as there is no change in behavior.

  • bindings/v8/V8DOMWindowShell.cpp:

(WebCore::V8DOMWindowShell::initializeIfNeeded):

  • bindings/v8/V8PerContextData.h:

(WebCore::V8PerContextData::activityLogger):
(V8PerContextData):
(WebCore::V8PerContextData::setActivityLogger):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r146292 r146295  
     12013-03-19  Ankur Taly  <ataly@google.com>
     2
     3        Cache a pointer to V8DOMActivityLogger in PerContextData.
     4        https://bugs.webkit.org/show_bug.cgi?id=112719
     5
     6        Reviewed by Kentaro Hara.
     7
     8        Adds a data member (and getter, setter methods) to V8PerContextData
     9        that holds a pointer to a V8DOMActivityLogger. This member is set while
     10        initializing the context for a V8DOMWindowShell. Ownership of the pointer
     11        is still retained by the HashMap in DOMWrapperWorld.
     12        As a result of this patch, subsequent patches that will implement logging
     13        for DOM API access (See bug 107207) will be able to obtain a reference to
     14        the logger directly from PerContextData. This will benefit performance as it
     15        will be faster than looking up the logger in the DOMActivityLoggerMap in
     16        DOMWrapperWorld.
     17
     18        There are no new tests as there is no change in behavior.
     19
     20        * bindings/v8/V8DOMWindowShell.cpp:
     21        (WebCore::V8DOMWindowShell::initializeIfNeeded):
     22        * bindings/v8/V8PerContextData.h:
     23        (WebCore::V8PerContextData::activityLogger):
     24        (V8PerContextData):
     25        (WebCore::V8PerContextData::setActivityLogger):
     26
    1272013-03-19  Arnaud Renevier  <a.renevier@sisa.samsung.com>
    228
  • trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp

    r145765 r146295  
    240240        return false;
    241241    }
    242 
     242    m_perContextData->setActivityLogger(DOMWrapperWorld::activityLogger(m_world->worldId()));
    243243    if (!installDOMWindow()) {
    244244        disposeContext();
  • trunk/Source/WebCore/bindings/v8/V8PerContextData.h

    r135601 r146295  
    3333
    3434#include "ScopedPersistent.h"
     35#include "V8DOMActivityLogger.h"
    3536#include "WrapperTypeInfo.h"
    3637#include <v8.h>
     
    9495    }
    9596
     97    V8DOMActivityLogger* activityLogger()
     98    {
     99        return m_activityLogger;
     100    }
     101
     102    void setActivityLogger(V8DOMActivityLogger* logger)
     103    {
     104        m_activityLogger = logger;
     105    }
     106
    96107private:
    97108    explicit V8PerContextData(v8::Persistent<v8::Context> context)
     
    114125
    115126    V8NPObjectMap m_v8NPObjectMap;
    116 
     127    // We cache a pointer to the V8DOMActivityLogger associated with the world
     128    // corresponding to this context. The ownership of the pointer is retained
     129    // by the DOMActivityLoggerMap in DOMWrapperWorld.
     130    V8DOMActivityLogger* m_activityLogger;
    117131    v8::Persistent<v8::Context> m_context;
    118132    ScopedPersistent<v8::Value> m_errorPrototype;
Note: See TracChangeset for help on using the changeset viewer.