| 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/observer_list.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 OVERRIDE; | 48 OVERRIDE; |
| 49 virtual void AddRoute(int32 routing_id, IPC::Listener* listener) OVERRIDE; | 49 virtual void AddRoute(int32 routing_id, IPC::Listener* listener) OVERRIDE; |
| 50 virtual void RemoveRoute(int32 routing_id) OVERRIDE; | 50 virtual void RemoveRoute(int32 routing_id) OVERRIDE; |
| 51 virtual int GenerateRoutingID() OVERRIDE; | 51 virtual int GenerateRoutingID() OVERRIDE; |
| 52 virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) OVERRIDE; | 52 virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) OVERRIDE; |
| 53 virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) OVERRIDE; | 53 virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) OVERRIDE; |
| 54 virtual void AddObserver(RenderProcessObserver* observer) OVERRIDE; | 54 virtual void AddObserver(RenderProcessObserver* observer) OVERRIDE; |
| 55 virtual void RemoveObserver(RenderProcessObserver* observer) OVERRIDE; | 55 virtual void RemoveObserver(RenderProcessObserver* observer) OVERRIDE; |
| 56 virtual void SetResourceDispatcherDelegate( | 56 virtual void SetResourceDispatcherDelegate( |
| 57 ResourceDispatcherDelegate* delegate) OVERRIDE; | 57 ResourceDispatcherDelegate* delegate) OVERRIDE; |
| 58 virtual void WidgetHidden() OVERRIDE; | |
| 59 virtual void WidgetRestored() OVERRIDE; | |
| 60 virtual void EnsureWebKitInitialized() OVERRIDE; | 58 virtual void EnsureWebKitInitialized() OVERRIDE; |
| 61 virtual void RecordAction(const UserMetricsAction& action) OVERRIDE; | 59 virtual void RecordAction(const UserMetricsAction& action) OVERRIDE; |
| 62 virtual void RecordComputedAction(const std::string& action) OVERRIDE; | 60 virtual void RecordComputedAction(const std::string& action) OVERRIDE; |
| 63 virtual scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer( | 61 virtual scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer( |
| 64 size_t buffer_size) OVERRIDE; | 62 size_t buffer_size) OVERRIDE; |
| 65 virtual void RegisterExtension(v8::Extension* extension) OVERRIDE; | 63 virtual void RegisterExtension(v8::Extension* extension) OVERRIDE; |
| 66 virtual void ScheduleIdleHandler(int64 initial_delay_ms) OVERRIDE; | 64 virtual void ScheduleIdleHandler(int64 initial_delay_ms) OVERRIDE; |
| 67 virtual void IdleHandler() OVERRIDE; | 65 virtual void IdleHandler() OVERRIDE; |
| 68 virtual int64 GetIdleNotificationDelayInMs() const OVERRIDE; | 66 virtual int64 GetIdleNotificationDelayInMs() const OVERRIDE; |
| 69 virtual void SetIdleNotificationDelayInMs( | 67 virtual void SetIdleNotificationDelayInMs( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 85 } | 83 } |
| 86 | 84 |
| 87 void set_surface_id(int32 id) { | 85 void set_surface_id(int32 id) { |
| 88 surface_id_ = id; | 86 surface_id_ = id; |
| 89 } | 87 } |
| 90 | 88 |
| 91 int32 opener_id() const { | 89 int32 opener_id() const { |
| 92 return opener_id_; | 90 return opener_id_; |
| 93 } | 91 } |
| 94 | 92 |
| 95 bool has_widget() const { | |
| 96 return (widget_ != NULL); | |
| 97 } | |
| 98 | |
| 99 void set_new_window_routing_id(int32 id) { | 93 void set_new_window_routing_id(int32 id) { |
| 100 new_window_routing_id_ = id; | 94 new_window_routing_id_ = id; |
| 101 } | 95 } |
| 102 | 96 |
| 103 void set_new_frame_routing_id(int32 id) { | 97 void set_new_frame_routing_id(int32 id) { |
| 104 new_frame_routing_id_ = id; | 98 new_frame_routing_id_ = id; |
| 105 } | 99 } |
| 106 | 100 |
| 107 // Simulates the Widget receiving a close message. This should result | 101 // Simulates the Widget receiving a close message. This should result |
| 108 // on releasing the internal reference counts and destroying the internal | 102 // on releasing the internal reference counts and destroying the internal |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 143 |
| 150 // Routing id what will be assigned to the Widget. | 144 // Routing id what will be assigned to the Widget. |
| 151 int32 routing_id_; | 145 int32 routing_id_; |
| 152 | 146 |
| 153 // Surface id what will be assigned to the Widget. | 147 // Surface id what will be assigned to the Widget. |
| 154 int32 surface_id_; | 148 int32 surface_id_; |
| 155 | 149 |
| 156 // Opener id reported by the Widget. | 150 // Opener id reported by the Widget. |
| 157 int32 opener_id_; | 151 int32 opener_id_; |
| 158 | 152 |
| 159 // We only keep track of one Widget, we learn its pointer when it | |
| 160 // adds a new route. We do not keep track of Widgets created with | |
| 161 // OnCreateWindow. | |
| 162 IPC::Listener* widget_; | |
| 163 | |
| 164 // Routing id that will be assigned to a CreateWindow Widget. | 153 // Routing id that will be assigned to a CreateWindow Widget. |
| 165 int32 new_window_routing_id_; | 154 int32 new_window_routing_id_; |
| 166 int32 new_window_main_frame_routing_id_; | 155 int32 new_window_main_frame_routing_id_; |
| 167 int32 new_frame_routing_id_; | 156 int32 new_frame_routing_id_; |
| 168 | 157 |
| 169 // The last known good deserializer for sync messages. | 158 // The last known good deserializer for sync messages. |
| 170 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; | 159 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; |
| 171 | 160 |
| 172 // A list of message filters added to this thread. | 161 // A list of message filters added to this thread. |
| 173 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; | 162 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; |
| 174 | 163 |
| 175 // Observers to notify. | 164 // Observers to notify. |
| 176 ObserverList<RenderProcessObserver> observers_; | 165 ObserverList<RenderProcessObserver> observers_; |
| 177 }; | 166 }; |
| 178 | 167 |
| 179 } // namespace content | 168 } // namespace content |
| 180 | 169 |
| 181 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ | 170 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
| OLD | NEW |