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 "chrome/renderer/chrome_render_process_observer.h" | 5 #include "chrome/renderer/chrome_render_process_observer.h" |
6 | 6 |
7 #include "base/allocator/allocator_extension.h" | 7 #include "base/allocator/allocator_extension.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/metrics/statistics_recorder.h" | 15 #include "base/metrics/statistics_recorder.h" |
16 #include "base/native_library.h" | 16 #include "base/native_library.h" |
17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
18 #include "base/process_util.h" | 18 #include "base/process_util.h" |
19 #include "base/threading/platform_thread.h" | 19 #include "base/threading/platform_thread.h" |
20 #include "chrome/common/child_process_logging.h" | 20 #include "chrome/common/child_process_logging.h" |
21 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
22 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
23 #include "chrome/common/extensions/extension_localization_peer.h" | 23 #include "chrome/common/extensions/extension_localization_peer.h" |
24 #include "chrome/common/metrics/experiments_helper.h" | 24 #include "chrome/common/metrics/variations_util.h" |
25 #include "chrome/common/net/net_resource_provider.h" | 25 #include "chrome/common/net/net_resource_provider.h" |
26 #include "chrome/common/render_messages.h" | 26 #include "chrome/common/render_messages.h" |
27 #include "chrome/renderer/chrome_content_renderer_client.h" | 27 #include "chrome/renderer/chrome_content_renderer_client.h" |
28 #include "chrome/renderer/content_settings_observer.h" | 28 #include "chrome/renderer/content_settings_observer.h" |
29 #include "chrome/renderer/security_filter_peer.h" | 29 #include "chrome/renderer/security_filter_peer.h" |
30 #include "content/public/common/resource_dispatcher_delegate.h" | 30 #include "content/public/common/resource_dispatcher_delegate.h" |
31 #include "content/public/renderer/render_thread.h" | 31 #include "content/public/renderer/render_thread.h" |
32 #include "content/public/renderer/render_view_visitor.h" | 32 #include "content/public/renderer/render_view_visitor.h" |
33 #include "content/public/renderer/render_view.h" | 33 #include "content/public/renderer/render_view.h" |
34 #include "crypto/nss_util.h" | 34 #include "crypto/nss_util.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 crypto::ForceNSSNoDBInit(); | 199 crypto::ForceNSSNoDBInit(); |
200 crypto::EnsureNSSInit(); | 200 crypto::EnsureNSSInit(); |
201 } | 201 } |
202 #elif defined(OS_WIN) | 202 #elif defined(OS_WIN) |
203 // crypt32.dll is used to decode X509 certificates for Chromoting. | 203 // crypt32.dll is used to decode X509 certificates for Chromoting. |
204 // Only load this library when the feature is enabled. | 204 // Only load this library when the feature is enabled. |
205 std::string error; | 205 std::string error; |
206 base::LoadNativeLibrary(FilePath(L"crypt32.dll"), &error); | 206 base::LoadNativeLibrary(FilePath(L"crypt32.dll"), &error); |
207 #endif | 207 #endif |
208 // Setup initial set of crash dump data for Field Trials in this renderer. | 208 // Setup initial set of crash dump data for Field Trials in this renderer. |
209 experiments_helper::SetChildProcessLoggingExperimentList(); | 209 chrome_variations::SetChildProcessLoggingVariationList(); |
210 } | 210 } |
211 | 211 |
212 ChromeRenderProcessObserver::~ChromeRenderProcessObserver() { | 212 ChromeRenderProcessObserver::~ChromeRenderProcessObserver() { |
213 } | 213 } |
214 | 214 |
215 bool ChromeRenderProcessObserver::OnControlMessageReceived( | 215 bool ChromeRenderProcessObserver::OnControlMessageReceived( |
216 const IPC::Message& message) { | 216 const IPC::Message& message) { |
217 bool handled = true; | 217 bool handled = true; |
218 IPC_BEGIN_MESSAGE_MAP(ChromeRenderProcessObserver, message) | 218 IPC_BEGIN_MESSAGE_MAP(ChromeRenderProcessObserver, message) |
219 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsIncognitoProcess, | 219 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsIncognitoProcess, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 new ChromeViewHostMsg_WriteTcmallocHeapProfile_ACK(filename, result)); | 305 new ChromeViewHostMsg_WriteTcmallocHeapProfile_ACK(filename, result)); |
306 #endif | 306 #endif |
307 } | 307 } |
308 | 308 |
309 #endif | 309 #endif |
310 | 310 |
311 void ChromeRenderProcessObserver::OnSetFieldTrialGroup( | 311 void ChromeRenderProcessObserver::OnSetFieldTrialGroup( |
312 const std::string& field_trial_name, | 312 const std::string& field_trial_name, |
313 const std::string& group_name) { | 313 const std::string& group_name) { |
314 base::FieldTrialList::CreateFieldTrial(field_trial_name, group_name); | 314 base::FieldTrialList::CreateFieldTrial(field_trial_name, group_name); |
315 experiments_helper::SetChildProcessLoggingExperimentList(); | 315 chrome_variations::SetChildProcessLoggingVariationList(); |
316 } | 316 } |
317 | 317 |
318 void ChromeRenderProcessObserver::OnGetV8HeapStats() { | 318 void ChromeRenderProcessObserver::OnGetV8HeapStats() { |
319 v8::HeapStatistics heap_stats; | 319 v8::HeapStatistics heap_stats; |
320 v8::V8::GetHeapStatistics(&heap_stats); | 320 v8::V8::GetHeapStatistics(&heap_stats); |
321 RenderThread::Get()->Send(new ChromeViewHostMsg_V8HeapStats( | 321 RenderThread::Get()->Send(new ChromeViewHostMsg_V8HeapStats( |
322 heap_stats.total_heap_size(), heap_stats.used_heap_size())); | 322 heap_stats.total_heap_size(), heap_stats.used_heap_size())); |
323 } | 323 } |
324 | 324 |
325 void ChromeRenderProcessObserver::OnToggleWebKitSharedTimer(bool suspend) { | 325 void ChromeRenderProcessObserver::OnToggleWebKitSharedTimer(bool suspend) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 if (clear_cache_pending_) { | 357 if (clear_cache_pending_) { |
358 clear_cache_pending_ = false; | 358 clear_cache_pending_ = false; |
359 WebCache::clear(); | 359 WebCache::clear(); |
360 } | 360 } |
361 } | 361 } |
362 | 362 |
363 const RendererContentSettingRules* | 363 const RendererContentSettingRules* |
364 ChromeRenderProcessObserver::content_setting_rules() const { | 364 ChromeRenderProcessObserver::content_setting_rules() const { |
365 return &content_setting_rules_; | 365 return &content_setting_rules_; |
366 } | 366 } |
OLD | NEW |