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

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

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
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 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_
6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ 6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHost); 105 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHost);
106 }; 106 };
107 107
108 class MockRenderProcessHostFactory : public RenderProcessHostFactory { 108 class MockRenderProcessHostFactory : public RenderProcessHostFactory {
109 public: 109 public:
110 MockRenderProcessHostFactory(); 110 MockRenderProcessHostFactory();
111 virtual ~MockRenderProcessHostFactory(); 111 virtual ~MockRenderProcessHostFactory();
112 112
113 virtual RenderProcessHost* CreateRenderProcessHost( 113 virtual RenderProcessHost* CreateRenderProcessHost(
114 BrowserContext* browser_context) const OVERRIDE; 114 BrowserContext* browser_context,
115 SiteInstance* site_instance) const OVERRIDE;
115 116
116 // Removes the given MockRenderProcessHost from the MockRenderProcessHost list 117 // Removes the given MockRenderProcessHost from the MockRenderProcessHost list
117 // without deleting it. When a test deletes a MockRenderProcessHost, we need 118 // without deleting it. When a test deletes a MockRenderProcessHost, we need
118 // to remove it from |processes_| to prevent it from being deleted twice. 119 // to remove it from |processes_| to prevent it from being deleted twice.
119 void Remove(MockRenderProcessHost* host) const; 120 void Remove(MockRenderProcessHost* host) const;
120 121
121 private: 122 private:
122 // A list of MockRenderProcessHosts created by this object. This list is used 123 // A list of MockRenderProcessHosts created by this object. This list is used
123 // for deleting all MockRenderProcessHosts that have not deleted by a test in 124 // for deleting all MockRenderProcessHosts that have not deleted by a test in
124 // the destructor and prevent them from being leaked. 125 // the destructor and prevent them from being leaked.
125 mutable ScopedVector<MockRenderProcessHost> processes_; 126 mutable ScopedVector<MockRenderProcessHost> processes_;
126 127
127 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); 128 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory);
128 }; 129 };
129 130
130 } // namespace content 131 } // namespace content
131 132
132 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ 133 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « content/public/browser/render_process_host_factory.h ('k') | content/public/test/mock_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698