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

Side by Side Diff: chrome/renderer/extensions/chrome_v8_context.cc

Issue 16975007: Run shim's watchForTag on document.DOMContentLoaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + add test code from @kalman's comment Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/extensions/chrome_v8_context.h" 5 #include "chrome/renderer/extensions/chrome_v8_context.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 GURL ChromeV8Context::GetURL() const { 70 GURL ChromeV8Context::GetURL() const {
71 return web_frame_ ? 71 return web_frame_ ?
72 UserScriptSlave::GetDataSourceURLForFrame(web_frame_) : GURL(); 72 UserScriptSlave::GetDataSourceURLForFrame(web_frame_) : GURL();
73 } 73 }
74 74
75 v8::Local<v8::Value> ChromeV8Context::CallFunction( 75 v8::Local<v8::Value> ChromeV8Context::CallFunction(
76 v8::Handle<v8::Function> function, 76 v8::Handle<v8::Function> function,
77 int argc, 77 int argc,
78 v8::Handle<v8::Value> argv[]) const { 78 v8::Handle<v8::Value> argv[]) const {
79 v8::HandleScope handle_scope; 79 v8::HandleScope handle_scope;
80 v8::Context::Scope scope(v8_context());
lazyboy 2013/06/18 23:49:16 @kalman, did you mean here? How can I (or do I nee
not at google - send to devlin 2013/06/18 23:51:14 Yep, thanks.
81
80 WebKit::WebScopedMicrotaskSuppression suppression; 82 WebKit::WebScopedMicrotaskSuppression suppression;
81 if (!is_valid()) 83 if (!is_valid())
82 return handle_scope.Close(v8::Undefined()); 84 return handle_scope.Close(v8::Undefined());
83 85
84 v8::Handle<v8::Object> global = v8_context()->Global(); 86 v8::Handle<v8::Object> global = v8_context()->Global();
85 if (!web_frame_) 87 if (!web_frame_)
86 return handle_scope.Close(function->Call(global, argc, argv)); 88 return handle_scope.Close(function->Call(global, argc, argv));
87 return handle_scope.Close( 89 return handle_scope.Close(
88 web_frame_->callFunctionEvenIfScriptDisabled(function, 90 web_frame_->callFunctionEvenIfScriptDisabled(function,
89 global, 91 global,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // string if a validation error has occured. 152 // string if a validation error has occured.
151 if (DCHECK_IS_ON()) { 153 if (DCHECK_IS_ON()) {
152 if (!retval.IsEmpty() && !retval->IsUndefined()) { 154 if (!retval.IsEmpty() && !retval->IsUndefined()) {
153 std::string error = *v8::String::AsciiValue(retval); 155 std::string error = *v8::String::AsciiValue(retval);
154 DCHECK(false) << error; 156 DCHECK(false) << error;
155 } 157 }
156 } 158 }
157 } 159 }
158 160
159 } // namespace extensions 161 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/app_window_custom_bindings.cc ('k') | chrome/renderer/extensions/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698