| 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 reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle)); |
| 210 #else |
| 211 #error Not implemented. |
| 212 #endif |
| 213 IPC::PlatformFileForTransit remote_platform_file = |
| 214 PpapiThread::ShareHandleWithRemote(local_platform_file, remote_pid, |
| 215 false); |
| 216 return remote_platform_file; |
| 217 } |
| 218 |
| 202 std::set<PP_Instance>* PpapiThread::GetGloballySeenInstanceIDSet() { | 219 std::set<PP_Instance>* PpapiThread::GetGloballySeenInstanceIDSet() { |
| 203 return &globally_seen_instance_ids_; | 220 return &globally_seen_instance_ids_; |
| 204 } | 221 } |
| 205 | 222 |
| 206 IPC::Sender* PpapiThread::GetBrowserSender() { | 223 IPC::Sender* PpapiThread::GetBrowserSender() { |
| 207 return this; | 224 return this; |
| 208 } | 225 } |
| 209 | 226 |
| 210 std::string PpapiThread::GetUILanguage() { | 227 std::string PpapiThread::GetUILanguage() { |
| 211 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 228 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") + | 574 std::string("Plugin.Ppapi") + (is_broker_ ? "Broker" : "Plugin") + |
| 558 "LoadErrorCode_" + path.BaseName().MaybeAsASCII(); | 575 "LoadErrorCode_" + path.BaseName().MaybeAsASCII(); |
| 559 | 576 |
| 560 // For sparse histograms, we can use the macro, as it does not incorporate a | 577 // For sparse histograms, we can use the macro, as it does not incorporate a |
| 561 // static. | 578 // static. |
| 562 UMA_HISTOGRAM_SPARSE_SLOWLY(histogram_name, error.code); | 579 UMA_HISTOGRAM_SPARSE_SLOWLY(histogram_name, error.code); |
| 563 #endif | 580 #endif |
| 564 } | 581 } |
| 565 | 582 |
| 566 } // namespace content | 583 } // namespace content |
| OLD | NEW |