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

Side by Side Diff: Source/web/WebLocalFrameImpl.cpp

Issue 1061503005: bindings: Use Maybe version of Call() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 889
890 void WebLocalFrameImpl::requestExecuteScriptInIsolatedWorld(int worldID, const W ebScriptSource* sourcesIn, unsigned numSources, int extensionGroup, bool userGes ture, WebScriptExecutionCallback* callback) 890 void WebLocalFrameImpl::requestExecuteScriptInIsolatedWorld(int worldID, const W ebScriptSource* sourcesIn, unsigned numSources, int extensionGroup, bool userGes ture, WebScriptExecutionCallback* callback)
891 { 891 {
892 ASSERT(frame()); 892 ASSERT(frame());
893 RELEASE_ASSERT(worldID > 0); 893 RELEASE_ASSERT(worldID > 0);
894 RELEASE_ASSERT(worldID < EmbedderWorldIdLimit); 894 RELEASE_ASSERT(worldID < EmbedderWorldIdLimit);
895 895
896 SuspendableScriptExecutor::createAndRun(frame(), worldID, createSourcesVecto r(sourcesIn, numSources), extensionGroup, userGesture, callback); 896 SuspendableScriptExecutor::createAndRun(frame(), worldID, createSourcesVecto r(sourcesIn, numSources), extensionGroup, userGesture, callback);
897 } 897 }
898 898
899 // TODO(bashi): Consider returning MaybeLocal.
899 #ifndef WEB_FRAME_USES_V8_LOCAL 900 #ifndef WEB_FRAME_USES_V8_LOCAL
900 v8::Local<v8::Value> WebLocalFrameImpl::callFunctionEvenIfScriptDisabled(v8::Loc al<v8::Function> function, v8::Local<v8::Value> receiver, int argc, v8::Handle<v 8::Value> argv[]) 901 v8::Local<v8::Value> WebLocalFrameImpl::callFunctionEvenIfScriptDisabled(v8::Loc al<v8::Function> function, v8::Local<v8::Value> receiver, int argc, v8::Handle<v 8::Value> argv[])
901 #else 902 #else
902 v8::Local<v8::Value> WebLocalFrameImpl::callFunctionEvenIfScriptDisabled(v8::Loc al<v8::Function> function, v8::Local<v8::Value> receiver, int argc, v8::Local<v8 ::Value> argv[]) 903 v8::Local<v8::Value> WebLocalFrameImpl::callFunctionEvenIfScriptDisabled(v8::Loc al<v8::Function> function, v8::Local<v8::Value> receiver, int argc, v8::Local<v8 ::Value> argv[])
903 #endif 904 #endif
904 { 905 {
905 ASSERT(frame()); 906 ASSERT(frame());
906 // TODO(bashi): Change the signature of callFunctionEvenIfScriptDisabled() 907 v8::Local<v8::Value> result;
907 // so that it takes v8::Local instead of v8::Handle. 908 if (frame()->script().callFunction(function, receiver, argc, static_cast<v8: :Local<v8::Value>*>(argv)).ToLocal(&result))
haraken 2015/04/18 23:10:47 Ditto.
haraken 2015/04/18 23:10:47 Nit: I'd prefer using the following programming pa
bashi 2015/04/21 00:15:40 Done.
bashi 2015/04/21 00:15:40 Sorry, I couldn't find what you want to say here.
haraken 2015/04/21 04:38:54 Ignore the comment :)
908 return frame()->script().callFunction(function, receiver, argc, static_cast< v8::Local<v8::Value>*>(argv)); 909 return result;
910 return v8::Local<v8::Value>();
909 } 911 }
910 912
911 v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const 913 v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const
912 { 914 {
913 return toV8Context(frame(), DOMWrapperWorld::mainWorld()); 915 return toV8Context(frame(), DOMWrapperWorld::mainWorld());
914 } 916 }
915 917
916 void WebLocalFrameImpl::reload(bool ignoreCache) 918 void WebLocalFrameImpl::reload(bool ignoreCache)
917 { 919 {
918 ASSERT(frame()); 920 ASSERT(frame());
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 { 2116 {
2115 m_frameWidget = frameWidget; 2117 m_frameWidget = frameWidget;
2116 } 2118 }
2117 2119
2118 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const 2120 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const
2119 { 2121 {
2120 return m_frameWidget; 2122 return m_frameWidget;
2121 } 2123 }
2122 2124
2123 } // namespace blink 2125 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698