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

Unified Diff: chrome/renderer/extensions/chrome_v8_context.cc

Issue 98543004: Remove usage of deprecated V8 APIs from c/r/extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years 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: chrome/renderer/extensions/chrome_v8_context.cc
diff --git a/chrome/renderer/extensions/chrome_v8_context.cc b/chrome/renderer/extensions/chrome_v8_context.cc
index 512da76a94a122eca7f4bad5a52615c2678a7173..471176d689c85398e6f9e9c16b7e81630cd3fbeb 100644
--- a/chrome/renderer/extensions/chrome_v8_context.cc
+++ b/chrome/renderer/extensions/chrome_v8_context.cc
@@ -77,21 +77,21 @@ v8::Local<v8::Value> ChromeV8Context::CallFunction(
v8::Handle<v8::Function> function,
int argc,
v8::Handle<v8::Value> argv[]) const {
- v8::HandleScope handle_scope(isolate());
+ v8::EscapableHandleScope handle_scope(isolate());
v8::Context::Scope scope(v8_context());
blink::WebScopedMicrotaskSuppression suppression;
- if (!is_valid())
- return handle_scope.Close(v8::Undefined());
+ if (!is_valid()) {
+ return handle_scope.Escape(
+ v8::Local<v8::Primitive>(v8::Undefined(isolate())));
+ }
v8::Handle<v8::Object> global = v8_context()->Global();
if (!web_frame_)
- return handle_scope.Close(function->Call(global, argc, argv));
- return handle_scope.Close(
- web_frame_->callFunctionEvenIfScriptDisabled(function,
- global,
- argc,
- argv));
+ return handle_scope.Escape(function->Call(global, argc, argv));
+ return handle_scope.Escape(
+ v8::Local<v8::Value>(web_frame_->callFunctionEvenIfScriptDisabled(
+ function, global, argc, argv)));
}
bool ChromeV8Context::IsAnyFeatureAvailableToContext(
@@ -154,7 +154,7 @@ void ChromeV8Context::OnResponseReceived(const std::string& name,
// string if a validation error has occured.
if (DCHECK_IS_ON()) {
if (!retval.IsEmpty() && !retval->IsUndefined()) {
- std::string error = *v8::String::AsciiValue(retval);
+ std::string error = *v8::String::Utf8Value(retval);
DCHECK(false) << error;
}
}
« no previous file with comments | « chrome/renderer/extensions/binding_generating_native_handler.cc ('k') | chrome/renderer/extensions/chrome_v8_context_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698