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/browser/utility_process_host_impl.h" | 5 #include "content/browser/utility_process_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "content/public/browser/content_browser_client.h" | 31 #include "content/public/browser/content_browser_client.h" |
32 #include "content/public/browser/utility_process_host_client.h" | 32 #include "content/public/browser/utility_process_host_client.h" |
33 #include "content/public/common/content_switches.h" | 33 #include "content/public/common/content_switches.h" |
34 #include "content/public/common/process_type.h" | 34 #include "content/public/common/process_type.h" |
35 #include "content/public/common/sandbox_type.h" | 35 #include "content/public/common/sandbox_type.h" |
36 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 36 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
37 #include "ipc/ipc_switches.h" | 37 #include "ipc/ipc_switches.h" |
38 #include "ui/base/ui_base_switches.h" | 38 #include "ui/base/ui_base_switches.h" |
39 | 39 |
40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
| 41 #include "content/public/common/prefetch_argument_win.h" |
41 #include "sandbox/win/src/sandbox_policy.h" | 42 #include "sandbox/win/src/sandbox_policy.h" |
42 #include "sandbox/win/src/sandbox_types.h" | 43 #include "sandbox/win/src/sandbox_types.h" |
43 #endif | 44 #endif |
44 | 45 |
45 namespace content { | 46 namespace content { |
46 | 47 |
47 // NOTE: changes to this class need to be reviewed by the security team. | 48 // NOTE: changes to this class need to be reviewed by the security team. |
48 class UtilitySandboxedProcessLauncherDelegate | 49 class UtilitySandboxedProcessLauncherDelegate |
49 : public SandboxedProcessLauncherDelegate { | 50 : public SandboxedProcessLauncherDelegate { |
50 public: | 51 public: |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 280 |
280 base::CommandLine* cmd_line = new base::CommandLine(exe_path); | 281 base::CommandLine* cmd_line = new base::CommandLine(exe_path); |
281 #endif | 282 #endif |
282 | 283 |
283 cmd_line->AppendSwitchASCII(switches::kProcessType, | 284 cmd_line->AppendSwitchASCII(switches::kProcessType, |
284 switches::kUtilityProcess); | 285 switches::kUtilityProcess); |
285 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); | 286 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
286 std::string locale = GetContentClient()->browser()->GetApplicationLocale(); | 287 std::string locale = GetContentClient()->browser()->GetApplicationLocale(); |
287 cmd_line->AppendSwitchASCII(switches::kLang, locale); | 288 cmd_line->AppendSwitchASCII(switches::kLang, locale); |
288 | 289 |
| 290 #if defined(OS_WIN) |
| 291 AddWindowsPrefetchArgument(PREFETCH_ID_DEFAULT, cmd_line); |
| 292 #endif // defined(OS_WIN) |
| 293 |
289 if (no_sandbox_) | 294 if (no_sandbox_) |
290 cmd_line->AppendSwitch(switches::kNoSandbox); | 295 cmd_line->AppendSwitch(switches::kNoSandbox); |
291 | 296 |
292 // Browser command-line switches to propagate to the utility process. | 297 // Browser command-line switches to propagate to the utility process. |
293 static const char* const kSwitchNames[] = { | 298 static const char* const kSwitchNames[] = { |
294 switches::kDebugPluginLoading, | 299 switches::kDebugPluginLoading, |
295 switches::kNoSandbox, | 300 switches::kNoSandbox, |
296 switches::kProfilerTiming, | 301 switches::kProfilerTiming, |
297 #if defined(OS_MACOSX) | 302 #if defined(OS_MACOSX) |
298 switches::kEnableSandboxLogging, | 303 switches::kEnableSandboxLogging, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 if (RenderProcessHost::run_renderer_in_process()) | 376 if (RenderProcessHost::run_renderer_in_process()) |
372 handle = base::GetCurrentProcessHandle(); | 377 handle = base::GetCurrentProcessHandle(); |
373 else | 378 else |
374 handle = process_->GetData().handle; | 379 handle = process_->GetData().handle; |
375 | 380 |
376 mojo_application_host_->Activate(this, handle); | 381 mojo_application_host_->Activate(this, handle); |
377 } | 382 } |
378 } | 383 } |
379 | 384 |
380 } // namespace content | 385 } // namespace content |
OLD | NEW |