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

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

Issue 18769009: [Activity Log] fix logging of blocked API calls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 7 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 | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/renderer/resources/extensions/binding.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/runtime_custom_bindings.cc
diff --git a/chrome/renderer/extensions/runtime_custom_bindings.cc b/chrome/renderer/extensions/runtime_custom_bindings.cc
index 8cdc10383562f1b35dce9036bdbc2eebfe2f2bbf..dc43a8ac07a16525c1acbc80962e34faeeb4e009 100644
--- a/chrome/renderer/extensions/runtime_custom_bindings.cc
+++ b/chrome/renderer/extensions/runtime_custom_bindings.cc
@@ -11,6 +11,7 @@
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/features/base_feature_provider.h"
#include "chrome/common/extensions/manifest.h"
+#include "chrome/renderer/extensions/api_activity_logger.h"
#include "chrome/renderer/extensions/chrome_v8_context.h"
#include "chrome/renderer/extensions/dispatcher.h"
#include "content/public/renderer/render_view.h"
@@ -65,11 +66,16 @@ void RuntimeCustomBindings::OpenChannelToExtension(
void RuntimeCustomBindings::OpenChannelToNativeApp(
const v8::FunctionCallbackInfo<v8::Value>& args) {
// Verify that the extension has permission to use native messaging.
- if (!BaseFeatureProvider::GetByName("permission")->GetFeature(
- "nativeMessaging")->IsAvailableToContext(
- GetExtensionForRenderView(),
- context()->context_type(),
- context()->GetURL()).is_available()) {
+ Feature::Availability availability =
+ BaseFeatureProvider::GetByName("permission")->
+ GetFeature("nativeMessaging")->IsAvailableToContext(
+ GetExtensionForRenderView(),
+ context()->context_type(),
+ context()->GetURL());
+ if (!availability.is_available()) {
+ APIActivityLogger::LogBlockedCall(context()->extension()->id(),
+ "nativeMessaging",
+ availability.result());
return;
}
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/renderer/resources/extensions/binding.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698