| 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), | 
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 110   // On Mac, TransportDIBs are always created in the browser, so we cannot map | 110   // On Mac, TransportDIBs are always created in the browser, so we cannot map | 
| 111   // one from a dib_id. | 111   // one from a dib_id. | 
| 112   transport_dib_ = TransportDIB::Create(100 * 100 * 4, 0); | 112   transport_dib_ = TransportDIB::Create(100 * 100 * 4, 0); | 
| 113 #elif defined(OS_POSIX) | 113 #elif defined(OS_POSIX) | 
| 114   transport_dib_ = TransportDIB::Map(dib_id); | 114   transport_dib_ = TransportDIB::Map(dib_id); | 
| 115 #endif | 115 #endif | 
| 116 | 116 | 
| 117   return transport_dib_; | 117   return transport_dib_; | 
| 118 } | 118 } | 
| 119 | 119 | 
| 120 void MockRenderProcessHost::OnMessageReceived(const IPC::Message& msg) { | 120 bool MockRenderProcessHost::OnMessageReceived(const IPC::Message& msg) { | 
|  | 121   return false; | 
| 121 } | 122 } | 
| 122 | 123 | 
| 123 void MockRenderProcessHost::OnChannelConnected(int32 peer_pid) { | 124 void MockRenderProcessHost::OnChannelConnected(int32 peer_pid) { | 
| 124 } | 125 } | 
| 125 | 126 | 
| 126 MockRenderProcessHostFactory::MockRenderProcessHostFactory() {} | 127 MockRenderProcessHostFactory::MockRenderProcessHostFactory() {} | 
| 127 | 128 | 
| 128 MockRenderProcessHostFactory::~MockRenderProcessHostFactory() { | 129 MockRenderProcessHostFactory::~MockRenderProcessHostFactory() { | 
| 129   // Detach this object from MockRenderProcesses to prevent STLDeleteElements() | 130   // Detach this object from MockRenderProcesses to prevent STLDeleteElements() | 
| 130   // from calling MockRenderProcessHostFactory::Remove(). | 131   // from calling MockRenderProcessHostFactory::Remove(). | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 146 | 147 | 
| 147 void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const { | 148 void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const { | 
| 148   for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 149   for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 
| 149        it != processes_.end(); ++it) { | 150        it != processes_.end(); ++it) { | 
| 150     if (*it == host) { | 151     if (*it == host) { | 
| 151       processes_.weak_erase(it); | 152       processes_.weak_erase(it); | 
| 152       break; | 153       break; | 
| 153     } | 154     } | 
| 154   } | 155   } | 
| 155 } | 156 } | 
| OLD | NEW | 
|---|