Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: chrome/browser/cache_stats_recorder.cc

Issue 2643183002: Convert ChromeViewHostMsg_UpdatedCacheStats to use mojo. (Closed)
Patch Set: Convert ChromeViewHostMsg_UpdatedCacheStats to use mojo. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/cache_stats_recorder.h ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_associated_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::CacheStatsRecorderAssociatedRequest request) {
20 mojo::MakeStrongAssociatedBinding(
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 // XXX(nigeltao): do we have to do this on the UI thread??
28 web_cache::WebCacheManager::GetInstance()->ObserveStats(render_process_id_,
Ken Rockot(use gerrit already) 2017/03/13 17:19:58 IIUC this is clearly already happening on the IO t
29 capacity, size);
30 }
OLDNEW
« no previous file with comments | « chrome/browser/cache_stats_recorder.h ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698