Diff
Modified: trunk/Source/WebCore/ChangeLog (110514 => 110515)
--- trunk/Source/WebCore/ChangeLog 2012-03-13 00:50:22 UTC (rev 110514)
+++ trunk/Source/WebCore/ChangeLog 2012-03-13 00:53:27 UTC (rev 110515)
@@ -1,3 +1,26 @@
+2012-03-12 Kentaro Hara <[email protected]>
+
+ [V8] Refactor some header includes in V8 bindings
+ https://bugs.webkit.org/show_bug.cgi?id=80913
+
+ Reviewed by Adam Barth.
+
+ This patch refactors some header includes in V8 bindings
+ required for fixing bug 80841.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/DOMDataStore.h:
+ (DOMDataStore):
+ * bindings/v8/V8DOMMap.h:
+ * bindings/v8/V8DOMWrapper.cpp:
+ * bindings/v8/V8IsolatedContext.cpp:
+ (WebCore::V8IsolatedContext::isolatedContext):
+ * bindings/v8/V8IsolatedContext.h:
+ (WebCore::V8IsolatedContext::getEntered):
+ (V8IsolatedContext):
+ * bindings/v8/WorldContextHandle.cpp:
+
2012-03-12 Sheriff Bot <[email protected]>
Unreviewed, rolling out r110501.
Modified: trunk/Source/WebCore/bindings/v8/DOMDataStore.h (110514 => 110515)
--- trunk/Source/WebCore/bindings/v8/DOMDataStore.h 2012-03-13 00:50:22 UTC (rev 110514)
+++ trunk/Source/WebCore/bindings/v8/DOMDataStore.h 2012-03-13 00:53:27 UTC (rev 110515)
@@ -32,7 +32,6 @@
#define DOMDataStore_h
#include "V8DOMMap.h"
-#include "V8Node.h"
#include <v8.h>
#include <wtf/HashMap.h>
@@ -98,7 +97,7 @@
#if ENABLE(SVG)
static void weakSVGElementInstanceCallback(v8::Persistent<v8::Value> v8Object, void* domObject);
#endif
-
+
DOMNodeMapping* m_domNodeMap;
DOMNodeMapping* m_activeDomNodeMap;
DOMWrapperMap<void>* m_domObjectMap;
Modified: trunk/Source/WebCore/bindings/v8/V8DOMMap.h (110514 => 110515)
--- trunk/Source/WebCore/bindings/v8/V8DOMMap.h 2012-03-13 00:50:22 UTC (rev 110514)
+++ trunk/Source/WebCore/bindings/v8/V8DOMMap.h 2012-03-13 00:53:27 UTC (rev 110515)
@@ -141,9 +141,6 @@
DOMWrapperMap(v8::WeakReferenceCallback callback) : WeakReferenceMap<KeyType, v8::Object>(callback) { }
};
- // An opaque class that represents a set of DOM wrappers.
- class DOMDataStore;
-
// A utility class to manage the lifetime of set of DOM wrappers.
class DOMDataStoreHandle {
public:
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp (110514 => 110515)
--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp 2012-03-13 00:50:22 UTC (rev 110514)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp 2012-03-13 00:53:27 UTC (rev 110515)
@@ -69,9 +69,6 @@
namespace WebCore {
-typedef HashMap<Node*, v8::Object*> DOMNodeMap;
-typedef HashMap<void*, v8::Object*> DOMObjectMap;
-
static ALWAYS_INLINE v8::Handle<v8::Object> getExistingWrapperInline(Node* node)
{
V8IsolatedContext* context = V8IsolatedContext::getEntered();
Modified: trunk/Source/WebCore/bindings/v8/V8IsolatedContext.cpp (110514 => 110515)
--- trunk/Source/WebCore/bindings/v8/V8IsolatedContext.cpp 2012-03-13 00:50:22 UTC (rev 110514)
+++ trunk/Source/WebCore/bindings/v8/V8IsolatedContext.cpp 2012-03-13 00:53:27 UTC (rev 110515)
@@ -37,9 +37,14 @@
#include "SecurityOrigin.h"
#include "V8DOMWindow.h"
#include "V8HiddenPropertyName.h"
+#include "V8Proxy.h"
namespace WebCore {
+V8IsolatedContext* V8IsolatedContext::isolatedContext()
+{
+ return reinterpret_cast<V8IsolatedContext*>(getGlobalObject(v8::Context::GetEntered())->GetPointerFromInternalField(V8DOMWindow::enteredIsolatedWorldIndex));
+}
void V8IsolatedContext::contextWeakReferenceCallback(v8::Persistent<v8::Value> object, void* isolatedContext)
{
Modified: trunk/Source/WebCore/bindings/v8/V8IsolatedContext.h (110514 => 110515)
--- trunk/Source/WebCore/bindings/v8/V8IsolatedContext.h 2012-03-13 00:50:22 UTC (rev 110514)
+++ trunk/Source/WebCore/bindings/v8/V8IsolatedContext.h 2012-03-13 00:53:27 UTC (rev 110515)
@@ -33,8 +33,7 @@
#include "IsolatedWorld.h"
#include "ScriptSourceCode.h" // for WebCore::ScriptSourceCode
-#include "V8DOMWindow.h"
-#include "V8Proxy.h"
+#include "SharedPersistent.h"
#include "V8Utilities.h"
#include <v8.h>
@@ -77,8 +76,8 @@
//
static V8IsolatedContext* getEntered()
{
- // This is a temporary performance optimization. Essentially,
- // GetHiddenValue is too slow for this code path. We need to get the
+ // This is a temporary performance optimization. Essentially,
+ // GetHiddenValue is too slow for this code path. We need to get the
// V8 team to add a real property to v8::Context for isolated worlds.
// Until then, we optimize the common case of not having any isolated
// worlds at all.
@@ -86,7 +85,7 @@
return 0;
if (!v8::Context::InContext())
return 0;
- return reinterpret_cast<V8IsolatedContext*>(getGlobalObject(v8::Context::GetEntered())->GetPointerFromInternalField(V8DOMWindow::enteredIsolatedWorldIndex));
+ return isolatedContext();
}
v8::Handle<v8::Context> context() { return m_context->get(); }
@@ -107,6 +106,8 @@
// to be destroyed.
static void contextWeakReferenceCallback(v8::Persistent<v8::Value> object, void* isolatedContext);
+ static V8IsolatedContext* isolatedContext();
+
// The underlying v8::Context. This object is keep on the heap as
// long as |m_context| has not been garbage collected.
RefPtr<SharedPersistent<v8::Context> > m_context;
Modified: trunk/Source/WebCore/bindings/v8/WorldContextHandle.cpp (110514 => 110515)
--- trunk/Source/WebCore/bindings/v8/WorldContextHandle.cpp 2012-03-13 00:50:22 UTC (rev 110514)
+++ trunk/Source/WebCore/bindings/v8/WorldContextHandle.cpp 2012-03-13 00:53:27 UTC (rev 110515)
@@ -32,6 +32,7 @@
#include "WorldContextHandle.h"
#include "V8IsolatedContext.h"
+#include "V8Proxy.h"
namespace WebCore {