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

Unified Diff: chrome/browser/extensions/api/api_function.h

Issue 10777003: Refactor APIResourceController to ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge/antony/fix build. Created 8 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/browser/extensions/api/api_function.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/api_function.h
diff --git a/chrome/browser/extensions/api/api_function.h b/chrome/browser/extensions/api/api_function.h
index 2a91e304dc1339881ec363290725594f35f4954b..eda006c446cea2d1624a9f11ec8018544e402490 100644
--- a/chrome/browser/extensions/api/api_function.h
+++ b/chrome/browser/extensions/api/api_function.h
@@ -6,22 +6,22 @@
#define CHROME_BROWSER_EXTENSIONS_API_API_FUNCTION_H_
#include "chrome/browser/extensions/extension_function.h"
-#include "chrome/browser/extensions/api/api_resource.h"
#include "content/public/browser/browser_thread.h"
-class ExtensionService;
-
namespace extensions {
-class APIResourceController;
-class APIResourceEventNotifier;
+class ApiResourceEventNotifier;
-// AsyncAPIFunction provides convenient thread management for APIs that need to
+// AsyncApiFunction provides convenient thread management for APIs that need to
// do essentially all their work on a thread other than the UI thread.
-class AsyncAPIFunction : public AsyncExtensionFunction {
+class AsyncApiFunction : public AsyncExtensionFunction {
protected:
- AsyncAPIFunction();
- virtual ~AsyncAPIFunction() {}
+ AsyncApiFunction();
+ virtual ~AsyncApiFunction() {}
+
+ // Like Prepare(). A useful place to put common work in an ApiFunction
+ // superclass that multiple API functions want to share.
+ virtual bool PrePrepare();
// Set up for work (e.g., validate arguments). Guaranteed to happen on UI
// thread.
@@ -34,7 +34,7 @@ class AsyncAPIFunction : public AsyncExtensionFunction {
// Start the asynchronous work. Guraranteed to happen on requested thread.
virtual void AsyncWorkStart();
- // Notify AsyncIOAPIFunction that the work is completed
+ // Notify AsyncIOApiFunction that the work is completed
void AsyncWorkCompleted();
// Respond. Guaranteed to happen on UI thread.
@@ -51,10 +51,7 @@ class AsyncAPIFunction : public AsyncExtensionFunction {
int DeprecatedExtractSrcId(size_t argument_position);
// Utility.
- APIResourceEventNotifier* CreateEventNotifier(int src_id);
-
- // Access to the controller singleton.
- APIResourceController* controller();
+ ApiResourceEventNotifier* CreateEventNotifier(int src_id);
// ExtensionFunction::RunImpl()
virtual bool RunImpl() OVERRIDE;
@@ -71,8 +68,6 @@ class AsyncAPIFunction : public AsyncExtensionFunction {
// If you don't want your Work() method to happen on the IO thread, then set
// this to the thread that you do want, preferably in Prepare().
content::BrowserThread::ID work_thread_id_;
-
- ExtensionService* extension_service_;
};
} // namespace extensions
« no previous file with comments | « no previous file | chrome/browser/extensions/api/api_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698