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/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 29 matching lines...) Expand all Loading... | |
40 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 40 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
41 #include "ipc/ipc_switches.h" | 41 #include "ipc/ipc_switches.h" |
42 #include "net/url_request/url_request_context_getter.h" | 42 #include "net/url_request/url_request_context_getter.h" |
43 #include "ui/base/ui_base_switches.h" | 43 #include "ui/base/ui_base_switches.h" |
44 #include "ui/gfx/native_widget_types.h" | 44 #include "ui/gfx/native_widget_types.h" |
45 #include "ui/gfx/switches.h" | 45 #include "ui/gfx/switches.h" |
46 #include "ui/gl/gl_switches.h" | 46 #include "ui/gl/gl_switches.h" |
47 | 47 |
48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
49 #include <windows.h> | 49 #include <windows.h> |
50 #include "content/public/common/prefetch_argument_win.h" | |
50 #endif | 51 #endif |
51 | 52 |
52 #if defined(OS_MACOSX) | 53 #if defined(OS_MACOSX) |
53 #include "base/mac/mac_util.h" | 54 #include "base/mac/mac_util.h" |
54 #include "ui/gfx/geometry/rect.h" | 55 #include "ui/gfx/geometry/rect.h" |
55 #endif | 56 #endif |
56 | 57 |
57 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
58 #include "base/win/windows_version.h" | 59 #include "base/win/windows_version.h" |
59 #include "content/common/plugin_constants_win.h" | 60 #include "content/common/plugin_constants_win.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 base::FilePath exe_path = ChildProcessHost::GetChildPath(flags); | 203 base::FilePath exe_path = ChildProcessHost::GetChildPath(flags); |
203 if (exe_path.empty()) | 204 if (exe_path.empty()) |
204 return false; | 205 return false; |
205 | 206 |
206 base::CommandLine* cmd_line = new base::CommandLine(exe_path); | 207 base::CommandLine* cmd_line = new base::CommandLine(exe_path); |
207 // Put the process type and plugin path first so they're easier to see | 208 // Put the process type and plugin path first so they're easier to see |
208 // in process listings using native process management tools. | 209 // in process listings using native process management tools. |
209 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kPluginProcess); | 210 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kPluginProcess); |
210 cmd_line->AppendSwitchPath(switches::kPluginPath, info.path); | 211 cmd_line->AppendSwitchPath(switches::kPluginPath, info.path); |
211 | 212 |
213 #if defined(OS_WIN) | |
214 AddWindowsPrefetchArgument(PREFETCH_ID_DEFAULT, cmd_line); | |
gab
2016/01/21 20:22:59
How about "PREFETCH_ID_OTHER" (i.e. to me "default
| |
215 #endif // defined(OS_WIN) | |
216 | |
212 // Propagate the following switches to the plugin command line (along with | 217 // Propagate the following switches to the plugin command line (along with |
213 // any associated values) if present in the browser command line | 218 // any associated values) if present in the browser command line |
214 static const char* const kSwitchNames[] = { | 219 static const char* const kSwitchNames[] = { |
215 switches::kDisableBreakpad, | 220 switches::kDisableBreakpad, |
216 switches::kDisableDirectNPAPIRequests, | 221 switches::kDisableDirectNPAPIRequests, |
217 switches::kEnableStatsTable, | 222 switches::kEnableStatsTable, |
218 switches::kFullMemoryCrashReport, | 223 switches::kFullMemoryCrashReport, |
219 switches::kLoggingLevel, | 224 switches::kLoggingLevel, |
220 switches::kLogPluginMessages, | 225 switches::kLogPluginMessages, |
221 switches::kNoSandbox, | 226 switches::kNoSandbox, |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 void PluginProcessHost::GetContexts(ResourceType resource_type, | 433 void PluginProcessHost::GetContexts(ResourceType resource_type, |
429 int origin_pid, | 434 int origin_pid, |
430 ResourceContext** resource_context, | 435 ResourceContext** resource_context, |
431 net::URLRequestContext** request_context) { | 436 net::URLRequestContext** request_context) { |
432 *resource_context = | 437 *resource_context = |
433 resource_context_map_[origin_pid].resource_context; | 438 resource_context_map_[origin_pid].resource_context; |
434 *request_context = (*resource_context)->GetRequestContext(); | 439 *request_context = (*resource_context)->GetRequestContext(); |
435 } | 440 } |
436 | 441 |
437 } // namespace content | 442 } // namespace content |
OLD | NEW |