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

Side by Side Diff: content/ppapi_plugin/ppapi_plugin_main.cc

Issue 1851213002: Remove sandbox on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nacl compile issues Created 4 years, 8 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
« no previous file with comments | « content/plugin/plugin_main.cc ('k') | content/ppapi_plugin/ppapi_thread.cc » ('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 "base/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/debug/crash_logging.h" 7 #include "base/debug/crash_logging.h"
8 #include "base/debug/debugger.h" 8 #include "base/debug/debugger.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 11 matching lines...) Expand all
22 #include "content/public/plugin/content_plugin_client.h" 22 #include "content/public/plugin/content_plugin_client.h"
23 #include "ipc/ipc_sender.h" 23 #include "ipc/ipc_sender.h"
24 #include "ppapi/proxy/plugin_globals.h" 24 #include "ppapi/proxy/plugin_globals.h"
25 #include "ppapi/proxy/proxy_module.h" 25 #include "ppapi/proxy/proxy_module.h"
26 #include "ui/base/ui_base_switches.h" 26 #include "ui/base/ui_base_switches.h"
27 27
28 #if defined(OS_WIN) 28 #if defined(OS_WIN)
29 #include "base/win/win_util.h" 29 #include "base/win/win_util.h"
30 #include "base/win/windows_version.h" 30 #include "base/win/windows_version.h"
31 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" 31 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h"
32 #include "sandbox/win/src/sandbox.h" 32 #include "content/child/font_warmup_win.h"
33 #include "third_party/WebKit/public/web/win/WebFontRendering.h" 33 #include "third_party/WebKit/public/web/win/WebFontRendering.h"
34 #include "third_party/skia/include/ports/SkTypeface_win.h" 34 #include "third_party/skia/include/ports/SkTypeface_win.h"
35 #include "ui/gfx/win/direct_write.h" 35 #include "ui/gfx/win/direct_write.h"
36 #include "ui/gfx/win/dpi.h" 36 #include "ui/gfx/win/dpi.h"
37 #endif 37 #endif
38 38
39 #if defined(OS_CHROMEOS) 39 #if defined(OS_CHROMEOS)
40 #include "base/files/file_util.h" 40 #include "base/files/file_util.h"
41 #endif 41 #endif
42 42
43 #if defined(OS_LINUX) 43 #if defined(OS_LINUX)
44 #include "content/public/common/sandbox_init.h" 44 #include "content/public/common/sandbox_init.h"
45 #endif 45 #endif
46 46
47 #if defined(OS_POSIX) && !defined(OS_ANDROID) 47 #if defined(OS_POSIX) && !defined(OS_ANDROID)
48 #include <stdlib.h> 48 #include <stdlib.h>
49 #endif 49 #endif
50 50
51 #if defined(OS_WIN)
52 sandbox::TargetServices* g_target_services = NULL;
53 #else
54 void* g_target_services = 0; 51 void* g_target_services = 0;
55 #endif
56 52
57 namespace content { 53 namespace content {
58 54
59 namespace { 55 namespace {
60 56
61 #if defined(OS_WIN) 57 #if defined(OS_WIN)
62 // Windows-only skia sandbox support 58 // Windows-only skia sandbox support
63 void SkiaPreCacheFont(const LOGFONT& logfont) { 59 void SkiaPreCacheFont(const LOGFONT& logfont) {
64 ppapi::proxy::PluginGlobals::Get()->PreCacheFontForFlash( 60 ppapi::proxy::PluginGlobals::Get()->PreCacheFontForFlash(
65 reinterpret_cast<const void*>(&logfont)); 61 reinterpret_cast<const void*>(&logfont));
66 } 62 }
67 #endif 63 #endif
68 64
69 } // namespace 65 } // namespace
70 66
71 // Main function for starting the PPAPI plugin process. 67 // Main function for starting the PPAPI plugin process.
72 int PpapiPluginMain(const MainFunctionParams& parameters) { 68 int PpapiPluginMain(const MainFunctionParams& parameters) {
73 const base::CommandLine& command_line = parameters.command_line; 69 const base::CommandLine& command_line = parameters.command_line;
74 70
75 #if defined(OS_WIN)
76 g_target_services = parameters.sandbox_info->target_services;
77 #endif
78
79 // If |g_target_services| is not null this process is sandboxed. One side 71 // If |g_target_services| is not null this process is sandboxed. One side
80 // effect is that we can't pop dialogs like ChildProcess::WaitForDebugger() 72 // effect is that we can't pop dialogs like ChildProcess::WaitForDebugger()
81 // does. 73 // does.
82 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { 74 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) {
83 if (g_target_services) 75 if (g_target_services)
84 base::debug::WaitForDebugger(2*60, false); 76 base::debug::WaitForDebugger(2*60, false);
85 else 77 else
86 ChildProcess::WaitForDebugger("Ppapi"); 78 ChildProcess::WaitForDebugger("Ppapi");
87 } 79 }
88 80
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 143
152 main_message_loop.Run(); 144 main_message_loop.Run();
153 145
154 #if defined(OS_WIN) 146 #if defined(OS_WIN)
155 UninitializeDWriteFontProxy(); 147 UninitializeDWriteFontProxy();
156 #endif 148 #endif
157 return 0; 149 return 0;
158 } 150 }
159 151
160 } // namespace content 152 } // namespace content
OLDNEW
« no previous file with comments | « content/plugin/plugin_main.cc ('k') | content/ppapi_plugin/ppapi_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698