Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 2702273004: bindings: Simplifies WindowProxyManager and its relation to Frame. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
index eb6c5d4f38a78873680b374a1ad6a6bc55f1b461..88dd7713fa96e30da6e480eefe14581fd3f0fe9f 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
@@ -77,9 +77,6 @@
namespace blink {
-ScriptController::ScriptController(LocalFrame* frame)
- : m_windowProxyManager(LocalWindowProxyManager::create(*frame)) {}
-
DEFINE_TRACE(ScriptController) {
visitor->trace(m_windowProxyManager);
}
@@ -160,12 +157,6 @@ v8::Local<v8::Value> ScriptController::executeScriptAndReturnValue(
return result;
}
-LocalWindowProxy* ScriptController::windowProxy(DOMWrapperWorld& world) {
- LocalWindowProxy* windowProxy = m_windowProxyManager->windowProxy(world);
- windowProxy->initializeIfNeeded();
- return windowProxy;
-}
-
bool ScriptController::shouldBypassMainWorldCSP() {
v8::HandleScope handleScope(isolate());
v8::Local<v8::Context> context = isolate()->GetCurrentContext();
@@ -187,7 +178,8 @@ TextPosition ScriptController::eventHandlerPosition() const {
void ScriptController::enableEval() {
v8::HandleScope handleScope(isolate());
v8::Local<v8::Context> v8Context =
- m_windowProxyManager->mainWorldProxy()->contextIfInitialized();
+ m_windowProxyManager->mainWorldProxyMaybeUninitialized()
+ ->contextIfInitialized();
if (v8Context.IsEmpty())
return;
v8Context->AllowCodeGenerationFromStrings(true);
@@ -196,7 +188,8 @@ void ScriptController::enableEval() {
void ScriptController::disableEval(const String& errorMessage) {
v8::HandleScope handleScope(isolate());
v8::Local<v8::Context> v8Context =
- m_windowProxyManager->mainWorldProxy()->contextIfInitialized();
+ m_windowProxyManager->mainWorldProxyMaybeUninitialized()
+ ->contextIfInitialized();
if (v8Context.IsEmpty())
return;
v8Context->AllowCodeGenerationFromStrings(false);
@@ -244,7 +237,7 @@ void ScriptController::clearWindowProxy() {
}
void ScriptController::updateDocument() {
- m_windowProxyManager->mainWorldProxy()->updateDocument();
+ m_windowProxyManager->mainWorldProxyMaybeUninitialized()->updateDocument();
}
bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url,

Powered by Google App Engine
This is Rietveld 408576698