Commit 4984e2e6 authored by haraken@chromium.org's avatar haraken@chromium.org

Rename V8WindowShell to WindowProxy

V8WindowShell is an implementation of "WindowProxy" in the spec
(http://www.w3.org/TR/2009/WD-html5-20090423/browsers.html#windowproxy).
We should rename it accordingly.

Review URL: https://codereview.chromium.org/451013003

git-svn-id: svn://svn.chromium.org/blink/trunk@180146 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ca0af7a1
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "bindings/core/v8/V8DOMActivityLogger.h" #include "bindings/core/v8/V8DOMActivityLogger.h"
#include "bindings/core/v8/V8DOMWrapper.h" #include "bindings/core/v8/V8DOMWrapper.h"
#include "bindings/core/v8/V8Window.h" #include "bindings/core/v8/V8Window.h"
#include "bindings/core/v8/V8WindowShell.h" #include "bindings/core/v8/WindowProxy.h"
#include "bindings/core/v8/WrapperTypeInfo.h" #include "bindings/core/v8/WrapperTypeInfo.h"
#include "core/dom/ExecutionContext.h" #include "core/dom/ExecutionContext.h"
#include "wtf/HashTraits.h" #include "wtf/HashTraits.h"
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8ScriptRunner.h" #include "bindings/core/v8/V8ScriptRunner.h"
#include "bindings/core/v8/V8Window.h" #include "bindings/core/v8/V8Window.h"
#include "bindings/core/v8/V8WindowShell.h" #include "bindings/core/v8/WindowProxy.h"
#include "core/frame/FrameConsole.h" #include "core/frame/FrameConsole.h"
#include "core/frame/FrameHost.h" #include "core/frame/FrameHost.h"
#include "core/frame/LocalFrame.h" #include "core/frame/LocalFrame.h"
...@@ -126,10 +126,10 @@ void PageScriptDebugServer::addListener(ScriptDebugListener* listener, Page* pag ...@@ -126,10 +126,10 @@ void PageScriptDebugServer::addListener(ScriptDebugListener* listener, Page* pag
ASSERT(!debuggerScript->IsUndefined()); ASSERT(!debuggerScript->IsUndefined());
m_listenersMap.set(page, listener); m_listenersMap.set(page, listener);
V8WindowShell* shell = scriptController.existingWindowShell(DOMWrapperWorld::mainWorld()); WindowProxy* windowProxy = scriptController.existingWindowProxy(DOMWrapperWorld::mainWorld());
if (!shell || !shell->isContextInitialized()) if (!windowProxy || !windowProxy->isContextInitialized())
return; return;
v8::Local<v8::Context> context = shell->context(); v8::Local<v8::Context> context = windowProxy->context();
v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getScripts"))); v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getScripts")));
v8::Handle<v8::Value> argv[] = { context->GetEmbedderData(0) }; v8::Handle<v8::Value> argv[] = { context->GetEmbedderData(0) };
v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(getScriptsFunction, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate); v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(getScriptsFunction, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate);
......
...@@ -56,7 +56,7 @@ class LocalFrame; ...@@ -56,7 +56,7 @@ class LocalFrame;
class ScriptState; class ScriptState;
class ScriptSourceCode; class ScriptSourceCode;
class SecurityOrigin; class SecurityOrigin;
class V8WindowShell; class WindowProxy;
class Widget; class Widget;
typedef WTF::Vector<v8::Extension*> V8Extensions; typedef WTF::Vector<v8::Extension*> V8Extensions;
...@@ -77,8 +77,8 @@ public: ...@@ -77,8 +77,8 @@ public:
~ScriptController(); ~ScriptController();
bool initializeMainWorld(); bool initializeMainWorld();
V8WindowShell* windowShell(DOMWrapperWorld&); WindowProxy* windowProxy(DOMWrapperWorld&);
V8WindowShell* existingWindowShell(DOMWrapperWorld&); WindowProxy* existingWindowProxy(DOMWrapperWorld&);
// Evaluate JavaScript in the main world. // Evaluate JavaScript in the main world.
void executeScriptInMainWorld(const String&, ExecuteScriptPolicy = DoNotExecuteScriptWhenScriptsDisabled); void executeScriptInMainWorld(const String&, ExecuteScriptPolicy = DoNotExecuteScriptWhenScriptsDisabled);
...@@ -124,7 +124,7 @@ public: ...@@ -124,7 +124,7 @@ public:
TextPosition eventHandlerPosition() const; TextPosition eventHandlerPosition() const;
void clearWindowShell(); void clearWindowProxy();
void updateDocument(); void updateDocument();
void namedItemAdded(HTMLDocument*, const AtomicString&); void namedItemAdded(HTMLDocument*, const AtomicString&);
...@@ -150,7 +150,7 @@ public: ...@@ -150,7 +150,7 @@ public:
v8::Isolate* isolate() const { return m_isolate; } v8::Isolate* isolate() const { return m_isolate; }
private: private:
typedef HashMap<int, OwnPtr<V8WindowShell> > IsolatedWorldMap; typedef HashMap<int, OwnPtr<WindowProxy> > IsolatedWorldMap;
typedef HashMap<Widget*, NPObject*> PluginObjectMap; typedef HashMap<Widget*, NPObject*> PluginObjectMap;
v8::Local<v8::Value> evaluateScriptInMainWorld(const ScriptSourceCode&, AccessControlStatus, ExecuteScriptPolicy); v8::Local<v8::Value> evaluateScriptInMainWorld(const ScriptSourceCode&, AccessControlStatus, ExecuteScriptPolicy);
...@@ -159,7 +159,7 @@ private: ...@@ -159,7 +159,7 @@ private:
const String* m_sourceURL; const String* m_sourceURL;
v8::Isolate* m_isolate; v8::Isolate* m_isolate;
OwnPtr<V8WindowShell> m_windowShell; OwnPtr<WindowProxy> m_windowProxy;
IsolatedWorldMap m_isolatedWorlds; IsolatedWorldMap m_isolatedWorlds;
// A mapping between Widgets and their corresponding script object. // A mapping between Widgets and their corresponding script object.
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "bindings/core/v8/ScriptState.h" #include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/V8AbstractEventListener.h" #include "bindings/core/v8/V8AbstractEventListener.h"
#include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8WindowShell.h" #include "bindings/core/v8/WindowProxy.h"
#include "core/dom/Document.h" #include "core/dom/Document.h"
#include "core/dom/DocumentParser.h" #include "core/dom/DocumentParser.h"
#include "core/dom/QualifiedName.h" #include "core/dom/QualifiedName.h"
...@@ -148,7 +148,7 @@ ScriptState* eventListenerHandlerScriptState(LocalFrame* frame, EventListener* l ...@@ -148,7 +148,7 @@ ScriptState* eventListenerHandlerScriptState(LocalFrame* frame, EventListener* l
return 0; return 0;
V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(listener); V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(listener);
v8::HandleScope scope(toIsolate(frame)); v8::HandleScope scope(toIsolate(frame));
v8::Handle<v8::Context> v8Context = frame->script().windowShell(v8Listener->world())->context(); v8::Handle<v8::Context> v8Context = frame->script().windowProxy(v8Listener->world())->context();
return ScriptState::from(v8Context); return ScriptState::from(v8Context);
} }
......
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
#include "bindings/core/v8/V8NodeFilterCondition.h" #include "bindings/core/v8/V8NodeFilterCondition.h"
#include "bindings/core/v8/V8ObjectConstructor.h" #include "bindings/core/v8/V8ObjectConstructor.h"
#include "bindings/core/v8/V8Window.h" #include "bindings/core/v8/V8Window.h"
#include "bindings/core/v8/V8WindowShell.h"
#include "bindings/core/v8/V8WorkerGlobalScope.h" #include "bindings/core/v8/V8WorkerGlobalScope.h"
#include "bindings/core/v8/V8XPathNSResolver.h" #include "bindings/core/v8/V8XPathNSResolver.h"
#include "bindings/core/v8/WindowProxy.h"
#include "bindings/core/v8/WorkerScriptController.h" #include "bindings/core/v8/WorkerScriptController.h"
#include "bindings/core/v8/custom/V8CustomXPathNSResolver.h" #include "bindings/core/v8/custom/V8CustomXPathNSResolver.h"
#include "core/dom/Document.h" #include "core/dom/Document.h"
...@@ -720,7 +720,7 @@ v8::Local<v8::Context> toV8Context(ExecutionContext* context, DOMWrapperWorld& w ...@@ -720,7 +720,7 @@ v8::Local<v8::Context> toV8Context(ExecutionContext* context, DOMWrapperWorld& w
ASSERT(context); ASSERT(context);
if (context->isDocument()) { if (context->isDocument()) {
if (LocalFrame* frame = toDocument(context)->frame()) if (LocalFrame* frame = toDocument(context)->frame())
return frame->script().windowShell(world)->context(); return frame->script().windowProxy(world)->context();
} else if (context->isWorkerGlobalScope()) { } else if (context->isWorkerGlobalScope()) {
if (WorkerScriptController* script = toWorkerGlobalScope(context)->script()) if (WorkerScriptController* script = toWorkerGlobalScope(context)->script())
return script->context(); return script->context();
...@@ -732,7 +732,7 @@ v8::Local<v8::Context> toV8Context(LocalFrame* frame, DOMWrapperWorld& world) ...@@ -732,7 +732,7 @@ v8::Local<v8::Context> toV8Context(LocalFrame* frame, DOMWrapperWorld& world)
{ {
if (!frame) if (!frame)
return v8::Local<v8::Context>(); return v8::Local<v8::Context>();
v8::Local<v8::Context> context = frame->script().windowShell(world)->context(); v8::Local<v8::Context> context = frame->script().windowProxy(world)->context();
if (context.IsEmpty()) if (context.IsEmpty())
return v8::Local<v8::Context>(); return v8::Local<v8::Context>();
LocalFrame* attachedFrame= toFrameIfNotDetached(context); LocalFrame* attachedFrame= toFrameIfNotDetached(context);
......
...@@ -79,7 +79,7 @@ inline void V8DOMWrapper::setNativeInfo(v8::Handle<v8::Object> wrapper, const Wr ...@@ -79,7 +79,7 @@ inline void V8DOMWrapper::setNativeInfo(v8::Handle<v8::Object> wrapper, const Wr
inline void V8DOMWrapper::setNativeInfoForHiddenWrapper(v8::Handle<v8::Object> wrapper, const WrapperTypeInfo* wrapperTypeInfo, ScriptWrappableBase* internalPointer) inline void V8DOMWrapper::setNativeInfoForHiddenWrapper(v8::Handle<v8::Object> wrapper, const WrapperTypeInfo* wrapperTypeInfo, ScriptWrappableBase* internalPointer)
{ {
// see V8WindowShell::installDOMWindow() comment for why this version is needed and safe. // see WindowProxy::installDOMWindow() comment for why this version is needed and safe.
ASSERT(wrapper->InternalFieldCount() >= 2); ASSERT(wrapper->InternalFieldCount() >= 2);
ASSERT(internalPointer); ASSERT(internalPointer);
ASSERT(wrapperTypeInfo); ASSERT(wrapperTypeInfo);
......
...@@ -128,7 +128,7 @@ static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Hand ...@@ -128,7 +128,7 @@ static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Hand
// avoid storing the exception object, as we can't create a wrapper during context creation. // avoid storing the exception object, as we can't create a wrapper during context creation.
// FIXME: Can we even get here during initialization now that we bail out when GetEntered returns an empty handle? // FIXME: Can we even get here during initialization now that we bail out when GetEntered returns an empty handle?
LocalFrame* frame = enteredWindow->document()->frame(); LocalFrame* frame = enteredWindow->document()->frame();
if (frame && frame->script().existingWindowShell(scriptState->world())) { if (frame && frame->script().existingWindowProxy(scriptState->world())) {
V8ErrorHandler::storeExceptionOnErrorEventWrapper(event.get(), data, scriptState->context()->Global(), isolate); V8ErrorHandler::storeExceptionOnErrorEventWrapper(event.get(), data, scriptState->context()->Global(), isolate);
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
*/ */
#include "config.h" #include "config.h"
#include "bindings/core/v8/V8WindowShell.h" #include "bindings/core/v8/WindowProxy.h"
#include "bindings/core/v8/DOMWrapperWorld.h" #include "bindings/core/v8/DOMWrapperWorld.h"
#include "bindings/core/v8/ScriptController.h" #include "bindings/core/v8/ScriptController.h"
...@@ -74,19 +74,19 @@ static void checkDocumentWrapper(v8::Handle<v8::Object> wrapper, Document* docum ...@@ -74,19 +74,19 @@ static void checkDocumentWrapper(v8::Handle<v8::Object> wrapper, Document* docum
ASSERT(!document->isHTMLDocument() || (V8Document::toNative(v8::Handle<v8::Object>::Cast(wrapper->GetPrototype())) == document)); ASSERT(!document->isHTMLDocument() || (V8Document::toNative(v8::Handle<v8::Object>::Cast(wrapper->GetPrototype())) == document));
} }
PassOwnPtr<V8WindowShell> V8WindowShell::create(LocalFrame* frame, DOMWrapperWorld& world, v8::Isolate* isolate) PassOwnPtr<WindowProxy> WindowProxy::create(LocalFrame* frame, DOMWrapperWorld& world, v8::Isolate* isolate)
{ {
return adoptPtr(new V8WindowShell(frame, &world, isolate)); return adoptPtr(new WindowProxy(frame, &world, isolate));
} }
V8WindowShell::V8WindowShell(LocalFrame* frame, PassRefPtr<DOMWrapperWorld> world, v8::Isolate* isolate) WindowProxy::WindowProxy(LocalFrame* frame, PassRefPtr<DOMWrapperWorld> world, v8::Isolate* isolate)
: m_frame(frame) : m_frame(frame)
, m_isolate(isolate) , m_isolate(isolate)
, m_world(world) , m_world(world)
{ {
} }
void V8WindowShell::disposeContext(GlobalDetachmentBehavior behavior) void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior)
{ {
if (!isContextInitialized()) if (!isContextInitialized())
return; return;
...@@ -106,7 +106,7 @@ void V8WindowShell::disposeContext(GlobalDetachmentBehavior behavior) ...@@ -106,7 +106,7 @@ void V8WindowShell::disposeContext(GlobalDetachmentBehavior behavior)
V8GCForContextDispose::instanceTemplate().notifyContextDisposed(m_frame->isMainFrame()); V8GCForContextDispose::instanceTemplate().notifyContextDisposed(m_frame->isMainFrame());
} }
void V8WindowShell::clearForClose() void WindowProxy::clearForClose()
{ {
if (!isContextInitialized()) if (!isContextInitialized())
return; return;
...@@ -115,7 +115,7 @@ void V8WindowShell::clearForClose() ...@@ -115,7 +115,7 @@ void V8WindowShell::clearForClose()
disposeContext(DoNotDetachGlobal); disposeContext(DoNotDetachGlobal);
} }
void V8WindowShell::clearForNavigation() void WindowProxy::clearForNavigation()
{ {
if (!isContextInitialized()) if (!isContextInitialized())
return; return;
...@@ -170,7 +170,7 @@ void V8WindowShell::clearForNavigation() ...@@ -170,7 +170,7 @@ void V8WindowShell::clearForNavigation()
// the frame. However, a new inner window is created for the new page. // the frame. However, a new inner window is created for the new page.
// If there are JS code holds a closure to the old inner window, // If there are JS code holds a closure to the old inner window,
// it won't be able to reach the outer window via its global object. // it won't be able to reach the outer window via its global object.
bool V8WindowShell::initializeIfNeeded() bool WindowProxy::initializeIfNeeded()
{ {
if (isContextInitialized()) if (isContextInitialized())
return true; return true;
...@@ -181,9 +181,9 @@ bool V8WindowShell::initializeIfNeeded() ...@@ -181,9 +181,9 @@ bool V8WindowShell::initializeIfNeeded()
return result; return result;
} }
bool V8WindowShell::initialize() bool WindowProxy::initialize()
{ {
TRACE_EVENT0("v8", "V8WindowShell::initialize"); TRACE_EVENT0("v8", "WindowProxy::initialize");
TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "InitializeWindow"); TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "InitializeWindow");
ScriptForbiddenScope::AllowUserAgentScript allowScript; ScriptForbiddenScope::AllowUserAgentScript allowScript;
...@@ -231,7 +231,7 @@ bool V8WindowShell::initialize() ...@@ -231,7 +231,7 @@ bool V8WindowShell::initialize()
return true; return true;
} }
void V8WindowShell::createContext() void WindowProxy::createContext()
{ {
// The documentLoader pointer could be 0 during frame shutdown. // The documentLoader pointer could be 0 during frame shutdown.
// FIXME: Can we remove this check? // FIXME: Can we remove this check?
...@@ -266,9 +266,9 @@ void V8WindowShell::createContext() ...@@ -266,9 +266,9 @@ void V8WindowShell::createContext()
m_scriptState = ScriptState::create(context, m_world); m_scriptState = ScriptState::create(context, m_world);
double contextCreationDurationInMilliseconds = (currentTime() - contextCreationStartInSeconds) * 1000; double contextCreationDurationInMilliseconds = (currentTime() - contextCreationStartInSeconds) * 1000;
const char* histogramName = "WebCore.V8WindowShell.createContext.MainWorld"; const char* histogramName = "WebCore.WindowProxy.createContext.MainWorld";
if (!m_world->isMainWorld()) if (!m_world->isMainWorld())
histogramName = "WebCore.V8WindowShell.createContext.IsolatedWorld"; histogramName = "WebCore.WindowProxy.createContext.IsolatedWorld";
blink::Platform::current()->histogramCustomCounts(histogramName, contextCreationDurationInMilliseconds, 0, 10000, 50); blink::Platform::current()->histogramCustomCounts(histogramName, contextCreationDurationInMilliseconds, 0, 10000, 50);
} }
...@@ -277,7 +277,7 @@ static v8::Handle<v8::Object> toInnerGlobalObject(v8::Handle<v8::Context> contex ...@@ -277,7 +277,7 @@ static v8::Handle<v8::Object> toInnerGlobalObject(v8::Handle<v8::Context> contex
return v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype()); return v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
} }
bool V8WindowShell::installDOMWindow() bool WindowProxy::installDOMWindow()
{ {
LocalDOMWindow* window = m_frame->domWindow(); LocalDOMWindow* window = m_frame->domWindow();
v8::Local<v8::Object> windowWrapper = V8ObjectConstructor::newInstance(m_isolate, m_scriptState->perContextData()->constructorForType(&V8Window::wrapperTypeInfo)); v8::Local<v8::Object> windowWrapper = V8ObjectConstructor::newInstance(m_isolate, m_scriptState->perContextData()->constructorForType(&V8Window::wrapperTypeInfo));
...@@ -314,13 +314,13 @@ bool V8WindowShell::installDOMWindow() ...@@ -314,13 +314,13 @@ bool V8WindowShell::installDOMWindow()
return true; return true;
} }
void V8WindowShell::updateDocumentWrapper(v8::Handle<v8::Object> wrapper) void WindowProxy::updateDocumentWrapper(v8::Handle<v8::Object> wrapper)
{ {
ASSERT(m_world->isMainWorld()); ASSERT(m_world->isMainWorld());
m_document.set(m_isolate, wrapper); m_document.set(m_isolate, wrapper);
} }
void V8WindowShell::updateDocumentProperty() void WindowProxy::updateDocumentProperty()
{ {
if (!m_world->isMainWorld()) if (!m_world->isMainWorld())
return; return;
...@@ -348,7 +348,7 @@ void V8WindowShell::updateDocumentProperty() ...@@ -348,7 +348,7 @@ void V8WindowShell::updateDocumentProperty()
V8HiddenValue::setHiddenValue(m_isolate, toInnerGlobalObject(context), V8HiddenValue::document(m_isolate), documentWrapper); V8HiddenValue::setHiddenValue(m_isolate, toInnerGlobalObject(context), V8HiddenValue::document(m_isolate), documentWrapper);
} }
void V8WindowShell::clearDocumentProperty() void WindowProxy::clearDocumentProperty()
{ {
ASSERT(isContextInitialized()); ASSERT(isContextInitialized());
if (!m_world->isMainWorld()) if (!m_world->isMainWorld())
...@@ -357,13 +357,13 @@ void V8WindowShell::clearDocumentProperty() ...@@ -357,13 +357,13 @@ void V8WindowShell::clearDocumentProperty()
m_scriptState->context()->Global()->ForceDelete(v8AtomicString(m_isolate, "document")); m_scriptState->context()->Global()->ForceDelete(v8AtomicString(m_isolate, "document"));
} }
void V8WindowShell::updateActivityLogger() void WindowProxy::updateActivityLogger()
{ {
m_scriptState->perContextData()->setActivityLogger(V8DOMActivityLogger::activityLogger( m_scriptState->perContextData()->setActivityLogger(V8DOMActivityLogger::activityLogger(
m_world->worldId(), m_frame->document() ? m_frame->document()->baseURI() : KURL())); m_world->worldId(), m_frame->document() ? m_frame->document()->baseURI() : KURL()));
} }
void V8WindowShell::setSecurityToken(SecurityOrigin* origin) void WindowProxy::setSecurityToken(SecurityOrigin* origin)
{ {
// If two tokens are equal, then the SecurityOrigins canAccess each other. // If two tokens are equal, then the SecurityOrigins canAccess each other.
// If two tokens are not equal, then we have to call canAccess. // If two tokens are not equal, then we have to call canAccess.
...@@ -400,7 +400,7 @@ void V8WindowShell::setSecurityToken(SecurityOrigin* origin) ...@@ -400,7 +400,7 @@ void V8WindowShell::setSecurityToken(SecurityOrigin* origin)
context->SetSecurityToken(v8AtomicString(m_isolate, utf8Token.data(), utf8Token.length())); context->SetSecurityToken(v8AtomicString(m_isolate, utf8Token.data(), utf8Token.length()));
} }
void V8WindowShell::updateDocument() void WindowProxy::updateDocument()
{ {
ASSERT(m_world->isMainWorld()); ASSERT(m_world->isMainWorld());
if (!isGlobalInitialized()) if (!isGlobalInitialized())
...@@ -450,7 +450,7 @@ static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf ...@@ -450,7 +450,7 @@ static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf
} }
} }
void V8WindowShell::namedItemAdded(HTMLDocument* document, const AtomicString& name) void WindowProxy::namedItemAdded(HTMLDocument* document, const AtomicString& name)
{ {
ASSERT(m_world->isMainWorld()); ASSERT(m_world->isMainWorld());
...@@ -464,7 +464,7 @@ void V8WindowShell::namedItemAdded(HTMLDocument* document, const AtomicString& n ...@@ -464,7 +464,7 @@ void V8WindowShell::namedItemAdded(HTMLDocument* document, const AtomicString& n
documentHandle->SetAccessor(v8String(m_isolate, name), getter); documentHandle->SetAccessor(v8String(m_isolate, name), getter);
} }
void V8WindowShell::namedItemRemoved(HTMLDocument* document, const AtomicString& name) void WindowProxy::namedItemRemoved(HTMLDocument* document, const AtomicString& name)
{ {
ASSERT(m_world->isMainWorld()); ASSERT(m_world->isMainWorld());
...@@ -481,7 +481,7 @@ void V8WindowShell::namedItemRemoved(HTMLDocument* document, const AtomicString& ...@@ -481,7 +481,7 @@ void V8WindowShell::namedItemRemoved(HTMLDocument* document, const AtomicString&
documentHandle->Delete(v8String(m_isolate, name)); documentHandle->Delete(v8String(m_isolate, name));
} }
void V8WindowShell::updateSecurityOrigin(SecurityOrigin* origin) void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
{ {
ASSERT(m_world->isMainWorld()); ASSERT(m_world->isMainWorld());
if (!isContextInitialized()) if (!isContextInitialized())
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef V8WindowShell_h #ifndef WindowProxy_h
#define V8WindowShell_h #define WindowProxy_h
#include "bindings/core/v8/DOMWrapperWorld.h" #include "bindings/core/v8/DOMWrapperWorld.h"
#include "bindings/core/v8/ScopedPersistent.h" #include "bindings/core/v8/ScopedPersistent.h"
...@@ -51,11 +51,11 @@ class LocalFrame; ...@@ -51,11 +51,11 @@ class LocalFrame;
class HTMLDocument; class HTMLDocument;
class SecurityOrigin; class SecurityOrigin;
// V8WindowShell represents all the per-global object state for a LocalFrame that // WindowProxy represents all the per-global object state for a LocalFrame that
// persist between navigations. // persist between navigations.
class V8WindowShell { class WindowProxy {
public: public:
static PassOwnPtr<V8WindowShell> create(LocalFrame*, DOMWrapperWorld&, v8::Isolate*); static PassOwnPtr<WindowProxy> create(LocalFrame*, DOMWrapperWorld&, v8::Isolate*);
v8::Local<v8::Context> context() const { return m_scriptState ? m_scriptState->context() : v8::Local<v8::Context>(); } v8::Local<v8::Context> context() const { return m_scriptState ? m_scriptState->context() : v8::Local<v8::Context>(); }
ScriptState* scriptState() const { return m_scriptState.get(); } ScriptState* scriptState() const { return m_scriptState.get(); }
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
DOMWrapperWorld& world() { return *m_world; } DOMWrapperWorld& world() { return *m_world; }
private: private:
V8WindowShell(LocalFrame*, PassRefPtr<DOMWrapperWorld>, v8::Isolate*); WindowProxy(LocalFrame*, PassRefPtr<DOMWrapperWorld>, v8::Isolate*);
bool initialize(); bool initialize();
enum GlobalDetachmentBehavior { enum GlobalDetachmentBehavior {
...@@ -106,7 +106,7 @@ private: ...@@ -106,7 +106,7 @@ private:
void createContext(); void createContext();
bool installDOMWindow(); bool installDOMWindow();
static V8WindowShell* enteredIsolatedWorldContext(); static WindowProxy* enteredIsolatedWorldContext();
LocalFrame* m_frame; LocalFrame* m_frame;
v8::Isolate* m_isolate; v8::Isolate* m_isolate;
...@@ -118,4 +118,4 @@ private: ...@@ -118,4 +118,4 @@ private:
} // namespace blink } // namespace blink
#endif // V8WindowShell_h #endif // WindowProxy_h
...@@ -150,10 +150,10 @@ ...@@ -150,10 +150,10 @@
'V8ThrowException.h', 'V8ThrowException.h',
'V8ValueCache.cpp', 'V8ValueCache.cpp',
'V8ValueCache.h', 'V8ValueCache.h',
'V8WindowShell.cpp',
'V8WindowShell.h',
'V8WorkerGlobalScopeEventListener.cpp', 'V8WorkerGlobalScopeEventListener.cpp',
'V8WorkerGlobalScopeEventListener.h', 'V8WorkerGlobalScopeEventListener.h',
'WindowProxy.cpp',
'WindowProxy.h',
'WorkerScriptController.cpp', 'WorkerScriptController.cpp',
'WorkerScriptController.h', 'WorkerScriptController.h',
'WorkerScriptDebugServer.cpp', 'WorkerScriptDebugServer.cpp',
......
...@@ -87,7 +87,7 @@ def interface_context(interface): ...@@ -87,7 +87,7 @@ def interface_context(interface):
is_document = inherits_interface(interface.name, 'Document') is_document = inherits_interface(interface.name, 'Document')
if is_document: if is_document:
includes.update(['bindings/core/v8/ScriptController.h', includes.update(['bindings/core/v8/ScriptController.h',
'bindings/core/v8/V8WindowShell.h', 'bindings/core/v8/WindowProxy.h',
'core/frame/LocalFrame.h']) 'core/frame/LocalFrame.h'])
# [ActiveDOMObject] # [ActiveDOMObject]
......
...@@ -1275,7 +1275,7 @@ v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creation ...@@ -1275,7 +1275,7 @@ v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creation
DOMWrapperWorld& world = DOMWrapperWorld::current(isolate); DOMWrapperWorld& world = DOMWrapperWorld::current(isolate);
if (world.isMainWorld()) { if (world.isMainWorld()) {
if (LocalFrame* frame = impl->frame()) if (LocalFrame* frame = impl->frame())
frame->script().windowShell(world)->updateDocumentWrapper(wrapper); frame->script().windowProxy(world)->updateDocumentWrapper(wrapper);
} }
{% endif %} {% endif %}
return wrapper; return wrapper;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "bindings/core/v8/V8DOMConfiguration.h" #include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8HiddenValue.h" #include "bindings/core/v8/V8HiddenValue.h"
#include "bindings/core/v8/V8ObjectConstructor.h" #include "bindings/core/v8/V8ObjectConstructor.h"
#include "bindings/core/v8/V8WindowShell.h" #include "bindings/core/v8/WindowProxy.h"
#include "core/dom/ContextFeatures.h" #include "core/dom/ContextFeatures.h"
#include "core/dom/Document.h" #include "core/dom/Document.h"
#include "core/frame/LocalFrame.h" #include "core/frame/LocalFrame.h"
...@@ -98,7 +98,7 @@ v8::Handle<v8::Object> wrap(TestInterfaceDocument* impl, v8::Handle<v8::Object> ...@@ -98,7 +98,7 @@ v8::Handle<v8::Object> wrap(TestInterfaceDocument* impl, v8::Handle<v8::Object>
DOMWrapperWorld& world = DOMWrapperWorld::current(isolate); DOMWrapperWorld& world = DOMWrapperWorld::current(isolate);
if (world.isMainWorld()) { if (world.isMainWorld()) {
if (LocalFrame* frame = impl->frame()) if (LocalFrame* frame = impl->frame())
frame->script().windowShell(world)->updateDocumentWrapper(wrapper); frame->script().windowProxy(world)->updateDocumentWrapper(wrapper);
} }
return wrapper; return wrapper;
} }
......
...@@ -235,7 +235,7 @@ void LocalFrame::setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow> domWindow) ...@@ -235,7 +235,7 @@ void LocalFrame::setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow> domWindow)
{ {
InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get()); InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get());
if (domWindow) if (domWindow)
script().clearWindowShell(); script().clearWindowProxy();
Frame::setDOMWindow(domWindow); Frame::setDOMWindow(domWindow);
} }
......
...@@ -1151,7 +1151,7 @@ void FrameLoader::detachClient() ...@@ -1151,7 +1151,7 @@ void FrameLoader::detachClient()
m_progressTracker.clear(); m_progressTracker.clear();
setOpener(0); setOpener(0);
// Notify ScriptController that the frame is closing, since its cleanup ends up calling // Notify ScriptController that the frame is closing, since its cleanup ends up calling
// back to FrameLoaderClient via V8WindowShell. // back to FrameLoaderClient via WindowProxy.
m_frame->script().clearForClose(); m_frame->script().clearForClose();
// client() should never be null because that means we somehow re-entered // client() should never be null because that means we somehow re-entered
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment