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/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
15 #include "content/public/common/injection_test_win.h" | 15 #include "content/public/common/injection_test_win.h" |
16 #include "content/public/renderer/render_font_warmup_win.h" | 16 #include "content/public/renderer/render_font_warmup_win.h" |
17 #include "content/public/renderer/render_thread.h" | 17 #include "content/public/renderer/render_thread.h" |
18 #include "content/renderer/render_thread_impl.h" | 18 #include "content/renderer/render_thread_impl.h" |
19 #include "sandbox/win/src/sandbox.h" | 19 #include "sandbox/win/src/sandbox.h" |
20 #include "skia/ext/fontmgr_default_win.h" | 20 #include "skia/ext/fontmgr_default_win.h" |
21 #include "skia/ext/vector_platform_device_emf_win.h" | 21 #include "skia/ext/vector_platform_device_emf_win.h" |
22 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 22 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
23 #include "third_party/WebKit/public/web/win/WebFontRendering.h" | 23 #include "third_party/WebKit/public/web/win/WebFontRendering.h" |
24 #include "third_party/icu/source/i18n/unicode/timezone.h" | 24 #include "third_party/icu/source/i18n/unicode/timezone.h" |
25 #include "third_party/skia/include/ports/SkFontMgr.h" | 25 #include "third_party/skia/include/ports/SkFontMgr.h" |
26 #include "third_party/skia/include/ports/SkTypeface_win.h" | 26 #include "third_party/skia/include/ports/SkTypeface_win.h" |
27 #include "ui/gfx/win/direct_write.h" | 27 #include "ui/gfx/win/direct_write.h" |
28 #include "ui/gfx/win/dpi.h" | 28 #include "ui/gfx/win/dpi.h" |
29 | 29 |
30 #ifdef ENABLE_VTUNE_JIT_INTERFACE | |
31 #include "v8/src/third_party/vtune/v8-vtune.h" | |
32 #endif | |
33 | |
34 #include <dwrite.h> | 30 #include <dwrite.h> |
35 | 31 |
36 namespace content { | 32 namespace content { |
37 namespace { | 33 namespace { |
38 | 34 |
39 // Windows-only skia sandbox support | 35 // Windows-only skia sandbox support |
40 // These are used for GDI-path rendering. | 36 // These are used for GDI-path rendering. |
41 void SkiaPreCacheFont(const LOGFONT& logfont) { | 37 void SkiaPreCacheFont(const LOGFONT& logfont) { |
42 RenderThread* render_thread = RenderThread::Get(); | 38 RenderThread* render_thread = RenderThread::Get(); |
43 if (render_thread) { | 39 if (render_thread) { |
(...skipping 28 matching lines...) Expand all Loading... |
72 : parameters_(parameters), | 68 : parameters_(parameters), |
73 sandbox_test_module_(NULL) { | 69 sandbox_test_module_(NULL) { |
74 } | 70 } |
75 | 71 |
76 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { | 72 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { |
77 } | 73 } |
78 | 74 |
79 void RendererMainPlatformDelegate::PlatformInitialize() { | 75 void RendererMainPlatformDelegate::PlatformInitialize() { |
80 const CommandLine& command_line = parameters_.command_line; | 76 const CommandLine& command_line = parameters_.command_line; |
81 | 77 |
82 #ifdef ENABLE_VTUNE_JIT_INTERFACE | |
83 if (command_line.HasSwitch(switches::kEnableVtune)) | |
84 vTune::InitializeVtuneForV8(); | |
85 #endif | |
86 | |
87 // Be mindful of what resources you acquire here. They can be used by | 78 // Be mindful of what resources you acquire here. They can be used by |
88 // malicious code if the renderer gets compromised. | 79 // malicious code if the renderer gets compromised. |
89 bool no_sandbox = command_line.HasSwitch(switches::kNoSandbox); | 80 bool no_sandbox = command_line.HasSwitch(switches::kNoSandbox); |
90 | 81 |
91 bool use_direct_write = gfx::win::ShouldUseDirectWrite(); | 82 bool use_direct_write = gfx::win::ShouldUseDirectWrite(); |
92 if (!no_sandbox) { | 83 if (!no_sandbox) { |
93 // ICU DateFormat class (used in base/time_format.cc) needs to get the | 84 // ICU DateFormat class (used in base/time_format.cc) needs to get the |
94 // Olson timezone ID by accessing the registry keys under | 85 // Olson timezone ID by accessing the registry keys under |
95 // HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. | 86 // HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. |
96 // After TimeZone::createDefault is called once here, the timezone ID is | 87 // After TimeZone::createDefault is called once here, the timezone ID is |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 ::GetUserDefaultLangID(); | 119 ::GetUserDefaultLangID(); |
129 ::GetUserDefaultLCID(); | 120 ::GetUserDefaultLCID(); |
130 | 121 |
131 target_services->LowerToken(); | 122 target_services->LowerToken(); |
132 return true; | 123 return true; |
133 } | 124 } |
134 return false; | 125 return false; |
135 } | 126 } |
136 | 127 |
137 } // namespace content | 128 } // namespace content |
OLD | NEW |