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

Unified Diff: chrome/test/automation/automation_handle_tracker.h

Issue 113722: Make automation proxy objects to ref_counted. That allows to process async no... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/automation/automation_handle_tracker.h
===================================================================
--- chrome/test/automation/automation_handle_tracker.h (revision 17078)
+++ chrome/test/automation/automation_handle_tracker.h (working copy)
@@ -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 @@
class AutomationHandleTracker;
class AutomationMessageSender;
-class AutomationResourceProxy {
+class AutomationResourceProxy
+ : public base::RefCountedThreadSafe<AutomationResourceProxy> {
public:
AutomationResourceProxy(AutomationHandleTracker* tracker,
AutomationMessageSender* sender,
@@ -88,15 +91,16 @@
// 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);
};
« no previous file with comments | « chrome/test/automated_ui_tests/automated_ui_tests.cc ('k') | chrome/test/automation/automation_handle_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698