Title: [146295] trunk/Source/WebCore
Revision
146295
Author
commit-qu...@webkit.org
Date
2013-03-19 19:38:54 -0700 (Tue, 19 Mar 2013)

Log Message

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

Patch by Ankur Taly <at...@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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (146294 => 146295)


--- trunk/Source/WebCore/ChangeLog	2013-03-20 02:14:26 UTC (rev 146294)
+++ trunk/Source/WebCore/ChangeLog	2013-03-20 02:38:54 UTC (rev 146295)
@@ -1,3 +1,29 @@
+2013-03-19  Ankur Taly  <at...@google.com>
+
+        Cache a pointer to V8DOMActivityLogger in PerContextData.
+        https://bugs.webkit.org/show_bug.cgi?id=112719
+
+        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):
+
 2013-03-19  Arnaud Renevier  <a.renev...@sisa.samsung.com>
 
         do not use string reference for enum support in CodeGeneratorJS.pm

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (146294 => 146295)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2013-03-20 02:14:26 UTC (rev 146294)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2013-03-20 02:38:54 UTC (rev 146295)
@@ -239,7 +239,7 @@
         disposeContext();
         return false;
     }
-
+    m_perContextData->setActivityLogger(DOMWrapperWorld::activityLogger(m_world->worldId()));
     if (!installDOMWindow()) {
         disposeContext();
         return false;

Modified: trunk/Source/WebCore/bindings/v8/V8PerContextData.h (146294 => 146295)


--- trunk/Source/WebCore/bindings/v8/V8PerContextData.h	2013-03-20 02:14:26 UTC (rev 146294)
+++ trunk/Source/WebCore/bindings/v8/V8PerContextData.h	2013-03-20 02:38:54 UTC (rev 146295)
@@ -32,6 +32,7 @@
 #define V8PerContextData_h
 
 #include "ScopedPersistent.h"
+#include "V8DOMActivityLogger.h"
 #include "WrapperTypeInfo.h"
 #include <v8.h>
 #include <wtf/HashMap.h>
@@ -93,6 +94,16 @@
         return &m_v8NPObjectMap;
     }
 
+    V8DOMActivityLogger* activityLogger()
+    {
+        return m_activityLogger;
+    }
+
+    void setActivityLogger(V8DOMActivityLogger* logger)
+    {
+        m_activityLogger = logger;
+    }
+
 private:
     explicit V8PerContextData(v8::Persistent<v8::Context> context)
         : m_context(context)
@@ -113,7 +124,10 @@
     ConstructorMap m_constructorMap;
 
     V8NPObjectMap m_v8NPObjectMap;
-
+    // We cache a pointer to the V8DOMActivityLogger associated with the world
+    // corresponding to this context. The ownership of the pointer is retained
+    // by the DOMActivityLoggerMap in DOMWrapperWorld.
+    V8DOMActivityLogger* m_activityLogger;
     v8::Persistent<v8::Context> m_context;
     ScopedPersistent<v8::Value> m_errorPrototype;
     ScopedPersistent<v8::Value> m_objectPrototype;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to