| 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 <limits> | 7 #include <limits> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/allocator/allocator_extension.h" | 10 #include "base/allocator/allocator_extension.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 base::FieldTrial* trial = | 281 base::FieldTrial* trial = |
| 282 base::FieldTrialList::CreateFieldTrial(field_trial_name, group_name); | 282 base::FieldTrialList::CreateFieldTrial(field_trial_name, group_name); |
| 283 // Ensure the trial is marked as "used" by calling group() on it. This is | 283 // Ensure the trial is marked as "used" by calling group() on it. This is |
| 284 // needed to ensure the trial is properly reported in renderer crash reports. | 284 // needed to ensure the trial is properly reported in renderer crash reports. |
| 285 trial->group(); | 285 trial->group(); |
| 286 chrome_variations::SetChildProcessLoggingVariationList(); | 286 chrome_variations::SetChildProcessLoggingVariationList(); |
| 287 } | 287 } |
| 288 | 288 |
| 289 void ChromeRenderProcessObserver::OnGetV8HeapStats() { | 289 void ChromeRenderProcessObserver::OnGetV8HeapStats() { |
| 290 v8::HeapStatistics heap_stats; | 290 v8::HeapStatistics heap_stats; |
| 291 v8::V8::GetHeapStatistics(&heap_stats); | 291 // TODO(svenpanne) The call below doesn't take web workers into account, this |
| 292 // has to be done manually by iterating over all Isolates involved. |
| 293 v8::Isolate::GetCurrent()->GetHeapStatistics(&heap_stats); |
| 292 RenderThread::Get()->Send(new ChromeViewHostMsg_V8HeapStats( | 294 RenderThread::Get()->Send(new ChromeViewHostMsg_V8HeapStats( |
| 293 heap_stats.total_heap_size(), heap_stats.used_heap_size())); | 295 heap_stats.total_heap_size(), heap_stats.used_heap_size())); |
| 294 } | 296 } |
| 295 | 297 |
| 296 void ChromeRenderProcessObserver::OnToggleWebKitSharedTimer(bool suspend) { | 298 void ChromeRenderProcessObserver::OnToggleWebKitSharedTimer(bool suspend) { |
| 297 RenderThread::Get()->ToggleWebKitSharedTimer(suspend); | 299 RenderThread::Get()->ToggleWebKitSharedTimer(suspend); |
| 298 } | 300 } |
| 299 | 301 |
| 300 void ChromeRenderProcessObserver::OnPurgeMemory() { | 302 void ChromeRenderProcessObserver::OnPurgeMemory() { |
| 301 RenderThread::Get()->EnsureWebKitInitialized(); | 303 RenderThread::Get()->EnsureWebKitInitialized(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 328 if (clear_cache_pending_) { | 330 if (clear_cache_pending_) { |
| 329 clear_cache_pending_ = false; | 331 clear_cache_pending_ = false; |
| 330 WebCache::clear(); | 332 WebCache::clear(); |
| 331 } | 333 } |
| 332 } | 334 } |
| 333 | 335 |
| 334 const RendererContentSettingRules* | 336 const RendererContentSettingRules* |
| 335 ChromeRenderProcessObserver::content_setting_rules() const { | 337 ChromeRenderProcessObserver::content_setting_rules() const { |
| 336 return &content_setting_rules_; | 338 return &content_setting_rules_; |
| 337 } | 339 } |
| OLD | NEW |