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/render_process_impl.h" | 5 #include "content/renderer/render_process_impl.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
11 #include <objidl.h> | 11 #include <objidl.h> |
12 #include <mlang.h> | 12 #include <mlang.h> |
13 #endif | 13 #endif |
14 | 14 |
15 #include <stddef.h> | 15 #include <stddef.h> |
16 | 16 |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "base/bind.h" | 19 #include "base/bind.h" |
20 #include "base/command_line.h" | 20 #include "base/command_line.h" |
21 #include "base/compiler_specific.h" | 21 #include "base/compiler_specific.h" |
22 #include "base/debug/crash_logging.h" | |
22 #include "base/feature_list.h" | 23 #include "base/feature_list.h" |
23 #include "base/sys_info.h" | 24 #include "base/sys_info.h" |
24 #include "base/task_scheduler/initialization_util.h" | 25 #include "base/task_scheduler/initialization_util.h" |
25 #include "base/task_scheduler/scheduler_worker_pool_params.h" | 26 #include "base/task_scheduler/scheduler_worker_pool_params.h" |
26 #include "base/task_scheduler/task_scheduler.h" | 27 #include "base/task_scheduler/task_scheduler.h" |
27 #include "base/task_scheduler/task_traits.h" | 28 #include "base/task_scheduler/task_traits.h" |
28 #include "base/threading/platform_thread.h" | 29 #include "base/threading/platform_thread.h" |
29 #include "base/time/time.h" | 30 #include "base/time/time.h" |
30 #include "content/child/site_isolation_stats_gatherer.h" | 31 #include "content/child/site_isolation_stats_gatherer.h" |
31 #include "content/public/common/content_client.h" | 32 #include "content/public/common/content_client.h" |
32 #include "content/public/common/content_features.h" | 33 #include "content/public/common/content_features.h" |
33 #include "content/public/common/content_switches.h" | 34 #include "content/public/common/content_switches.h" |
34 #include "content/public/renderer/content_renderer_client.h" | 35 #include "content/public/renderer/content_renderer_client.h" |
35 #include "third_party/WebKit/public/web/WebFrame.h" | 36 #include "third_party/WebKit/public/web/WebFrame.h" |
36 #include "v8/include/v8.h" | 37 #include "v8/include/v8.h" |
37 | 38 |
39 #if defined(OS_WIN) | |
40 #include "base/win/win_util.h" | |
41 #endif | |
42 | |
38 namespace { | 43 namespace { |
39 | 44 |
40 enum WorkerPoolType : size_t { | 45 enum WorkerPoolType : size_t { |
41 BACKGROUND = 0, | 46 BACKGROUND = 0, |
42 BACKGROUND_FILE_IO, | 47 BACKGROUND_FILE_IO, |
43 FOREGROUND, | 48 FOREGROUND, |
44 FOREGROUND_FILE_IO, | 49 FOREGROUND_FILE_IO, |
45 WORKER_POOL_COUNT // Always last. | 50 WORKER_POOL_COUNT // Always last. |
46 }; | 51 }; |
47 | 52 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 params_vector, index_to_traits_callback); | 153 params_vector, index_to_traits_callback); |
149 } | 154 } |
150 | 155 |
151 } // namespace | 156 } // namespace |
152 | 157 |
153 namespace content { | 158 namespace content { |
154 | 159 |
155 RenderProcessImpl::RenderProcessImpl() | 160 RenderProcessImpl::RenderProcessImpl() |
156 : enabled_bindings_(0) { | 161 : enabled_bindings_(0) { |
157 #if defined(OS_WIN) | 162 #if defined(OS_WIN) |
163 // Record whether the machine is domain joined in a crash key. This will be | |
164 // used to better identify whether crashes are from enterprise users. | |
165 // Note that this is done very early on so that crashes have the highest | |
166 // chance of getting tagged. | |
167 base::debug::SetCrashKeyValue("enrolled-to-domain", | |
168 base::win::IsEnrolledToDomain() ? "yes" : "no"); | |
nasko
2017/01/09 23:12:35
Shouldn't this be logged only once per Chrome inst
| |
169 | |
158 // HACK: See http://b/issue?id=1024307 for rationale. | 170 // HACK: See http://b/issue?id=1024307 for rationale. |
159 if (GetModuleHandle(L"LPK.DLL") == NULL) { | 171 if (GetModuleHandle(L"LPK.DLL") == NULL) { |
160 // Makes sure lpk.dll is loaded by gdi32 to make sure ExtTextOut() works | 172 // Makes sure lpk.dll is loaded by gdi32 to make sure ExtTextOut() works |
161 // when buffering into a EMF buffer for printing. | 173 // when buffering into a EMF buffer for printing. |
162 typedef BOOL (__stdcall *GdiInitializeLanguagePack)(int LoadedShapingDLLs); | 174 typedef BOOL (__stdcall *GdiInitializeLanguagePack)(int LoadedShapingDLLs); |
163 GdiInitializeLanguagePack gdi_init_lpk = | 175 GdiInitializeLanguagePack gdi_init_lpk = |
164 reinterpret_cast<GdiInitializeLanguagePack>(GetProcAddress( | 176 reinterpret_cast<GdiInitializeLanguagePack>(GetProcAddress( |
165 GetModuleHandle(L"GDI32.DLL"), | 177 GetModuleHandle(L"GDI32.DLL"), |
166 "GdiInitializeLanguagePack")); | 178 "GdiInitializeLanguagePack")); |
167 DCHECK(gdi_init_lpk); | 179 DCHECK(gdi_init_lpk); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 | 235 |
224 void RenderProcessImpl::AddBindings(int bindings) { | 236 void RenderProcessImpl::AddBindings(int bindings) { |
225 enabled_bindings_ |= bindings; | 237 enabled_bindings_ |= bindings; |
226 } | 238 } |
227 | 239 |
228 int RenderProcessImpl::GetEnabledBindings() const { | 240 int RenderProcessImpl::GetEnabledBindings() const { |
229 return enabled_bindings_; | 241 return enabled_bindings_; |
230 } | 242 } |
231 | 243 |
232 } // namespace content | 244 } // namespace content |
OLD | NEW |