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

Unified Diff: chrome/renderer/extensions/app_bindings.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/app_bindings.cc
diff --git a/chrome/renderer/extensions/app_bindings.cc b/chrome/renderer/extensions/app_bindings.cc
index b1e8a26c73f1a187410ed1748441b880051a5ece..e587bd08f0355900ec34f1dfdc2cd34e3fcaaecf 100644
--- a/chrome/renderer/extensions/app_bindings.cc
+++ b/chrome/renderer/extensions/app_bindings.cc
@@ -46,7 +46,7 @@ bool CheckAccessToAppDetails(WebFrame* frame, v8::Isolate* isolate) {
if (!IsCheckoutURL(frame->document().url().spec())) {
std::string error("Access denied for URL: ");
error += frame->document().url().spec();
- v8::ThrowException(v8::String::NewFromUtf8(isolate, error.c_str()));
+ isolate->ThrowException(v8::String::NewFromUtf8(isolate, error.c_str()));
return false;
}
@@ -95,13 +95,13 @@ void AppBindings::GetDetailsForFrame(
return;
if (args.Length() < 0) {
- v8::ThrowException(
+ context()->isolate()->ThrowException(
v8::String::NewFromUtf8(context()->isolate(), "Not enough arguments."));
return;
}
if (!args[0]->IsObject()) {
- v8::ThrowException(v8::String::NewFromUtf8(
+ context()->isolate()->ThrowException(v8::String::NewFromUtf8(
context()->isolate(), "Argument 0 must be an object."));
return;
}
@@ -112,7 +112,7 @@ void AppBindings::GetDetailsForFrame(
WebFrame* target_frame = WebFrame::frameForContext(context);
if (!target_frame) {
- console::Error(v8::Context::GetCalling(),
+ console::Error(args.GetIsolate()->GetCallingContext(),
"Could not find frame for specified object.");
return;
}
@@ -122,15 +122,16 @@ void AppBindings::GetDetailsForFrame(
v8::Handle<v8::Value> AppBindings::GetDetailsForFrameImpl(
WebFrame* frame) {
+ v8::Isolate* isolate = frame->mainWorldScriptContext()->GetIsolate();
if (frame->document().securityOrigin().isUnique())
- return v8::Null();
+ return v8::Null(isolate);
const Extension* extension =
dispatcher_->extensions()->GetExtensionOrAppByURL(
frame->document().url());
if (!extension)
- return v8::Null();
+ return v8::Null(isolate);
scoped_ptr<base::DictionaryValue> manifest_copy(
extension->manifest()->value()->DeepCopy());
@@ -146,8 +147,8 @@ void AppBindings::GetInstallState(
int callback_id = 0;
if (args.Length() == 1) {
if (!args[0]->IsInt32()) {
- v8::ThrowException(v8::String::NewFromUtf8(context()->isolate(),
- kInvalidCallbackIdError));
+ context()->isolate()->ThrowException(v8::String::NewFromUtf8(
+ context()->isolate(), kInvalidCallbackIdError));
return;
}
callback_id = args[0]->Int32Value();
« no previous file with comments | « chrome/renderer/extensions/api_activity_logger.cc ('k') | chrome/renderer/extensions/binding_generating_native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698