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

Side by Side Diff: chrome/browser/extensions/api/serial/serial_event_dispatcher.h

Issue 174513003: Move ProfileKeyedAPI implementations to take BrowserContext in the constructor (part 3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/serial/serial_event_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_SERIAL_SERIAL_EVENT_DISPATCHER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_EVENT_DISPATCHER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_EVENT_DISPATCHER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_EVENT_DISPATCHER_H_
7 7
8 #include "chrome/browser/extensions/api/api_resource_manager.h" 8 #include "chrome/browser/extensions/api/api_resource_manager.h"
9 #include "chrome/common/extensions/api/serial.h" 9 #include "chrome/common/extensions/api/serial.h"
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 struct Event; 13 struct Event;
14 class SerialConnection; 14 class SerialConnection;
15 15
16 namespace api { 16 namespace api {
17 17
18 // Per-profile dispatcher for events on serial connections. 18 // Per-profile dispatcher for events on serial connections.
19 class SerialEventDispatcher : public ProfileKeyedAPI { 19 class SerialEventDispatcher : public ProfileKeyedAPI {
20 public: 20 public:
21 explicit SerialEventDispatcher(Profile* profile); 21 explicit SerialEventDispatcher(content::BrowserContext* context);
22 virtual ~SerialEventDispatcher(); 22 virtual ~SerialEventDispatcher();
23 23
24 // Start receiving data and firing events for a connection. 24 // Start receiving data and firing events for a connection.
25 void PollConnection(const std::string& extension_id, int connection_id); 25 void PollConnection(const std::string& extension_id, int connection_id);
26 26
27 static SerialEventDispatcher* Get(Profile* profile); 27 static SerialEventDispatcher* Get(content::BrowserContext* context);
28 28
29 // ProfileKeyedAPI implementation. 29 // ProfileKeyedAPI implementation.
30 static ProfileKeyedAPIFactory<SerialEventDispatcher>* GetFactoryInstance(); 30 static ProfileKeyedAPIFactory<SerialEventDispatcher>* GetFactoryInstance();
31 31
32 private: 32 private:
33 typedef ApiResourceManager<SerialConnection>::ApiResourceData ConnectionData; 33 typedef ApiResourceManager<SerialConnection>::ApiResourceData ConnectionData;
34 friend class ProfileKeyedAPIFactory<SerialEventDispatcher>; 34 friend class ProfileKeyedAPIFactory<SerialEventDispatcher>;
35 35
36 // ProfileKeyedAPI implementation. 36 // ProfileKeyedAPI implementation.
37 static const char *service_name() { 37 static const char *service_name() {
(...skipping 29 matching lines...) Expand all
67 content::BrowserThread::ID thread_id_; 67 content::BrowserThread::ID thread_id_;
68 Profile* const profile_; 68 Profile* const profile_;
69 scoped_refptr<ConnectionData> connections_; 69 scoped_refptr<ConnectionData> connections_;
70 }; 70 };
71 71
72 } // namespace api 72 } // namespace api
73 73
74 } // namespace extensions 74 } // namespace extensions
75 75
76 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_EVENT_DISPATCHER_H_ 76 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_EVENT_DISPATCHER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/serial/serial_event_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698