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

Unified Diff: chrome/renderer/chrome_render_thread_observer.cc

Issue 2643183002: Convert ChromeViewHostMsg_UpdatedCacheStats to use mojo. (Closed)
Patch Set: Convert ChromeViewHostMsg_UpdatedCacheStats to use mojo. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/render_messages.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_render_thread_observer.cc
diff --git a/chrome/renderer/chrome_render_thread_observer.cc b/chrome/renderer/chrome_render_thread_observer.cc
index 043975d22cbed79c2fdd8907c5bf212afdbfe0f9..3adff399b78885b6750c10fe61c611450840be1e 100644
--- a/chrome/renderer/chrome_render_thread_observer.cc
+++ b/chrome/renderer/chrome_render_thread_observer.cc
@@ -27,6 +27,7 @@
#include "base/threading/platform_thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
+#include "chrome/common/cache_stats_recorder.mojom.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/media/media_resource_provider.h"
@@ -49,6 +50,7 @@
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/render_view_visitor.h"
#include "extensions/features/features.h"
+#include "ipc/ipc_sync_channel.h"
#include "media/base/localized_strings.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "net/base/net_errors.h"
@@ -119,11 +121,15 @@ class RendererResourceDelegate : public content::ResourceDispatcherDelegate {
void InformHostOfCacheStats() {
WebCache::UsageStats stats;
WebCache::GetUsageStats(&stats);
- RenderThread::Get()->Send(new ChromeViewHostMsg_UpdatedCacheStats(
- static_cast<uint64_t>(stats.capacity),
- static_cast<uint64_t>(stats.size)));
+ if (!cache_stats_recorder_) {
+ RenderThread::Get()->GetChannel()->GetRemoteAssociatedInterface(
+ &cache_stats_recorder_);
+ }
+ cache_stats_recorder_->RecordCacheStats(stats.capacity, stats.size);
}
+ chrome::mojom::CacheStatsRecorderAssociatedPtr cache_stats_recorder_;
+
base::WeakPtrFactory<RendererResourceDelegate> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RendererResourceDelegate);
« no previous file with comments | « chrome/common/render_messages.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698