| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
| 6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ | 6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
| 9 #include "base/observer_list.h" |
| 9 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 10 #include "content/public/renderer/render_thread.h" | 11 #include "content/public/renderer/render_thread.h" |
| 11 #include "ipc/ipc_test_sink.h" | 12 #include "ipc/ipc_test_sink.h" |
| 12 #include "third_party/WebKit/public/web/WebPopupType.h" | 13 #include "third_party/WebKit/public/web/WebPopupType.h" |
| 13 | 14 |
| 14 struct ViewHostMsg_CreateWindow_Params; | 15 struct ViewHostMsg_CreateWindow_Params; |
| 15 | 16 |
| 16 namespace IPC { | 17 namespace IPC { |
| 17 class MessageReplyDeserializer; | 18 class MessageReplyDeserializer; |
| 18 } | 19 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // Simulates the Widget receiving a close message. This should result | 103 // Simulates the Widget receiving a close message. This should result |
| 103 // on releasing the internal reference counts and destroying the internal | 104 // on releasing the internal reference counts and destroying the internal |
| 104 // state. | 105 // state. |
| 105 void SendCloseMessage(); | 106 void SendCloseMessage(); |
| 106 | 107 |
| 107 protected: | 108 protected: |
| 108 // This function operates as a regular IPC listener. Subclasses | 109 // This function operates as a regular IPC listener. Subclasses |
| 109 // overriding this should first delegate to this implementation. | 110 // overriding this should first delegate to this implementation. |
| 110 virtual bool OnMessageReceived(const IPC::Message& msg); | 111 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 111 | 112 |
| 113 // Dispatches control messages to observers. |
| 114 bool OnControlMessageReceived(const IPC::Message& msg); |
| 115 |
| 112 // The Widget expects to be returned valid route_id. | 116 // The Widget expects to be returned valid route_id. |
| 113 void OnCreateWidget(int opener_id, | 117 void OnCreateWidget(int opener_id, |
| 114 WebKit::WebPopupType popup_type, | 118 WebKit::WebPopupType popup_type, |
| 115 int* route_id, | 119 int* route_id, |
| 116 int* surface_id); | 120 int* surface_id); |
| 117 | 121 |
| 118 // The View expects to be returned a valid route_id different from its own. | 122 // The View expects to be returned a valid route_id different from its own. |
| 119 // We do not keep track of the newly created widget in MockRenderThread, | 123 // We do not keep track of the newly created widget in MockRenderThread, |
| 120 // so it must be cleaned up on its own. | 124 // so it must be cleaned up on its own. |
| 121 void OnCreateWindow( | 125 void OnCreateWindow( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 148 | 152 |
| 149 // Routing id that will be assigned to a CreateWindow Widget. | 153 // Routing id that will be assigned to a CreateWindow Widget. |
| 150 int32 new_window_routing_id_; | 154 int32 new_window_routing_id_; |
| 151 int32 new_window_main_frame_routing_id_; | 155 int32 new_window_main_frame_routing_id_; |
| 152 | 156 |
| 153 // The last known good deserializer for sync messages. | 157 // The last known good deserializer for sync messages. |
| 154 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; | 158 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; |
| 155 | 159 |
| 156 // A list of message filters added to this thread. | 160 // A list of message filters added to this thread. |
| 157 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; | 161 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; |
| 162 |
| 163 // Observers to notify. |
| 164 ObserverList<RenderProcessObserver> observers_; |
| 158 }; | 165 }; |
| 159 | 166 |
| 160 } // namespace content | 167 } // namespace content |
| 161 | 168 |
| 162 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ | 169 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
| OLD | NEW |