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 "chrome/service/service_utility_process_host.h" | 5 #include "chrome/service/service_utility_process_host.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <queue> | 9 #include <queue> |
10 #include <utility> | 10 #include <utility> |
(...skipping 240 matching lines...) Loading... |
251 named_pair.PrepareToPassClientHandleToChildProcess(cmd_line); | 251 named_pair.PrepareToPassClientHandleToChildProcess(cmd_line); |
252 | 252 |
253 cmd_line->AppendSwitch(switches::kNoSandbox); | 253 cmd_line->AppendSwitch(switches::kNoSandbox); |
254 process_ = base::LaunchProcess(*cmd_line, base::LaunchOptions()); | 254 process_ = base::LaunchProcess(*cmd_line, base::LaunchOptions()); |
255 success = process_.IsValid(); | 255 success = process_.IsValid(); |
256 } else { | 256 } else { |
257 mojo::edk::PlatformChannelPair channel_pair; | 257 mojo::edk::PlatformChannelPair channel_pair; |
258 parent_handle = channel_pair.PassServerHandle(); | 258 parent_handle = channel_pair.PassServerHandle(); |
259 mojo::edk::ScopedPlatformHandle client_handle = | 259 mojo::edk::ScopedPlatformHandle client_handle = |
260 channel_pair.PassClientHandle(); | 260 channel_pair.PassClientHandle(); |
261 base::HandlesToInheritVector handles; | 261 std::vector<HANDLE> handles; |
262 handles.push_back(client_handle.get().handle); | 262 handles.push_back(client_handle.get().handle); |
263 cmd_line->AppendSwitchASCII( | 263 cmd_line->AppendSwitchASCII( |
264 mojo::edk::PlatformChannelPair::kMojoPlatformChannelHandleSwitch, | 264 mojo::edk::PlatformChannelPair::kMojoPlatformChannelHandleSwitch, |
265 base::UintToString(base::win::HandleToUint32(handles[0]))); | 265 base::UintToString(base::win::HandleToUint32(handles[0]))); |
266 | 266 |
267 ServiceSandboxedProcessLauncherDelegate delegate; | 267 ServiceSandboxedProcessLauncherDelegate delegate; |
268 base::Process process; | 268 base::Process process; |
269 sandbox::ResultCode result = content::StartSandboxedProcess( | 269 sandbox::ResultCode result = content::StartSandboxedProcess( |
270 &delegate, cmd_line, handles, &process); | 270 &delegate, cmd_line, handles, &process); |
271 if (result == sandbox::SBOX_ALL_OK) { | 271 if (result == sandbox::SBOX_ALL_OK) { |
(...skipping 173 matching lines...) Loading... |
445 return false; | 445 return false; |
446 } | 446 } |
447 printing::Emf emf; | 447 printing::Emf emf; |
448 if (!emf.InitFromData(data.data(), data.size())) { | 448 if (!emf.InitFromData(data.data(), data.size())) { |
449 OnRenderPDFPagesToMetafileDone(false); | 449 OnRenderPDFPagesToMetafileDone(false); |
450 return false; | 450 return false; |
451 } | 451 } |
452 OnRenderPDFPagesToMetafilePageDone(scale_factor, emf); | 452 OnRenderPDFPagesToMetafilePageDone(scale_factor, emf); |
453 return true; | 453 return true; |
454 } | 454 } |
OLD | NEW |