Title: [126811] trunk/Source/WebCore
Revision
126811
Author
[email protected]
Date
2012-08-27 15:45:38 -0700 (Mon, 27 Aug 2012)

Log Message

[V8] Improve the names of some private functions of V8DOMWindowShell.cpp
https://bugs.webkit.org/show_bug.cgi?id=95132

Reviewed by Eric Seidel.

V8DOMWindowShell has a concept of a "DocumentWrapperCache", but that's
more easily understood as the "document" property of the Window. This
patch renames a couple functions to make this clearer.

This patch as renames disposeContextHandles to disposeContext because
that's what's actually happening.

* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::isContextInitialized):
(WebCore::V8DOMWindowShell::disposeContext):
(WebCore::V8DOMWindowShell::clearForClose):
(WebCore::V8DOMWindowShell::clearForNavigation):
(WebCore):
(WebCore::V8DOMWindowShell::initializeIfNeeded):
(WebCore::V8DOMWindowShell::updateDocumentProperty):
(WebCore::V8DOMWindowShell::clearDocumentProperty):
(WebCore::V8DOMWindowShell::updateDocument):
* bindings/v8/V8DOMWindowShell.h:
(V8DOMWindowShell):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126810 => 126811)


--- trunk/Source/WebCore/ChangeLog	2012-08-27 22:42:30 UTC (rev 126810)
+++ trunk/Source/WebCore/ChangeLog	2012-08-27 22:45:38 UTC (rev 126811)
@@ -1,3 +1,30 @@
+2012-08-27  Adam Barth  <[email protected]>
+
+        [V8] Improve the names of some private functions of V8DOMWindowShell.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=95132
+
+        Reviewed by Eric Seidel.
+
+        V8DOMWindowShell has a concept of a "DocumentWrapperCache", but that's
+        more easily understood as the "document" property of the Window. This
+        patch renames a couple functions to make this clearer.
+
+        This patch as renames disposeContextHandles to disposeContext because
+        that's what's actually happening.
+
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::isContextInitialized):
+        (WebCore::V8DOMWindowShell::disposeContext):
+        (WebCore::V8DOMWindowShell::clearForClose):
+        (WebCore::V8DOMWindowShell::clearForNavigation):
+        (WebCore):
+        (WebCore::V8DOMWindowShell::initializeIfNeeded):
+        (WebCore::V8DOMWindowShell::updateDocumentProperty):
+        (WebCore::V8DOMWindowShell::clearDocumentProperty):
+        (WebCore::V8DOMWindowShell::updateDocument):
+        * bindings/v8/V8DOMWindowShell.h:
+        (V8DOMWindowShell):
+
 2012-08-24  James Robinson  <[email protected]>
 
         WebGL should not flip textures on presentation if contents are unchanged

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (126810 => 126811)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2012-08-27 22:42:30 UTC (rev 126810)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2012-08-27 22:45:38 UTC (rev 126811)
@@ -182,13 +182,11 @@
 
 bool V8DOMWindowShell::isContextInitialized()
 {
-    // m_context, m_global, and m_wrapperBoilerplates should
-    // all be non-empty if if m_context is non-empty.
     ASSERT(m_context.isEmpty() || !m_global.isEmpty());
     return !m_context.isEmpty();
 }
 
-void V8DOMWindowShell::disposeContextHandles()
+void V8DOMWindowShell::disposeContext()
 {
     if (!m_context.isEmpty()) {
         m_frame->loader()->client()->willReleaseScriptContext(m_context.get(), 0);
@@ -216,7 +214,7 @@
 
     v8::HandleScope handleScope;
     clearDocumentWrapper();
-    disposeContextHandles();
+    disposeContext();
 }
 
 void V8DOMWindowShell::clearForNavigation()
@@ -233,13 +231,13 @@
     // Clear the document wrapper cache before turning on access checks on
     // the old DOMWindow wrapper. This way, access to the document wrapper
     // will be protected by the security checks on the DOMWindow wrapper.
-    clearDocumentWrapperCache();
+    clearDocumentProperty();
 
     v8::Handle<v8::Object> windowWrapper = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), m_global.get());
     ASSERT(!windowWrapper.IsEmpty());
     windowWrapper->TurnOnAccessCheck();
     m_context->DetachGlobal();
-    disposeContextHandles();
+    disposeContext();
 }
 
 // Create a new environment and setup the global object.
@@ -248,11 +246,11 @@
 // allow properties of the JS DOMWindow instance to be shadowed, we
 // use a shadow object as the global object and use the JS DOMWindow
 // instance as the prototype for that shadow object. The JS DOMWindow
-// instance is undetectable from _javascript_ code because the __proto__
+// instance is undetectable from _javascript_ code because the __proto__
 // accessors skip that object.
 //
 // The shadow object and the DOMWindow instance are seen as one object
-// from _javascript_. The _javascript_ object that corresponds to a
+// from _javascript_. The _javascript_ object that corresponds to a
 // DOMWindow instance is the shadow object. When mapping a DOMWindow
 // instance to a V8 object, we return the shadow object.
 //
@@ -296,19 +294,19 @@
     if (m_global.isEmpty()) {
         m_global.set(context->Global());
         if (m_global.isEmpty()) {
-            disposeContextHandles();
+            disposeContext();
             return false;
         }
     }
 
     m_perContextData = V8PerContextData::create(m_context.get());
     if (!m_perContextData->init()) {
-        disposeContextHandles();
+        disposeContext();
         return false;
     }
 
     if (!installDOMWindow(context, m_frame->document()->domWindow())) {
-        disposeContextHandles();
+        disposeContext();
         return false;
     }
 
@@ -410,7 +408,7 @@
     m_document.clear();
 }
 
-void V8DOMWindowShell::updateDocumentWrapperCache()
+void V8DOMWindowShell::updateDocumentProperty()
 {
     v8::HandleScope handleScope;
     // FIXME: Should we use a new Local handle here?
@@ -425,7 +423,7 @@
     // accessor handle access to the document.
     // FIXME: This should not be possible anymore.
     if (!m_frame->document()->frame()) {
-        clearDocumentWrapperCache();
+        clearDocumentProperty();
         return;
     }
 
@@ -438,7 +436,7 @@
     // If instantiation of the document wrapper fails, clear the cache
     // and let the DOMWindow accessor handle access to the document.
     if (documentWrapper.IsEmpty()) {
-        clearDocumentWrapperCache();
+        clearDocumentProperty();
         return;
     }
     ASSERT(documentWrapper->IsObject());
@@ -451,7 +449,7 @@
     v8RealGlobal->SetHiddenValue(V8HiddenPropertyName::document(), documentWrapper);
 }
 
-void V8DOMWindowShell::clearDocumentWrapperCache()
+void V8DOMWindowShell::clearDocumentProperty()
 {
     ASSERT(!m_context.isEmpty());
     m_context->Global()->ForceDelete(v8::String::New("document"));
@@ -511,7 +509,7 @@
         return;
 
     // We have a new document and we need to update the cache.
-    updateDocumentWrapperCache();
+    updateDocumentProperty();
 
     updateSecurityOrigin();
 }

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h (126810 => 126811)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h	2012-08-27 22:42:30 UTC (rev 126810)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h	2012-08-27 22:45:38 UTC (rev 126811)
@@ -84,17 +84,17 @@
 private:
     V8DOMWindowShell(Frame*);
 
-    void disposeContextHandles();
+    void disposeContext();
 
     void setSecurityToken();
     void clearDocumentWrapper();
 
     // The _javascript_ wrapper for the document object is cached on the global
-    // object for fast access. UpdateDocumentWrapperCache sets the wrapper
-    // for the current document on the global object. ClearDocumentWrapperCache
+    // object for fast access. UpdateDocumentProperty sets the wrapper
+    // for the current document on the global object. ClearDocumentProperty
     // deletes the document wrapper from the global object.
-    void updateDocumentWrapperCache();
-    void clearDocumentWrapperCache();
+    void updateDocumentProperty();
+    void clearDocumentProperty();
 
     Frame* m_frame;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to