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/renderer/renderer_main_platform_delegate.h" | 5 #include "content/renderer/renderer_main_platform_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/win/scoped_comptr.h" | 11 #include "base/win/scoped_comptr.h" |
12 #include "base/win/win_util.h" | 12 #include "base/win/win_util.h" |
13 #include "base/win/windows_version.h" | 13 #include "base/win/windows_version.h" |
14 #include "content/common/sandbox_win.h" | |
15 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
16 #include "content/public/common/injection_test_win.h" | 15 #include "content/public/common/injection_test_win.h" |
17 #include "content/public/renderer/render_font_warmup_win.h" | 16 #include "content/public/renderer/render_font_warmup_win.h" |
18 #include "content/public/renderer/render_thread.h" | 17 #include "content/public/renderer/render_thread.h" |
19 #include "content/renderer/render_thread_impl.h" | 18 #include "content/renderer/render_thread_impl.h" |
20 #include "sandbox/win/src/sandbox.h" | 19 #include "sandbox/win/src/sandbox.h" |
21 #include "skia/ext/fontmgr_default_win.h" | 20 #include "skia/ext/fontmgr_default_win.h" |
22 #include "skia/ext/vector_platform_device_emf_win.h" | 21 #include "skia/ext/vector_platform_device_emf_win.h" |
23 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 22 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
24 #include "third_party/WebKit/public/web/win/WebFontRendering.h" | 23 #include "third_party/WebKit/public/web/win/WebFontRendering.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 80 |
82 #ifdef ENABLE_VTUNE_JIT_INTERFACE | 81 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
83 if (command_line.HasSwitch(switches::kEnableVtune)) | 82 if (command_line.HasSwitch(switches::kEnableVtune)) |
84 vTune::InitializeVtuneForV8(); | 83 vTune::InitializeVtuneForV8(); |
85 #endif | 84 #endif |
86 | 85 |
87 // Be mindful of what resources you acquire here. They can be used by | 86 // Be mindful of what resources you acquire here. They can be used by |
88 // malicious code if the renderer gets compromised. | 87 // malicious code if the renderer gets compromised. |
89 bool no_sandbox = command_line.HasSwitch(switches::kNoSandbox); | 88 bool no_sandbox = command_line.HasSwitch(switches::kNoSandbox); |
90 | 89 |
91 bool use_direct_write = ShouldUseDirectWrite(); | 90 bool use_direct_write = gfx::win::ShouldUseDirectWrite(); |
92 if (!no_sandbox) { | 91 if (!no_sandbox) { |
93 // ICU DateFormat class (used in base/time_format.cc) needs to get the | 92 // ICU DateFormat class (used in base/time_format.cc) needs to get the |
94 // Olson timezone ID by accessing the registry keys under | 93 // Olson timezone ID by accessing the registry keys under |
95 // HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. | 94 // HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. |
96 // After TimeZone::createDefault is called once here, the timezone ID is | 95 // After TimeZone::createDefault is called once here, the timezone ID is |
97 // cached and there's no more need to access the registry. If the sandbox | 96 // cached and there's no more need to access the registry. If the sandbox |
98 // is disabled, we don't have to make this dummy call. | 97 // is disabled, we don't have to make this dummy call. |
99 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); | 98 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); |
100 | 99 |
101 if (use_direct_write) { | 100 if (use_direct_write) { |
(...skipping 26 matching lines...) Expand all Loading... |
128 ::GetUserDefaultLangID(); | 127 ::GetUserDefaultLangID(); |
129 ::GetUserDefaultLCID(); | 128 ::GetUserDefaultLCID(); |
130 | 129 |
131 target_services->LowerToken(); | 130 target_services->LowerToken(); |
132 return true; | 131 return true; |
133 } | 132 } |
134 return false; | 133 return false; |
135 } | 134 } |
136 | 135 |
137 } // namespace content | 136 } // namespace content |
OLD | NEW |