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/ppapi_plugin_process_host.h" | 5 #include "content/browser/ppapi_plugin_process_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 20 matching lines...) Expand all Loading... | |
31 #include "content/public/common/sandbox_type.h" | 31 #include "content/public/common/sandbox_type.h" |
32 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 32 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
33 #include "ipc/ipc_switches.h" | 33 #include "ipc/ipc_switches.h" |
34 #include "net/base/network_change_notifier.h" | 34 #include "net/base/network_change_notifier.h" |
35 #include "ppapi/proxy/ppapi_messages.h" | 35 #include "ppapi/proxy/ppapi_messages.h" |
36 #include "ui/base/ui_base_switches.h" | 36 #include "ui/base/ui_base_switches.h" |
37 | 37 |
38 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
39 #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h" | 39 #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h" |
40 #include "content/common/sandbox_win.h" | 40 #include "content/common/sandbox_win.h" |
41 #include "content/public/common/prefetch_argument_win.h" | |
41 #include "sandbox/win/src/process_mitigations.h" | 42 #include "sandbox/win/src/process_mitigations.h" |
42 #include "sandbox/win/src/sandbox_policy.h" | 43 #include "sandbox/win/src/sandbox_policy.h" |
43 #include "ui/gfx/win/dpi.h" | 44 #include "ui/gfx/win/dpi.h" |
44 #endif | 45 #endif |
45 | 46 |
46 namespace content { | 47 namespace content { |
47 | 48 |
48 // NOTE: changes to this class need to be reviewed by the security team. | 49 // NOTE: changes to this class need to be reviewed by the security team. |
49 class PpapiPluginSandboxedProcessLauncherDelegate | 50 class PpapiPluginSandboxedProcessLauncherDelegate |
50 : public content::SandboxedProcessLauncherDelegate { | 51 : public content::SandboxedProcessLauncherDelegate { |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 VLOG(1) << "Pepper plugin exe path is empty."; | 362 VLOG(1) << "Pepper plugin exe path is empty."; |
362 return false; | 363 return false; |
363 } | 364 } |
364 | 365 |
365 base::CommandLine* cmd_line = new base::CommandLine(exe_path); | 366 base::CommandLine* cmd_line = new base::CommandLine(exe_path); |
366 cmd_line->AppendSwitchASCII(switches::kProcessType, | 367 cmd_line->AppendSwitchASCII(switches::kProcessType, |
367 is_broker_ ? switches::kPpapiBrokerProcess | 368 is_broker_ ? switches::kPpapiBrokerProcess |
368 : switches::kPpapiPluginProcess); | 369 : switches::kPpapiPluginProcess); |
369 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); | 370 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
370 | 371 |
372 #if defined(OS_WIN) | |
373 AddWindowsPrefetchArgument( | |
374 is_broker_ ? PREFETCH_ID_DEFAULT : PREFETCH_ID_PPAPI, cmd_line); | |
gab
2016/01/21 20:22:59
What made you decide to have a special ID for one
| |
375 #endif // defined(OS_WIN) | |
376 | |
371 // These switches are forwarded to both plugin and broker pocesses. | 377 // These switches are forwarded to both plugin and broker pocesses. |
372 static const char* kCommonForwardSwitches[] = { | 378 static const char* kCommonForwardSwitches[] = { |
373 switches::kVModule | 379 switches::kVModule |
374 }; | 380 }; |
375 cmd_line->CopySwitchesFrom(browser_command_line, kCommonForwardSwitches, | 381 cmd_line->CopySwitchesFrom(browser_command_line, kCommonForwardSwitches, |
376 arraysize(kCommonForwardSwitches)); | 382 arraysize(kCommonForwardSwitches)); |
377 | 383 |
378 if (!is_broker_) { | 384 if (!is_broker_) { |
379 static const char* kPluginForwardSwitches[] = { | 385 static const char* kPluginForwardSwitches[] = { |
380 switches::kDisableSeccompFilterSandbox, | 386 switches::kDisableSeccompFilterSandbox, |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
513 // sent_requests_ queue should be the one that the plugin just created. | 519 // sent_requests_ queue should be the one that the plugin just created. |
514 Client* client = sent_requests_.front(); | 520 Client* client = sent_requests_.front(); |
515 sent_requests_.pop(); | 521 sent_requests_.pop(); |
516 | 522 |
517 const ChildProcessData& data = process_->GetData(); | 523 const ChildProcessData& data = process_->GetData(); |
518 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 524 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
519 data.id); | 525 data.id); |
520 } | 526 } |
521 | 527 |
522 } // namespace content | 528 } // namespace content |
OLD | NEW |