OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_AUTOMATION_AUTOMATION_RESOURCE_MESSAGE_FILTER_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_RESOURCE_MESSAGE_FILTER_H_ |
6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_RESOURCE_MESSAGE_FILTER_H_ | 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_RESOURCE_MESSAGE_FILTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // Returns a new automation request id. This is unique across all instances | 54 // Returns a new automation request id. This is unique across all instances |
55 // of AutomationResourceMessageFilter. | 55 // of AutomationResourceMessageFilter. |
56 int NewAutomationRequestId() { | 56 int NewAutomationRequestId() { |
57 return base::subtle::Barrier_AtomicIncrement(&unique_request_id_, 1); | 57 return base::subtle::Barrier_AtomicIncrement(&unique_request_id_, 1); |
58 } | 58 } |
59 | 59 |
60 // IPC::ChannelProxy::MessageFilter methods: | 60 // IPC::ChannelProxy::MessageFilter methods: |
61 virtual void OnFilterAdded(IPC::Channel* channel); | 61 virtual void OnFilterAdded(IPC::Channel* channel); |
62 virtual void OnFilterRemoved(); | 62 virtual void OnFilterRemoved(); |
63 | 63 |
64 virtual void OnChannelConnected(int32 peer_pid); | 64 // IPC::Channel::Listener implementation. |
65 virtual void OnChannelClosing(); | 65 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
66 virtual bool OnMessageReceived(const IPC::Message& message); | 66 virtual void OnChannelClosing() OVERRIDE; |
| 67 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
67 | 68 |
68 // ResourceDispatcherHost::Receiver methods: | 69 // ResourceDispatcherHost::Receiver methods: |
69 virtual bool Send(IPC::Message* message); | 70 virtual bool Send(IPC::Message* message); |
70 | 71 |
71 // Add request to the list of outstanding requests. | 72 // Add request to the list of outstanding requests. |
72 virtual bool RegisterRequest(URLRequestAutomationJob* job); | 73 virtual bool RegisterRequest(URLRequestAutomationJob* job); |
73 | 74 |
74 // Remove request from the list of outstanding requests. | 75 // Remove request from the list of outstanding requests. |
75 virtual void UnRegisterRequest(URLRequestAutomationJob* job); | 76 virtual void UnRegisterRequest(URLRequestAutomationJob* job); |
76 | 77 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 static base::LazyInstance<CompletionCallbackMap> completion_callback_map_; | 207 static base::LazyInstance<CompletionCallbackMap> completion_callback_map_; |
207 | 208 |
208 // Contains the id of the next completion callback. This is passed to the the | 209 // Contains the id of the next completion callback. This is passed to the the |
209 // external host as a cookie referring to the completion callback. | 210 // external host as a cookie referring to the completion callback. |
210 static int next_completion_callback_id_; | 211 static int next_completion_callback_id_; |
211 | 212 |
212 DISALLOW_COPY_AND_ASSIGN(AutomationResourceMessageFilter); | 213 DISALLOW_COPY_AND_ASSIGN(AutomationResourceMessageFilter); |
213 }; | 214 }; |
214 | 215 |
215 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_RESOURCE_MESSAGE_FILTER_H_ | 216 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_RESOURCE_MESSAGE_FILTER_H_ |
OLD | NEW |