summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation/automation_handle_tracker.h
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-28 19:12:46 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-28 19:12:46 +0000
commit802376eb9aacca5284b76da93face73a9488bdb6 (patch)
tree705226a6750fed9a1429aaf07fe9c0a03303c759 /chrome/test/automation/automation_handle_tracker.h
parent319d4ae6c8b2236fa7e0acf218c533a5a93af5a6 (diff)
downloadchromium_src-802376eb9aacca5284b76da93face73a9488bdb6.zip
chromium_src-802376eb9aacca5284b76da93face73a9488bdb6.tar.gz
chromium_src-802376eb9aacca5284b76da93face73a9488bdb6.tar.bz2
Make automation proxy objects to ref_counted. That allows to process async notifications directly in channel background thread. Add support for listener-less ChannelProxy.
BUG=none TEST=none Review URL: http://codereview.chromium.org/113722 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17093 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation/automation_handle_tracker.h')
-rw-r--r--chrome/test/automation/automation_handle_tracker.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/test/automation/automation_handle_tracker.h b/chrome/test/automation/automation_handle_tracker.h
index 44eacab..98a9fb9 100644
--- a/chrome/test/automation/automation_handle_tracker.h
+++ b/chrome/test/automation/automation_handle_tracker.h
@@ -11,6 +11,8 @@
#include <map>
#include "base/basictypes.h"
+#include "base/lock.h"
+#include "base/ref_counted.h"
// This represents a value that the app's AutomationProvider returns
// when asked for a resource (like a window or tab).
@@ -19,7 +21,8 @@ typedef int AutomationHandle;
class AutomationHandleTracker;
class AutomationMessageSender;
-class AutomationResourceProxy {
+class AutomationResourceProxy
+ : public base::RefCountedThreadSafe<AutomationResourceProxy> {
public:
AutomationResourceProxy(AutomationHandleTracker* tracker,
AutomationMessageSender* sender,
@@ -88,15 +91,16 @@ class AutomationHandleTracker {
// identified that resource.
void InvalidateHandle(AutomationHandle handle);
+ AutomationResourceProxy* GetResource(AutomationHandle handle);
private:
typedef
- std::multimap<AutomationHandle, AutomationResourceProxy*> HandleToObjectMap;
+ std::map<AutomationHandle, AutomationResourceProxy*> HandleToObjectMap;
typedef std::pair<AutomationHandle, AutomationResourceProxy*> MapEntry;
HandleToObjectMap handle_to_object_;
AutomationMessageSender* sender_;
-
+ Lock map_lock_;
DISALLOW_EVIL_CONSTRUCTORS(AutomationHandleTracker);
};