Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: chrome/service/service_utility_process_host.cc

Issue 10512016: Get rid of internal content includes for sandbox code from chrome. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: update deps! Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/service/service_main.cc ('k') | content/common/sandbox_policy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/message_loop_proxy.h" 12 #include "base/message_loop_proxy.h"
13 #include "base/process_util.h" 13 #include "base/process_util.h"
14 #include "base/scoped_temp_dir.h" 14 #include "base/scoped_temp_dir.h"
15 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
16 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
17 #include "chrome/common/chrome_utility_messages.h" 17 #include "chrome/common/chrome_utility_messages.h"
18 #include "content/public/common/child_process_host.h" 18 #include "content/public/common/child_process_host.h"
19 #include "content/public/common/result_codes.h" 19 #include "content/public/common/result_codes.h"
20 #include "content/public/common/sandbox_init.h"
20 #include "ipc/ipc_switches.h" 21 #include "ipc/ipc_switches.h"
21 #include "printing/page_range.h" 22 #include "printing/page_range.h"
22 #include "ui/base/ui_base_switches.h" 23 #include "ui/base/ui_base_switches.h"
23 #include "ui/gfx/rect.h" 24 #include "ui/gfx/rect.h"
24 25
25 #if defined(OS_WIN) 26 #if defined(OS_WIN)
26 #include "base/file_path.h" 27 #include "base/file_path.h"
27 #include "base/memory/scoped_ptr.h" 28 #include "base/memory/scoped_ptr.h"
28 #include "base/win/scoped_handle.h" 29 #include "base/win/scoped_handle.h"
29 #include "content/common/sandbox_policy.h"
30 #include "printing/emf_win.h" 30 #include "printing/emf_win.h"
31 #endif 31 #endif
32 32
33 using content::ChildProcessHost; 33 using content::ChildProcessHost;
34 34
35 ServiceUtilityProcessHost::ServiceUtilityProcessHost( 35 ServiceUtilityProcessHost::ServiceUtilityProcessHost(
36 Client* client, base::MessageLoopProxy* client_message_loop_proxy) 36 Client* client, base::MessageLoopProxy* client_message_loop_proxy)
37 : handle_(base::kNullProcessHandle), 37 : handle_(base::kNullProcessHandle),
38 client_(client), 38 client_(client),
39 client_message_loop_proxy_(client_message_loop_proxy), 39 client_message_loop_proxy_(client_message_loop_proxy),
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // TODO(sanjeevr): Implement for non-Windows OSes. 130 // TODO(sanjeevr): Implement for non-Windows OSes.
131 NOTIMPLEMENTED(); 131 NOTIMPLEMENTED();
132 return false; 132 return false;
133 #else // !defined(OS_WIN) 133 #else // !defined(OS_WIN)
134 134
135 if (no_sandbox) { 135 if (no_sandbox) {
136 base::ProcessHandle process = base::kNullProcessHandle; 136 base::ProcessHandle process = base::kNullProcessHandle;
137 cmd_line->AppendSwitch(switches::kNoSandbox); 137 cmd_line->AppendSwitch(switches::kNoSandbox);
138 base::LaunchProcess(*cmd_line, base::LaunchOptions(), &handle_); 138 base::LaunchProcess(*cmd_line, base::LaunchOptions(), &handle_);
139 } else { 139 } else {
140 handle_ = sandbox::StartProcessWithAccess(cmd_line, exposed_dir); 140 handle_ = content::StartProcessWithAccess(cmd_line, exposed_dir);
141 } 141 }
142 return (handle_ != base::kNullProcessHandle); 142 return (handle_ != base::kNullProcessHandle);
143 #endif // !defined(OS_WIN) 143 #endif // !defined(OS_WIN)
144 } 144 }
145 145
146 FilePath ServiceUtilityProcessHost::GetUtilityProcessCmd() { 146 FilePath ServiceUtilityProcessHost::GetUtilityProcessCmd() {
147 #if defined(OS_LINUX) 147 #if defined(OS_LINUX)
148 int flags = ChildProcessHost::CHILD_ALLOW_SELF; 148 int flags = ChildProcessHost::CHILD_ALLOW_SELF;
149 #else 149 #else
150 int flags = ChildProcessHost::CHILD_NORMAL; 150 int flags = ChildProcessHost::CHILD_NORMAL;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 if (!metafile.InitFromFile(metafile_path)) { 241 if (!metafile.InitFromFile(metafile_path)) {
242 OnRenderPDFPagesToMetafileFailed(); 242 OnRenderPDFPagesToMetafileFailed();
243 } else { 243 } else {
244 OnRenderPDFPagesToMetafileSucceeded(metafile, 244 OnRenderPDFPagesToMetafileSucceeded(metafile,
245 highest_rendered_page_number, 245 highest_rendered_page_number,
246 scale_factor); 246 scale_factor);
247 } 247 }
248 #endif // defined(OS_WIN) 248 #endif // defined(OS_WIN)
249 } 249 }
250 250
OLDNEW
« no previous file with comments | « chrome/service/service_main.cc ('k') | content/common/sandbox_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698