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

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

Issue 16490003: Pass the SiteInstance into CreateRenderProcessHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove ContentBrowserClient, which is global, from argument list Created 7 years, 6 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
« no previous file with comments | « content/public/test/mock_render_process_host.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_process_host.h" 5 #include "content/public/test/mock_render_process_host.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "content/browser/child_process_security_policy_impl.h" 10 #include "content/browser/child_process_security_policy_impl.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 MockRenderProcessHostFactory::~MockRenderProcessHostFactory() { 246 MockRenderProcessHostFactory::~MockRenderProcessHostFactory() {
247 // Detach this object from MockRenderProcesses to prevent STLDeleteElements() 247 // Detach this object from MockRenderProcesses to prevent STLDeleteElements()
248 // from calling MockRenderProcessHostFactory::Remove(). 248 // from calling MockRenderProcessHostFactory::Remove().
249 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); 249 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin();
250 it != processes_.end(); ++it) { 250 it != processes_.end(); ++it) {
251 (*it)->SetFactory(NULL); 251 (*it)->SetFactory(NULL);
252 } 252 }
253 } 253 }
254 254
255 RenderProcessHost* MockRenderProcessHostFactory::CreateRenderProcessHost( 255 RenderProcessHost* MockRenderProcessHostFactory::CreateRenderProcessHost(
256 BrowserContext* browser_context) const { 256 BrowserContext* browser_context,
257 SiteInstance* site_instance) const {
257 MockRenderProcessHost* host = new MockRenderProcessHost(browser_context); 258 MockRenderProcessHost* host = new MockRenderProcessHost(browser_context);
258 if (host) { 259 if (host) {
259 processes_.push_back(host); 260 processes_.push_back(host);
260 host->SetFactory(this); 261 host->SetFactory(this);
261 } 262 }
262 return host; 263 return host;
263 } 264 }
264 265
265 void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const { 266 void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const {
266 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); 267 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin();
267 it != processes_.end(); ++it) { 268 it != processes_.end(); ++it) {
268 if (*it == host) { 269 if (*it == host) {
269 processes_.weak_erase(it); 270 processes_.weak_erase(it);
270 break; 271 break;
271 } 272 }
272 } 273 }
273 } 274 }
274 275
275 } // content 276 } // content
OLDNEW
« no previous file with comments | « content/public/test/mock_render_process_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698