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

Side by Side Diff: chrome/browser/extensions/api/api_function.h

Issue 10071035: RefCounted types should not have public destructors, chrome/browser/extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile fix Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_API_FUNCTION_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_API_FUNCTION_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_API_FUNCTION_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_API_FUNCTION_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/extensions/extension_function.h" 9 #include "chrome/browser/extensions/extension_function.h"
10 #include "chrome/browser/extensions/api/api_resource.h" 10 #include "chrome/browser/extensions/api/api_resource.h"
11 11
12 class ExtensionService; 12 class ExtensionService;
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 class APIResourceController; 16 class APIResourceController;
17 class APIResourceEventNotifier; 17 class APIResourceEventNotifier;
18 18
19 // AsyncIOAPIFunction provides convenient thread management for APIs that 19 // AsyncIOAPIFunction provides convenient thread management for APIs that
20 // need to do essentially all their work on the IO thread. 20 // need to do essentially all their work on the IO thread.
21 class AsyncIOAPIFunction : public AsyncExtensionFunction { 21 class AsyncIOAPIFunction : public AsyncExtensionFunction {
22 protected: 22 protected:
23 virtual ~AsyncIOAPIFunction() {}
24
23 // Set up for work (e.g., validate arguments). Guaranteed to happen on UI 25 // Set up for work (e.g., validate arguments). Guaranteed to happen on UI
24 // thread. 26 // thread.
25 virtual bool Prepare() = 0; 27 virtual bool Prepare() = 0;
26 28
27 // Do actual work. Guaranteed to happen on IO thread. 29 // Do actual work. Guaranteed to happen on IO thread.
28 virtual void Work() = 0; 30 virtual void Work() = 0;
29 31
30 // Respond. Guaranteed to happen on UI thread. 32 // Respond. Guaranteed to happen on UI thread.
31 virtual bool Respond() = 0; 33 virtual bool Respond() = 0;
32 34
33 // Looks for a kSrcId key that might have been added to a create method's 35 // Looks for a kSrcId key that might have been added to a create method's
34 // options object. 36 // options object.
35 int ExtractSrcId(size_t argument_position); 37 int ExtractSrcId(size_t argument_position);
36 38
37 // Utility. 39 // Utility.
38 APIResourceEventNotifier* CreateEventNotifier(int src_id); 40 APIResourceEventNotifier* CreateEventNotifier(int src_id);
39 41
40 // Access to the controller singleton. 42 // Access to the controller singleton.
41 APIResourceController* controller(); 43 APIResourceController* controller();
42 44
45 // ExtensionFunction:
43 virtual bool RunImpl() OVERRIDE; 46 virtual bool RunImpl() OVERRIDE;
44 47
45 private: 48 private:
46 void WorkOnIOThread(); 49 void WorkOnIOThread();
47 void RespondOnUIThread(); 50 void RespondOnUIThread();
48 51
49 ExtensionService* extension_service_; 52 ExtensionService* extension_service_;
50 }; 53 };
51 54
52 } // namespace extensions 55 } // namespace extensions
53 56
54 #endif // CHROME_BROWSER_EXTENSIONS_API_API_FUNCTION_H_ 57 #endif // CHROME_BROWSER_EXTENSIONS_API_API_FUNCTION_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/alarms/alarms_api.h ('k') | chrome/browser/extensions/api/api_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698