Chromium Code Reviews| Index: chrome/browser/automation/automation_resource_message_filter.h |
| =================================================================== |
| --- chrome/browser/automation/automation_resource_message_filter.h (revision 24090) |
| +++ chrome/browser/automation/automation_resource_message_filter.h (working copy) |
| @@ -7,6 +7,7 @@ |
| #include <map> |
| +#include "base/atomicops.h" |
| #include "base/lock.h" |
| #include "base/platform_thread.h" |
| #include "ipc/ipc_channel_proxy.h" |
| @@ -40,7 +41,7 @@ |
| virtual ~AutomationResourceMessageFilter(); |
| int NewRequestId() { |
| - return unique_request_id_++; |
| + return base::subtle::Barrier_AtomicIncrement(&unique_request_id_, 1); |
|
amit
2009/08/24 22:49:57
How about base::AtomicRefCountInc from base\atomic
tommi (sloooow) - chröme
2009/08/25 02:13:18
I did look at that but there are two reasons why I
|
| } |
| // IPC::ChannelProxy::MessageFilter methods: |
| @@ -53,10 +54,10 @@ |
| virtual bool Send(IPC::Message* message); |
| // Add request to the list of outstanding requests. |
| - bool RegisterRequest(URLRequestAutomationJob* job); |
| + virtual bool RegisterRequest(URLRequestAutomationJob* job); |
| // Remove request from the list of outstanding requests. |
| - void UnRegisterRequest(URLRequestAutomationJob* job); |
| + virtual void UnRegisterRequest(URLRequestAutomationJob* job); |
| // Can be called from the UI thread. |
| static bool RegisterRenderView(int renderer_pid, int renderer_id, |
| @@ -99,7 +100,7 @@ |
| static MessageLoop* io_loop_; |
| // A unique request id per automation channel. |
|
amit
2009/08/24 22:49:57
no longer unique per channel, pl update the commen
tommi (sloooow) - chröme
2009/08/25 02:13:18
changed to "// A unique request id per process."
|
| - int unique_request_id_; |
| + static int unique_request_id_; |
|
amit
2009/08/24 22:49:57
static AutomicRefCount unique_request_id_?
|
| // Map of outstanding requests. |
| RequestMap request_map_; |