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

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

Issue 13533007: Test extension reloading behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a ScopedOleInitializer for Windows Created 7 years, 8 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_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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 244 }
245 } 245 }
246 246
247 RenderProcessHost* MockRenderProcessHostFactory::CreateRenderProcessHost( 247 RenderProcessHost* MockRenderProcessHostFactory::CreateRenderProcessHost(
248 BrowserContext* browser_context) const { 248 BrowserContext* browser_context) const {
249 MockRenderProcessHost* host = new MockRenderProcessHost(browser_context); 249 MockRenderProcessHost* host = new MockRenderProcessHost(browser_context);
250 if (host) { 250 if (host) {
251 processes_.push_back(host); 251 processes_.push_back(host);
252 host->SetFactory(this); 252 host->SetFactory(this);
253 } 253 }
254 FOR_EACH_OBSERVER(Observer, observer_list_,
255 OnRenderProcessHostCreated(host));
254 return host; 256 return host;
255 } 257 }
256 258
257 void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const { 259 void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const {
260 FOR_EACH_OBSERVER(Observer, observer_list_,
261 OnRenderProcessHostDestroyed(host));
258 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); 262 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin();
259 it != processes_.end(); ++it) { 263 it != processes_.end(); ++it) {
260 if (*it == host) { 264 if (*it == host) {
261 processes_.weak_erase(it); 265 processes_.weak_erase(it);
262 break; 266 break;
263 } 267 }
264 } 268 }
265 } 269 }
266 270
271 MockRenderProcessHostFactory::Observer::Observer(
272 MockRenderProcessHostFactory* factory)
273 : factory_(factory) {
274 factory->AddObserver(this);
275 }
276
277 MockRenderProcessHostFactory::Observer::~Observer() {
278 factory_->RemoveObserver(this);
279 }
280
267 } // content 281 } // content
OLDNEW
« no previous file with comments | « content/public/test/mock_render_process_host.h ('k') | content/public/test/test_notification_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698