OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/renderer_host/mock_render_process_host.h" | 5 #include "content/browser/renderer_host/mock_render_process_host.h" |
6 | 6 |
7 #include "content/browser/child_process_security_policy.h" | 7 #include "content/browser/child_process_security_policy.h" |
8 #include "content/browser/content_browser_client.h" | |
9 #include "content/common/content_client.h" | |
8 | 10 |
9 MockRenderProcessHost::MockRenderProcessHost( | 11 MockRenderProcessHost::MockRenderProcessHost( |
10 content::BrowserContext* browser_context) | 12 content::BrowserContext* browser_context) |
11 : RenderProcessHost(browser_context), | 13 : RenderProcessHost(browser_context), |
12 transport_dib_(NULL), | 14 transport_dib_(NULL), |
13 bad_msg_count_(0), | 15 bad_msg_count_(0), |
14 factory_(NULL) { | 16 factory_(NULL) { |
15 // Child process security operations can't be unit tested unless we add | 17 // Child process security operations can't be unit tested unless we add |
16 // ourselves as an existing child process. | 18 // ourselves as an existing child process. |
17 ChildProcessSecurityPolicy::GetInstance()->Add(id()); | 19 ChildProcessSecurityPolicy::GetInstance()->Add(id()); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 | 144 |
143 void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const { | 145 void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const { |
144 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 146 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
145 it != processes_.end(); ++it) { | 147 it != processes_.end(); ++it) { |
146 if (*it == host) { | 148 if (*it == host) { |
147 processes_.weak_erase(it); | 149 processes_.weak_erase(it); |
148 break; | 150 break; |
149 } | 151 } |
150 } | 152 } |
151 } | 153 } |
154 | |
155 bool MockRenderProcessHost::IsSuitableHost(const GURL& site_url) { | |
156 if (!RenderProcessHost::IsSuitableHost(site_url)) | |
jam
2011/09/26 15:46:16
since this is just a mock object, do you need all
| |
157 return false; | |
158 return content::GetContentClient()->browser()->IsSuitableHost(this, site_url); | |
159 } | |
OLD | NEW |