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

Unified Diff: extensions/renderer/api_binding.cc

Issue 2575173002: [Extensions Bindings] Add a bridge to use current custom bindings (Closed)
Patch Set: . Created 4 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
« no previous file with comments | « extensions/renderer/api_binding.h ('k') | extensions/renderer/api_binding_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/api_binding.cc
diff --git a/extensions/renderer/api_binding.cc b/extensions/renderer/api_binding.cc
index 35da2836a5b7e022ac710582c4d48da10036e099..bff8eba8c2fa6790dba94cd8400612817fd3d195 100644
--- a/extensions/renderer/api_binding.cc
+++ b/extensions/renderer/api_binding.cc
@@ -167,12 +167,16 @@ v8::Local<v8::Object> APIBinding::CreateInstance(
DCHECK(success.FromJust());
}
- if (binding_hooks_)
- binding_hooks_->InitializeInContext(context, api_name_);
+ binding_hooks_->InitializeInContext(context, api_name_);
return object;
}
+v8::Local<v8::Object> APIBinding::GetJSHookInterface(
+ v8::Local<v8::Context> context) {
+ return binding_hooks_->GetJSHookInterface(api_name_, context);
+}
+
void APIBinding::HandleCall(const std::string& name,
const APISignature* signature,
gin::Arguments* arguments) {
@@ -185,8 +189,7 @@ void APIBinding::HandleCall(const std::string& name,
v8::Local<v8::Context> context = isolate->GetCurrentContext();
// Check for a custom hook to handle the method.
- if (binding_hooks_ &&
- binding_hooks_->HandleRequest(api_name_, name, context,
+ if (binding_hooks_->HandleRequest(api_name_, name, context,
signature, arguments)) {
return; // Handled by a custom hook.
}
« no previous file with comments | « extensions/renderer/api_binding.h ('k') | extensions/renderer/api_binding_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698