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

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

Issue 2962093002: [Extensions Bindings] Add activity logging of custom handling (Closed)
Patch Set: nit Created 3 years, 5 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/activity_log_private/PRESUBMIT.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/app_hooks_delegate.cc
diff --git a/chrome/renderer/extensions/app_hooks_delegate.cc b/chrome/renderer/extensions/app_hooks_delegate.cc
index d66ccded1753a615cd03eb4e3afa8f2688b3c51c..4abb1475054ed18f5bf1777cfab1018dba2b5197 100644
--- a/chrome/renderer/extensions/app_hooks_delegate.cc
+++ b/chrome/renderer/extensions/app_hooks_delegate.cc
@@ -4,6 +4,7 @@
#include "chrome/renderer/extensions/app_hooks_delegate.h"
+#include "extensions/renderer/api_activity_logger.h"
#include "extensions/renderer/bindings/api_request_handler.h"
#include "extensions/renderer/bindings/api_signature.h"
#include "extensions/renderer/script_context_set.h"
@@ -17,11 +18,15 @@ void IsInstalledGetterCallback(
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::HandleScope handle_scope(info.GetIsolate());
+ v8::Local<v8::Context> context = info.Holder()->CreationContext();
ScriptContext* script_context =
- ScriptContextSet::GetContextByV8Context(info.Holder()->CreationContext());
+ ScriptContextSet::GetContextByV8Context(context);
DCHECK(script_context);
auto* core =
static_cast<AppBindingsCore*>(info.Data().As<v8::External>()->Value());
+ // Since this is more-or-less an API, log it as an API call.
+ APIActivityLogger::LogAPICall(context, "app.getIsInstalled",
+ std::vector<v8::Local<v8::Value>>());
info.GetReturnValue().Set(core->GetIsInstalled(script_context));
}
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/activity_log_private/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698