OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/cache_stats_recorder.h" |
| 6 |
| 7 #include "base/memory/ptr_util.h" |
| 8 #include "components/web_cache/browser/web_cache_manager.h" |
| 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 10 |
| 11 CacheStatsRecorder::CacheStatsRecorder(int render_process_id) |
| 12 : render_process_id_(render_process_id) {} |
| 13 |
| 14 CacheStatsRecorder::~CacheStatsRecorder() = default; |
| 15 |
| 16 // static |
| 17 void CacheStatsRecorder::Create( |
| 18 int render_process_id, |
| 19 chrome::mojom::CacheStatsRecorderRequest request) { |
| 20 mojo::MakeStrongBinding( |
| 21 base::MakeUnique<CacheStatsRecorder>(render_process_id), |
| 22 std::move(request)); |
| 23 } |
| 24 |
| 25 void CacheStatsRecorder::RecordCacheStats(uint64_t capacity, uint64_t size) { |
| 26 DCHECK(thread_checker_.CalledOnValidThread()); |
| 27 web_cache::WebCacheManager::GetInstance()->ObserveStats(render_process_id_, |
| 28 capacity, size); |
| 29 } |
OLD | NEW |