| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/renderer_host/mock_render_process_host.h" | 5 #include "chrome/browser/renderer_host/mock_render_process_host.h" |
| 6 | 6 |
| 7 #include "chrome/browser/child_process_security_policy.h" | 7 #include "chrome/browser/child_process_security_policy.h" |
| 8 | 8 |
| 9 MockRenderProcessHost::MockRenderProcessHost(Profile* profile) | 9 MockRenderProcessHost::MockRenderProcessHost(Profile* profile) |
| 10 : RenderProcessHost(profile), | 10 : RenderProcessHost(profile), |
| 11 transport_dib_(NULL), | 11 transport_dib_(NULL), |
| 12 bad_msg_count_(0) { | 12 bad_msg_count_(0) { |
| 13 // Child process security operations can't be unit tested unless we add | 13 // Child process security operations can't be unit tested unless we add |
| 14 // ourselves as an existing child process. | 14 // ourselves as an existing child process. |
| 15 ChildProcessSecurityPolicy::GetInstance()->Add(id()); | 15 ChildProcessSecurityPolicy::GetInstance()->Add(id()); |
| 16 } | 16 } |
| 17 | 17 |
| 18 MockRenderProcessHost::~MockRenderProcessHost() { | 18 MockRenderProcessHost::~MockRenderProcessHost() { |
| 19 ChildProcessSecurityPolicy::GetInstance()->Remove(id()); | 19 ChildProcessSecurityPolicy::GetInstance()->Remove(id()); |
| 20 delete transport_dib_; | 20 delete transport_dib_; |
| 21 } | 21 } |
| 22 | 22 |
| 23 bool MockRenderProcessHost::Init(bool is_extensions_process, | 23 bool MockRenderProcessHost::Init(bool is_extensions_process) { |
| 24 URLRequestContextGetter* request_context) { | |
| 25 return true; | 24 return true; |
| 26 } | 25 } |
| 27 | 26 |
| 28 int MockRenderProcessHost::GetNextRoutingID() { | 27 int MockRenderProcessHost::GetNextRoutingID() { |
| 29 static int prev_routing_id = 0; | 28 static int prev_routing_id = 0; |
| 30 return ++prev_routing_id; | 29 return ++prev_routing_id; |
| 31 } | 30 } |
| 32 | 31 |
| 33 void MockRenderProcessHost::CancelResourceRequests(int render_widget_id) { | 32 void MockRenderProcessHost::CancelResourceRequests(int render_widget_id) { |
| 34 } | 33 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 #endif | 107 #endif |
| 109 | 108 |
| 110 return transport_dib_; | 109 return transport_dib_; |
| 111 } | 110 } |
| 112 | 111 |
| 113 void MockRenderProcessHost::OnMessageReceived(const IPC::Message& msg) { | 112 void MockRenderProcessHost::OnMessageReceived(const IPC::Message& msg) { |
| 114 } | 113 } |
| 115 | 114 |
| 116 void MockRenderProcessHost::OnChannelConnected(int32 peer_pid) { | 115 void MockRenderProcessHost::OnChannelConnected(int32 peer_pid) { |
| 117 } | 116 } |
| OLD | NEW |