| 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_thread_observer.h" | 5 #include "chrome/renderer/chrome_render_thread_observer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 #else | 105 #else |
| 106 return current_peer; | 106 return current_peer; |
| 107 #endif | 107 #endif |
| 108 } | 108 } |
| 109 | 109 |
| 110 private: | 110 private: |
| 111 void InformHostOfCacheStats() { | 111 void InformHostOfCacheStats() { |
| 112 WebCache::UsageStats stats; | 112 WebCache::UsageStats stats; |
| 113 WebCache::getUsageStats(&stats); | 113 WebCache::getUsageStats(&stats); |
| 114 RenderThread::Get()->Send(new ChromeViewHostMsg_UpdatedCacheStats( | 114 RenderThread::Get()->Send(new ChromeViewHostMsg_UpdatedCacheStats( |
| 115 static_cast<uint64_t>(stats.minDeadCapacity), | |
| 116 static_cast<uint64_t>(stats.maxDeadCapacity), | |
| 117 static_cast<uint64_t>(stats.capacity), | 115 static_cast<uint64_t>(stats.capacity), |
| 118 static_cast<uint64_t>(stats.liveSize), | 116 static_cast<uint64_t>(stats.size))); |
| 119 static_cast<uint64_t>(stats.deadSize))); | |
| 120 } | 117 } |
| 121 | 118 |
| 122 base::WeakPtrFactory<RendererResourceDelegate> weak_factory_; | 119 base::WeakPtrFactory<RendererResourceDelegate> weak_factory_; |
| 123 | 120 |
| 124 DISALLOW_COPY_AND_ASSIGN(RendererResourceDelegate); | 121 DISALLOW_COPY_AND_ASSIGN(RendererResourceDelegate); |
| 125 }; | 122 }; |
| 126 | 123 |
| 127 static const int kWaitForWorkersStatsTimeoutMS = 20; | 124 static const int kWaitForWorkersStatsTimeoutMS = 20; |
| 128 | 125 |
| 129 class ResourceUsageReporterImpl : public mojom::ResourceUsageReporter { | 126 class ResourceUsageReporterImpl : public mojom::ResourceUsageReporter { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( | 306 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( |
| 310 const std::string& trial_name, | 307 const std::string& trial_name, |
| 311 const std::string& group_name) { | 308 const std::string& group_name) { |
| 312 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); | 309 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); |
| 313 } | 310 } |
| 314 | 311 |
| 315 const RendererContentSettingRules* | 312 const RendererContentSettingRules* |
| 316 ChromeRenderThreadObserver::content_setting_rules() const { | 313 ChromeRenderThreadObserver::content_setting_rules() const { |
| 317 return &content_setting_rules_; | 314 return &content_setting_rules_; |
| 318 } | 315 } |
| OLD | NEW |