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

Side by Side Diff: content/public/test/mock_render_thread.cc

Issue 281663002: Create RenderFrameProxyHost at time of swap-out instead of commit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix accessibility test. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "content/public/test/mock_render_thread.h" 5 #include "content/public/test/mock_render_thread.h"
6 6
7 #include "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "content/common/frame_messages.h" 8 #include "content/common/frame_messages.h"
9 #include "content/common/view_messages.h" 9 #include "content/common/view_messages.h"
10 #include "content/public/renderer/render_process_observer.h" 10 #include "content/public/renderer/render_process_observer.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 *route_id = new_window_routing_id_; 213 *route_id = new_window_routing_id_;
214 *main_frame_route_id = new_window_main_frame_routing_id_; 214 *main_frame_route_id = new_window_main_frame_routing_id_;
215 *surface_id = surface_id_; 215 *surface_id = surface_id_;
216 *cloned_session_storage_namespace_id = 0; 216 *cloned_session_storage_namespace_id = 0;
217 } 217 }
218 218
219 // The Frame expects to be returned a valid route_id different from its own. 219 // The Frame expects to be returned a valid route_id different from its own.
220 void MockRenderThread::OnCreateChildFrame(int new_frame_routing_id, 220 void MockRenderThread::OnCreateChildFrame(int new_frame_routing_id,
221 const std::string& frame_name, 221 const std::string& frame_name,
222 int* new_render_frame_id) { 222 int* new_render_frame_id) {
223 *new_render_frame_id = new_frame_routing_id_; 223 *new_render_frame_id = new_frame_routing_id_++;
224 } 224 }
225 225
226 bool MockRenderThread::OnControlMessageReceived(const IPC::Message& msg) { 226 bool MockRenderThread::OnControlMessageReceived(const IPC::Message& msg) {
227 ObserverListBase<RenderProcessObserver>::Iterator it(observers_); 227 ObserverListBase<RenderProcessObserver>::Iterator it(observers_);
228 RenderProcessObserver* observer; 228 RenderProcessObserver* observer;
229 while ((observer = it.GetNext()) != NULL) { 229 while ((observer = it.GetNext()) != NULL) {
230 if (observer->OnControlMessageReceived(msg)) 230 if (observer->OnControlMessageReceived(msg))
231 return true; 231 return true;
232 } 232 }
233 return OnMessageReceived(msg); 233 return OnMessageReceived(msg);
(...skipping 18 matching lines...) Expand all
252 void MockRenderThread::OnDuplicateSection( 252 void MockRenderThread::OnDuplicateSection(
253 base::SharedMemoryHandle renderer_handle, 253 base::SharedMemoryHandle renderer_handle,
254 base::SharedMemoryHandle* browser_handle) { 254 base::SharedMemoryHandle* browser_handle) {
255 // We don't have to duplicate the input handles since RenderViewTest does not 255 // We don't have to duplicate the input handles since RenderViewTest does not
256 // separate a browser process from a renderer process. 256 // separate a browser process from a renderer process.
257 *browser_handle = renderer_handle; 257 *browser_handle = renderer_handle;
258 } 258 }
259 #endif // defined(OS_WIN) 259 #endif // defined(OS_WIN)
260 260
261 } // namespace content 261 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698