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/ppapi_plugin/ppapi_thread.h" | 5 #include "content/ppapi_plugin/ppapi_thread.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/cpu.h" | 10 #include "base/cpu.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 DCHECK(is_broker_); | 192 DCHECK(is_broker_); |
193 return IPC::GetFileHandleForProcess(handle, peer_handle_.Get(), | 193 return IPC::GetFileHandleForProcess(handle, peer_handle_.Get(), |
194 should_close_source); | 194 should_close_source); |
195 } | 195 } |
196 #endif | 196 #endif |
197 | 197 |
198 DCHECK(peer_pid != base::kNullProcessId); | 198 DCHECK(peer_pid != base::kNullProcessId); |
199 return BrokerGetFileHandleForProcess(handle, peer_pid, should_close_source); | 199 return BrokerGetFileHandleForProcess(handle, peer_pid, should_close_source); |
200 } | 200 } |
201 | 201 |
| 202 base::SharedMemoryHandle PpapiThread::ShareSharedMemoryHandleWithRemote( |
| 203 const base::SharedMemoryHandle& handle, |
| 204 base::ProcessId remote_pid) { |
| 205 base::PlatformFile local_platform_file = |
| 206 #if defined(OS_POSIX) |
| 207 handle.fd; |
| 208 #elif defined(OS_WIN) |
| 209 handle; |
| 210 #else |
| 211 #error Not implemented. |
| 212 #endif |
| 213 return PpapiThread::ShareHandleWithRemote(local_platform_file, remote_pid, |
| 214 false); |
| 215 } |
| 216 |
202 std::set<PP_Instance>* PpapiThread::GetGloballySeenInstanceIDSet() { | 217 std::set<PP_Instance>* PpapiThread::GetGloballySeenInstanceIDSet() { |
203 return &globally_seen_instance_ids_; | 218 return &globally_seen_instance_ids_; |
204 } | 219 } |
205 | 220 |
206 IPC::Sender* PpapiThread::GetBrowserSender() { | 221 IPC::Sender* PpapiThread::GetBrowserSender() { |
207 return this; | 222 return this; |
208 } | 223 } |
209 | 224 |
210 std::string PpapiThread::GetUILanguage() { | 225 std::string PpapiThread::GetUILanguage() { |
211 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 226 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 std::string("Plugin.Ppapi") + (is_broker_ ? "Broker" : "Plugin") + | 572 std::string("Plugin.Ppapi") + (is_broker_ ? "Broker" : "Plugin") + |
558 "LoadErrorCode_" + path.BaseName().MaybeAsASCII(); | 573 "LoadErrorCode_" + path.BaseName().MaybeAsASCII(); |
559 | 574 |
560 // For sparse histograms, we can use the macro, as it does not incorporate a | 575 // For sparse histograms, we can use the macro, as it does not incorporate a |
561 // static. | 576 // static. |
562 UMA_HISTOGRAM_SPARSE_SLOWLY(histogram_name, error.code); | 577 UMA_HISTOGRAM_SPARSE_SLOWLY(histogram_name, error.code); |
563 #endif | 578 #endif |
564 } | 579 } |
565 | 580 |
566 } // namespace content | 581 } // namespace content |
OLD | NEW |