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

Unified Diff: chrome/browser/extensions/activity_log/activity_log.h

Issue 15686007: Remove Activity Log usage of Extension objects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made TODO wording more clear Created 7 years, 7 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
Index: chrome/browser/extensions/activity_log/activity_log.h
diff --git a/chrome/browser/extensions/activity_log/activity_log.h b/chrome/browser/extensions/activity_log/activity_log.h
index 130f75775bd07e5169b1869790f56ea03c79381f..06c1f05a99205001dfa3953d928d3c93d6acc2d8 100644
--- a/chrome/browser/extensions/activity_log/activity_log.h
+++ b/chrome/browser/extensions/activity_log/activity_log.h
@@ -67,17 +67,15 @@ class ActivityLog : public BrowserContextKeyedService,
static void RecomputeLoggingIsEnabled();
// Add/remove observer.
- void AddObserver(const Extension* extension, Observer* observer);
+ void AddObserver(const Extension* extension,
Matt Perry 2013/05/29 18:01:17 no need to wrap here. Ditto for RemoveObserver.
felt 2013/05/30 07:21:02 Now that the other CL landed I can completely dele
+ Observer* observer);
void RemoveObserver(const Extension* extension,
Observer* observer);
- // Check for the existence observer list by extension_id.
- bool HasObservers(const Extension* extension) const;
-
// Log a successful API call made by an extension.
// This will create an APIAction for storage in the database.
// (Note: implemented as a wrapper for LogAPIActionInternal.)
- void LogAPIAction(const Extension* extension,
+ void LogAPIAction(const std::string& extension_id,
const std::string& name, // e.g., tabs.get
ListValue* args, // the argument values e.g. 46
const std::string& extra); // any extra logging info
@@ -85,14 +83,14 @@ class ActivityLog : public BrowserContextKeyedService,
// Log an event notification delivered to an extension.
// This will create an APIAction for storage in the database.
// (Note: implemented as a wrapper for LogAPIActionInternal.)
- void LogEventAction(const Extension* extension,
+ void LogEventAction(const std::string& extension_id,
const std::string& name, // e.g., tabs.onUpdate
ListValue* args, // arguments to the callback
const std::string& extra); // any extra logging info
// Log a blocked API call made by an extension.
// This will create a BlockedAction for storage in the database.
- void LogBlockedAction(const Extension* extension,
+ void LogBlockedAction(const std::string& extension_id,
const std::string& blocked_call, // e.g., tabs.get
ListValue* args, // argument values
const BlockedAction::Reason reason, // why it's blocked
@@ -102,7 +100,7 @@ class ActivityLog : public BrowserContextKeyedService,
// This will create a DOMAction for storage in the database.
// The technical message might be the list of content scripts that have been
// injected, or the DOM API call; it's what's shown under "More".
- void LogDOMAction(const Extension* extension,
+ void LogDOMAction(const std::string& extension_id,
const GURL& url, // target URL
const string16& url_title, // title of the URL
const std::string& api_call, // api call
@@ -111,7 +109,7 @@ class ActivityLog : public BrowserContextKeyedService,
// Log a use of the WebRequest API to redirect, cancel, or modify page
// headers.
- void LogWebRequestAction(const Extension* extension,
+ void LogWebRequestAction(const std::string& extension_id,
const GURL& url,
const std::string& api_call,
scoped_ptr<base::DictionaryValue> details,
@@ -143,7 +141,7 @@ class ActivityLog : public BrowserContextKeyedService,
// We log callbacks and API calls very similarly, so we handle them the same
// way internally.
void LogAPIActionInternal(
- const Extension* extension,
+ const std::string& extension_id,
const std::string& api_call,
ListValue* args,
const std::string& extra,
@@ -151,7 +149,7 @@ class ActivityLog : public BrowserContextKeyedService,
// We log content script injection and DOM API calls using the same underlying
// mechanism, so they have the same internal logging structure.
- void LogDOMActionInternal(const Extension* extension,
+ void LogDOMActionInternal(const std::string& extension_id,
const GURL& url,
const string16& url_title,
const std::string& api_call,
@@ -197,10 +195,6 @@ class ActivityLog : public BrowserContextKeyedService,
}
typedef ObserverListThreadSafe<Observer> ObserverList;
- typedef std::map<const Extension*, scoped_refptr<ObserverList> >
- ObserverMap;
- // A map of extensions to activity observers for that extension.
- ObserverMap observers_;
// The database wrapper that does the actual database I/O.
// We initialize this on the same thread as the ActivityLog, but then

Powered by Google App Engine
This is Rietveld 408576698