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

Unified Diff: chrome/browser/renderer_host/chrome_render_message_filter.cc

Issue 15686007: Remove Activity Log usage of Extension objects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added removed code back to see if that fixes persistent memory errors Created 7 years, 6 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/browser/extensions/extension_function_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_render_message_filter.cc
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc
index 29cdf3f166b39074ba1aca5520a7a672bf2d857e..0fcde9643bbc32403f18be5db28fa7f14a7890af 100644
--- a/chrome/browser/renderer_host/chrome_render_message_filter.cc
+++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc
@@ -64,7 +64,7 @@ enum ActivityLogCallType {
void AddAPIActionToExtensionActivityLog(
Profile* profile,
const ActivityLogCallType call_type,
- const extensions::Extension* extension,
+ const std::string& extension_id,
const std::string& api_call,
scoped_ptr<ListValue> args,
const std::string& extra) {
@@ -76,7 +76,7 @@ void AddAPIActionToExtensionActivityLog(
base::Bind(&AddAPIActionToExtensionActivityLog,
profile,
call_type,
- extension,
+ extension_id,
api_call,
base::Passed(&args),
extra));
@@ -85,30 +85,36 @@ void AddAPIActionToExtensionActivityLog(
extensions::ActivityLog::GetInstance(profile);
if (activity_log->IsLogEnabled()) {
if (call_type == ACTIVITYAPI)
- activity_log->LogAPIAction(extension, api_call, args.get(), extra);
+ activity_log->LogAPIAction(extension_id,
+ api_call,
+ args.get(),
+ extra);
else if (call_type == ACTIVITYEVENT)
- activity_log->LogEventAction(extension, api_call, args.get(), extra);
+ activity_log->LogEventAction(extension_id,
+ api_call,
+ args.get(),
+ extra);
}
}
}
void AddBlockedActionToExtensionActivityLog(
Profile* profile,
- const extensions::Extension* extension,
+ const std::string& extension_id,
const std::string& api_call) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(BrowserThread::UI,
FROM_HERE,
base::Bind(&AddBlockedActionToExtensionActivityLog,
profile,
- extension,
+ extension_id,
api_call));
} else {
extensions::ActivityLog* activity_log =
extensions::ActivityLog::GetInstance(profile);
if (activity_log->IsLogEnabled()) {
scoped_ptr<ListValue> empty_args(new ListValue());
- activity_log->LogBlockedAction(extension,
+ activity_log->LogBlockedAction(extension_id,
api_call,
empty_args.get(),
extensions::BlockedAction::ACCESS_DENIED,
@@ -119,7 +125,7 @@ void AddBlockedActionToExtensionActivityLog(
void AddDOMActionToExtensionActivityLog(
Profile* profile,
- const extensions::Extension* extension,
+ const std::string& extension_id,
const GURL& url,
const string16& url_title,
const std::string& api_call,
@@ -132,7 +138,7 @@ void AddDOMActionToExtensionActivityLog(
FROM_HERE,
base::Bind(&AddDOMActionToExtensionActivityLog,
profile,
- extension,
+ extension_id,
url,
url_title,
api_call,
@@ -143,7 +149,7 @@ void AddDOMActionToExtensionActivityLog(
extensions::ActivityLog::GetInstance(profile);
if (activity_log->IsLogEnabled())
activity_log->LogDOMAction(
- extension, url, url_title, api_call, args.get(),
+ extension_id, url, url_title, api_call, args.get(),
static_cast<extensions::DomActionType::Type>(call_type), "");
}
}
@@ -649,12 +655,10 @@ void ChromeRenderMessageFilter::OnExtensionResumeRequests(int route_id) {
void ChromeRenderMessageFilter::OnAddAPIActionToExtensionActivityLog(
const std::string& extension_id,
const ExtensionHostMsg_APIActionOrEvent_Params& params) {
- const extensions::Extension* extension =
- extension_info_map_->extensions().GetByID(extension_id);
scoped_ptr<ListValue> args(params.arguments.DeepCopy());
// The activity is recorded as an API action in the extension
// activity log.
- AddAPIActionToExtensionActivityLog(profile_, ACTIVITYAPI, extension,
+ AddAPIActionToExtensionActivityLog(profile_, ACTIVITYAPI, extension_id,
params.api_call, args.Pass(),
params.extra);
}
@@ -662,12 +666,10 @@ void ChromeRenderMessageFilter::OnAddAPIActionToExtensionActivityLog(
void ChromeRenderMessageFilter::OnAddDOMActionToExtensionActivityLog(
const std::string& extension_id,
const ExtensionHostMsg_DOMAction_Params& params) {
- const extensions::Extension* extension =
- extension_info_map_->extensions().GetByID(extension_id);
scoped_ptr<ListValue> args(params.arguments.DeepCopy());
// The activity is recorded as a DOM action on the extension
// activity log.
- AddDOMActionToExtensionActivityLog(profile_, extension,
+ AddDOMActionToExtensionActivityLog(profile_, extension_id,
params.url, params.url_title,
params.api_call, args.Pass(),
params.call_type);
@@ -676,12 +678,10 @@ void ChromeRenderMessageFilter::OnAddDOMActionToExtensionActivityLog(
void ChromeRenderMessageFilter::OnAddEventToExtensionActivityLog(
const std::string& extension_id,
const ExtensionHostMsg_APIActionOrEvent_Params& params) {
- const extensions::Extension* extension =
- extension_info_map_->extensions().GetByID(extension_id);
scoped_ptr<ListValue> args(params.arguments.DeepCopy());
// The activity is recorded as an event in the extension
// activity log.
- AddAPIActionToExtensionActivityLog(profile_, ACTIVITYEVENT, extension,
+ AddAPIActionToExtensionActivityLog(profile_, ACTIVITYEVENT, extension_id,
params.api_call, args.Pass(),
params.extra);
}
@@ -689,10 +689,8 @@ void ChromeRenderMessageFilter::OnAddEventToExtensionActivityLog(
void ChromeRenderMessageFilter::OnAddBlockedCallToExtensionActivityLog(
const std::string& extension_id,
const std::string& function_name) {
- const extensions::Extension* extension =
- extension_info_map_->extensions().GetByID(extension_id);
AddBlockedActionToExtensionActivityLog(profile_,
- extension,
+ extension_id,
function_name);
}
« no previous file with comments | « chrome/browser/extensions/extension_function_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698