OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file defines a mapping between Automation Proxy objects and | 5 // This file defines a mapping between Automation Proxy objects and |
6 // their associated app-side handles. | 6 // their associated app-side handles. |
7 | 7 |
8 #ifndef CHROME_TEST_AUTOMATION_AUTOMATION_HANDLE_TRACKER_H__ | 8 #ifndef CHROME_TEST_AUTOMATION_AUTOMATION_HANDLE_TRACKER_H__ |
9 #define CHROME_TEST_AUTOMATION_AUTOMATION_HANDLE_TRACKER_H__ | 9 #define CHROME_TEST_AUTOMATION_AUTOMATION_HANDLE_TRACKER_H__ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include <map> | 12 #include <map> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/lock.h" | |
16 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
| 16 #include "base/synchronization/lock.h" |
17 #include "ipc/ipc_channel.h" | 17 #include "ipc/ipc_channel.h" |
18 | 18 |
19 // This represents a value that the app's AutomationProvider returns | 19 // This represents a value that the app's AutomationProvider returns |
20 // when asked for a resource (like a window or tab). | 20 // when asked for a resource (like a window or tab). |
21 typedef int AutomationHandle; | 21 typedef int AutomationHandle; |
22 | 22 |
23 class AutomationHandleTracker; | 23 class AutomationHandleTracker; |
24 class AutomationMessageSender; | 24 class AutomationMessageSender; |
25 | 25 |
26 class AutomationResourceProxy | 26 class AutomationResourceProxy |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 | 100 |
101 private: | 101 private: |
102 typedef | 102 typedef |
103 std::map<AutomationHandle, scoped_refptr<AutomationResourceProxy> > | 103 std::map<AutomationHandle, scoped_refptr<AutomationResourceProxy> > |
104 HandleToObjectMap; | 104 HandleToObjectMap; |
105 typedef std::pair<AutomationHandle, AutomationResourceProxy*> MapEntry; | 105 typedef std::pair<AutomationHandle, AutomationResourceProxy*> MapEntry; |
106 | 106 |
107 HandleToObjectMap handle_to_object_; | 107 HandleToObjectMap handle_to_object_; |
108 | 108 |
109 Lock map_lock_; | 109 base::Lock map_lock_; |
110 IPC::Channel* channel_; | 110 IPC::Channel* channel_; |
111 DISALLOW_COPY_AND_ASSIGN(AutomationHandleTracker); | 111 DISALLOW_COPY_AND_ASSIGN(AutomationHandleTracker); |
112 }; | 112 }; |
113 | 113 |
114 #endif // CHROME_TEST_AUTOMATION_AUTOMATION_HANDLE_TRACKER_H__ | 114 #endif // CHROME_TEST_AUTOMATION_AUTOMATION_HANDLE_TRACKER_H__ |
OLD | NEW |