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

Side by Side Diff: extensions/browser/api/hid/hid_device_manager.h

Issue 464753002: Fix HidService lifetime issues. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 | « extensions/browser/api/hid/hid_api.cc ('k') | extensions/browser/api/hid/hid_device_manager.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ 5 #ifndef EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_
6 #define EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ 6 #define EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/message_loop/message_loop_proxy.h"
14 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
15 #include "device/hid/hid_device_info.h" 17 #include "device/hid/hid_device_info.h"
16 #include "extensions/browser/browser_context_keyed_api_factory.h" 18 #include "extensions/browser/browser_context_keyed_api_factory.h"
17 #include "extensions/common/api/hid.h" 19 #include "extensions/common/api/hid.h"
18 20
19 namespace extensions { 21 namespace extensions {
20 22
21 class HidDeviceManager : public BrowserContextKeyedAPI { 23 class HidDeviceManager : public BrowserContextKeyedAPI {
22 public: 24 public:
23 explicit HidDeviceManager(content::BrowserContext* context); 25 explicit HidDeviceManager(content::BrowserContext* context);
(...skipping 22 matching lines...) Expand all
46 base::ThreadChecker thread_checker_; 48 base::ThreadChecker thread_checker_;
47 49
48 int next_resource_id_; 50 int next_resource_id_;
49 51
50 typedef std::map<int, device::HidDeviceId> ResourceIdToDeviceIdMap; 52 typedef std::map<int, device::HidDeviceId> ResourceIdToDeviceIdMap;
51 typedef std::map<device::HidDeviceId, int> DeviceIdToResourceIdMap; 53 typedef std::map<device::HidDeviceId, int> DeviceIdToResourceIdMap;
52 54
53 ResourceIdToDeviceIdMap device_ids_; 55 ResourceIdToDeviceIdMap device_ids_;
54 DeviceIdToResourceIdMap resource_ids_; 56 DeviceIdToResourceIdMap resource_ids_;
55 57
58 scoped_refptr<base::MessageLoopProxy> ui_message_loop_;
59
56 DISALLOW_COPY_AND_ASSIGN(HidDeviceManager); 60 DISALLOW_COPY_AND_ASSIGN(HidDeviceManager);
57 }; 61 };
58 62
59 } // namespace extensions 63 } // namespace extensions
60 64
61 #endif // EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ 65 #endif // EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/hid/hid_api.cc ('k') | extensions/browser/api/hid/hid_device_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698