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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 518583003: Don't take a fake UGI every time we execute Javascript. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 28a872ef78202b0087fa0a49be6249372d093734..9bc6e576abd66415e3bdd6afac77843a8f3f6563 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1224,13 +1224,16 @@ void RenderFrameImpl::OnCSSInsertRequest(const std::string& css) {
void RenderFrameImpl::OnJavaScriptExecuteRequest(
const base::string16& jscript,
int id,
- bool notify_result) {
+ bool notify_result,
+ bool set_ugi_for_tests) {
Rick Byers 2014/08/29 13:38:38 I'm a little nervous that it would be too easy for
Zeeshan Qureshi 2014/08/29 16:16:37 This is the method that gets called when a Javascr
Rick Byers 2014/08/29 16:21:44 Ah, of course - sorry, that makes sense. I was th
TRACE_EVENT_INSTANT0("test_tracing", "OnJavaScriptExecuteRequest",
TRACE_EVENT_SCOPE_THREAD);
v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
- v8::Handle<v8::Value> result =
- frame_->executeScriptAndReturnValue(WebScriptSource(jscript));
+ v8::Handle<v8::Value> result = set_ugi_for_tests ?
+ frame_->executeScriptAndReturnValueForTests(WebScriptSource(jscript)) :
+ frame_->executeScriptAndReturnValue(WebScriptSource(jscript));
+
if (notify_result) {
base::ListValue list;
if (!result.IsEmpty()) {
@@ -1494,7 +1497,7 @@ void RenderFrameImpl::LoadURLExternally(blink::WebLocalFrame* frame,
}
void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) {
- OnJavaScriptExecuteRequest(javascript, 0, false);
+ OnJavaScriptExecuteRequest(javascript, 0, false, false);
}
ServiceRegistry* RenderFrameImpl::GetServiceRegistry() {
« content/public/browser/render_frame_host.h ('K') | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698