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

Unified Diff: Source/web/WebFrameImpl.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/web/WebDevToolsFrontendImpl.cpp ('k') | Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebFrameImpl.cpp
diff --git a/Source/web/WebFrameImpl.cpp b/Source/web/WebFrameImpl.cpp
index f19c80e9365778e5d3207f124906899066edb757..6b93c17340ee82279c5db3b8031ff5204ce773e3 100644
--- a/Source/web/WebFrameImpl.cpp
+++ b/Source/web/WebFrameImpl.cpp
@@ -726,7 +726,7 @@ NPObject* WebFrameImpl::windowObject() const
{
if (!frame())
return 0;
- return frame()->script()->windowScriptNPObject();
+ return frame()->script().windowScriptNPObject();
}
void WebFrameImpl::bindToWindowObject(const WebString& name, NPObject* object)
@@ -736,16 +736,16 @@ void WebFrameImpl::bindToWindowObject(const WebString& name, NPObject* object)
void WebFrameImpl::bindToWindowObject(const WebString& name, NPObject* object, void*)
{
- if (!frame() || !frame()->script()->canExecuteScripts(NotAboutToExecuteScript))
+ if (!frame() || !frame()->script().canExecuteScripts(NotAboutToExecuteScript))
return;
- frame()->script()->bindToWindowObject(frame(), String(name), object);
+ frame()->script().bindToWindowObject(frame(), String(name), object);
}
void WebFrameImpl::executeScript(const WebScriptSource& source)
{
ASSERT(frame());
TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), OrdinalNumber::first());
- frame()->script()->executeScriptInMainWorld(ScriptSourceCode(source.code, source.url, position));
+ frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, source.url, position));
}
void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSource* sourcesIn, unsigned numSources, int extensionGroup)
@@ -760,7 +760,7 @@ void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSour
sources.append(ScriptSourceCode(sourcesIn[i].code, sourcesIn[i].url, position));
}
- frame()->script()->executeScriptInIsolatedWorld(worldID, sources, extensionGroup, 0);
+ frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensionGroup, 0);
}
void WebFrameImpl::setIsolatedWorldSecurityOrigin(int worldID, const WebSecurityOrigin& securityOrigin)
@@ -827,7 +827,7 @@ v8::Handle<v8::Value> WebFrameImpl::executeScriptAndReturnValue(const WebScriptS
UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), OrdinalNumber::first());
- return frame()->script()->executeScriptInMainWorldAndReturnValue(ScriptSourceCode(source.code, source.url, position)).v8Value();
+ return frame()->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(source.code, source.url, position)).v8Value();
}
void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSource* sourcesIn, unsigned numSources, int extensionGroup, WebVector<v8::Local<v8::Value> >* results)
@@ -845,19 +845,20 @@ void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSour
if (results) {
Vector<ScriptValue> scriptResults;
- frame()->script()->executeScriptInIsolatedWorld(worldID, sources, extensionGroup, &scriptResults);
+ frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensionGroup, &scriptResults);
WebVector<v8::Local<v8::Value> > v8Results(scriptResults.size());
for (unsigned i = 0; i < scriptResults.size(); i++)
v8Results[i] = v8::Local<v8::Value>::New(toIsolate(frame()), scriptResults[i].v8Value());
results->swap(v8Results);
- } else
- frame()->script()->executeScriptInIsolatedWorld(worldID, sources, extensionGroup, 0);
+ } else {
+ frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensionGroup, 0);
+ }
}
v8::Handle<v8::Value> WebFrameImpl::callFunctionEvenIfScriptDisabled(v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> argv[])
{
ASSERT(frame());
- return frame()->script()->callFunction(function, receiver, argc, argv);
+ return frame()->script().callFunction(function, receiver, argc, argv);
}
v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const
@@ -2496,7 +2497,7 @@ void WebFrameImpl::loadJavaScriptURL(const KURL& url)
String script = decodeURLEscapeSequences(url.string().substring(strlen("javascript:")));
UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
- ScriptValue result = frame()->script()->executeScriptInMainWorldAndReturnValue(ScriptSourceCode(script));
+ ScriptValue result = frame()->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(script));
String scriptResult;
if (!result.getString(scriptResult))
« no previous file with comments | « Source/web/WebDevToolsFrontendImpl.cpp ('k') | Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698