| 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( |
| 24 bool is_accessibility_enabled, bool is_extensions_process) { |
| 24 return true; | 25 return true; |
| 25 } | 26 } |
| 26 | 27 |
| 27 int MockRenderProcessHost::GetNextRoutingID() { | 28 int MockRenderProcessHost::GetNextRoutingID() { |
| 28 static int prev_routing_id = 0; | 29 static int prev_routing_id = 0; |
| 29 return ++prev_routing_id; | 30 return ++prev_routing_id; |
| 30 } | 31 } |
| 31 | 32 |
| 32 void MockRenderProcessHost::CancelResourceRequests(int render_widget_id) { | 33 void MockRenderProcessHost::CancelResourceRequests(int render_widget_id) { |
| 33 } | 34 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 #endif | 108 #endif |
| 108 | 109 |
| 109 return transport_dib_; | 110 return transport_dib_; |
| 110 } | 111 } |
| 111 | 112 |
| 112 void MockRenderProcessHost::OnMessageReceived(const IPC::Message& msg) { | 113 void MockRenderProcessHost::OnMessageReceived(const IPC::Message& msg) { |
| 113 } | 114 } |
| 114 | 115 |
| 115 void MockRenderProcessHost::OnChannelConnected(int32 peer_pid) { | 116 void MockRenderProcessHost::OnChannelConnected(int32 peer_pid) { |
| 116 } | 117 } |
| OLD | NEW |