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

Unified Diff: chrome/browser/renderer_host/test_render_view_host.h

Issue 62044: Make the RenderViewHostFactory a global. This prevents us from having to pass... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
Index: chrome/browser/renderer_host/test_render_view_host.h
===================================================================
--- chrome/browser/renderer_host/test_render_view_host.h (revision 13136)
+++ chrome/browser/renderer_host/test_render_view_host.h (working copy)
@@ -11,6 +11,7 @@
#include "chrome/browser/renderer_host/mock_render_process_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/renderer_host/render_view_host.h"
+#include "chrome/browser/renderer_host/render_view_host_factory.h"
#include "chrome/browser/tab_contents/site_instance.h"
#include "chrome/browser/tab_contents/test_web_contents.h"
#include "chrome/test/testing_profile.h"
@@ -134,12 +135,18 @@
// TestRenderViewHostFactory ---------------------------------------------------
+// Manages creation of the RenderViewHosts using our special subclass. This
+// automatically registers itself when it goes in scope, and unregisters itself
+// when it goes out of scope. Since you can't have more than one factory
+// registered at a time, you can only have one of these objects at a time.
class TestRenderViewHostFactory : public RenderViewHostFactory {
public:
TestRenderViewHostFactory(RenderProcessHostFactory* rph_factory)
: render_process_host_factory_(rph_factory) {
+ RenderViewHostFactory::RegisterFactory(this);
}
virtual ~TestRenderViewHostFactory() {
+ RenderViewHostFactory::UnregisterFactory();
}
virtual RenderViewHost* CreateRenderViewHost(
« no previous file with comments | « chrome/browser/renderer_host/render_view_host_factory.cc ('k') | chrome/browser/renderer_host/test_render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698