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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/mock_render_process_host.cc
diff --git a/content/public/test/mock_render_process_host.cc b/content/public/test/mock_render_process_host.cc
index d877d443356d23767f3543f21449683845557195..3e02eca9fae5e84691411729e5f3c0ef5d73b120 100644
--- a/content/public/test/mock_render_process_host.cc
+++ b/content/public/test/mock_render_process_host.cc
@@ -251,10 +251,14 @@ RenderProcessHost* MockRenderProcessHostFactory::CreateRenderProcessHost(
processes_.push_back(host);
host->SetFactory(this);
}
+ FOR_EACH_OBSERVER(Observer, observer_list_,
+ OnRenderProcessHostCreated(host));
return host;
}
void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const {
+ FOR_EACH_OBSERVER(Observer, observer_list_,
+ OnRenderProcessHostDestroyed(host));
for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin();
it != processes_.end(); ++it) {
if (*it == host) {
@@ -264,4 +268,14 @@ void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const {
}
}
+MockRenderProcessHostFactory::Observer::Observer(
+ MockRenderProcessHostFactory* factory)
+ : factory_(factory) {
+ factory->AddObserver(this);
+}
+
+MockRenderProcessHostFactory::Observer::~Observer() {
+ factory_->RemoveObserver(this);
+}
+
} // content
« 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