OLD | NEW |
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 #include "content/public/test/mock_render_process_host.h" | 5 #include "content/public/test/mock_render_process_host.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return transport_dib_; | 120 return transport_dib_; |
121 #if defined(OS_WIN) | 121 #if defined(OS_WIN) |
122 HANDLE duped; | 122 HANDLE duped; |
123 DuplicateHandle(GetCurrentProcess(), dib_id.handle, GetCurrentProcess(), | 123 DuplicateHandle(GetCurrentProcess(), dib_id.handle, GetCurrentProcess(), |
124 &duped, 0, TRUE, DUPLICATE_SAME_ACCESS); | 124 &duped, 0, TRUE, DUPLICATE_SAME_ACCESS); |
125 transport_dib_ = TransportDIB::Map(duped); | 125 transport_dib_ = TransportDIB::Map(duped); |
126 #elif defined(OS_MACOSX) | 126 #elif defined(OS_MACOSX) |
127 // On Mac, TransportDIBs are always created in the browser, so we cannot map | 127 // On Mac, TransportDIBs are always created in the browser, so we cannot map |
128 // one from a dib_id. | 128 // one from a dib_id. |
129 transport_dib_ = TransportDIB::Create(100 * 100 * 4, 0); | 129 transport_dib_ = TransportDIB::Create(100 * 100 * 4, 0); |
130 #elif defined(OS_ANDROID) | 130 #elif defined(OS_ANDROID) || defined(USE_NATIVE_SURFACE_LINUX) |
131 // On Android, Handles and Ids are the same underlying type. | 131 // On Android, Handles and Ids are the same underlying type. |
132 transport_dib_ = TransportDIB::Map(dib_id); | 132 transport_dib_ = TransportDIB::Map(dib_id); |
133 #elif defined(OS_POSIX) | 133 #elif defined(OS_POSIX) |
134 transport_dib_ = TransportDIB::Map(dib_id.shmkey); | 134 transport_dib_ = TransportDIB::Map(dib_id.shmkey); |
135 #endif | 135 #endif |
136 | 136 |
137 return transport_dib_; | 137 return transport_dib_; |
138 } | 138 } |
139 | 139 |
140 int MockRenderProcessHost::GetID() const { | 140 int MockRenderProcessHost::GetID() const { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 258 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
259 it != processes_.end(); ++it) { | 259 it != processes_.end(); ++it) { |
260 if (*it == host) { | 260 if (*it == host) { |
261 processes_.weak_erase(it); | 261 processes_.weak_erase(it); |
262 break; | 262 break; |
263 } | 263 } |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 } // content | 267 } // content |
OLD | NEW |