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

Unified Diff: Source/bindings/v8/ScriptEventListener.cpp

Issue 33523002: Have Frame::script() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 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
« no previous file with comments | « Source/bindings/v8/ScriptController.cpp ('k') | Source/bindings/v8/ScriptPreprocessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptEventListener.cpp
diff --git a/Source/bindings/v8/ScriptEventListener.cpp b/Source/bindings/v8/ScriptEventListener.cpp
index b99b22dbcf615bca103f2d2c7f29e05df31a260f..3283ed33edc520b1654e46df112c7680f340001f 100644
--- a/Source/bindings/v8/ScriptEventListener.cpp
+++ b/Source/bindings/v8/ScriptEventListener.cpp
@@ -63,10 +63,10 @@ PassRefPtr<V8LazyEventListener> createAttributeEventListener(Node* node, const Q
v8::Isolate* isolate;
if (Frame* frame = node->document().frame()) {
isolate = toIsolate(frame);
- ScriptController* scriptController = frame->script();
- if (!scriptController->canExecuteScripts(AboutToExecuteScript))
+ ScriptController& scriptController = frame->script();
+ if (!scriptController.canExecuteScripts(AboutToExecuteScript))
return 0;
- position = scriptController->eventHandlerPosition();
+ position = scriptController.eventHandlerPosition();
sourceURL = node->document().url().string();
} else {
isolate = v8::Isolate::GetCurrent();
@@ -83,11 +83,11 @@ PassRefPtr<V8LazyEventListener> createAttributeEventListener(Frame* frame, const
if (value.isNull())
return 0;
- ScriptController* scriptController = frame->script();
- if (!scriptController->canExecuteScripts(AboutToExecuteScript))
+ ScriptController& scriptController = frame->script();
+ if (!scriptController.canExecuteScripts(AboutToExecuteScript))
return 0;
- TextPosition position = scriptController->eventHandlerPosition();
+ TextPosition position = scriptController.eventHandlerPosition();
String sourceURL = frame->document()->url().string();
return V8LazyEventListener::create(name.localName().string(), eventParameterName(frame->document()->isSVGDocument()), value, sourceURL, position, 0, toIsolate(frame));
@@ -131,7 +131,7 @@ ScriptState* eventListenerHandlerScriptState(Frame* frame, EventListener* listen
return 0;
V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(listener);
v8::HandleScope scope(toIsolate(frame));
- v8::Handle<v8::Context> v8Context = frame->script()->windowShell(v8Listener->world())->context();
+ v8::Handle<v8::Context> v8Context = frame->script().windowShell(v8Listener->world())->context();
return ScriptState::forContext(v8Context);
}
« no previous file with comments | « Source/bindings/v8/ScriptController.cpp ('k') | Source/bindings/v8/ScriptPreprocessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698