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

Unified Diff: third_party/WebKit/Source/platform/MemoryCacheDumpProvider.cpp

Issue 1999613002: Move WebCacheMemoryDumpProvider to platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix link error on win Created 4 years, 7 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
Index: third_party/WebKit/Source/platform/MemoryCacheDumpProvider.cpp
diff --git a/third_party/WebKit/Source/platform/MemoryCacheDumpProvider.cpp b/third_party/WebKit/Source/platform/MemoryCacheDumpProvider.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..21c3f1e8fb3420a9bd42a44947611432d3315472
--- /dev/null
+++ b/third_party/WebKit/Source/platform/MemoryCacheDumpProvider.cpp
@@ -0,0 +1,53 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "platform/MemoryCacheDumpProvider.h"
+
+#include "platform/web_process_memory_dump_impl.h"
+#include "public/platform/WebMemoryDumpProvider.h"
+
+namespace blink {
+
+DEFINE_TRACE(MemoryCacheDumpClient)
+{
+}
+
+MemoryCacheDumpProvider* MemoryCacheDumpProvider::instance()
+{
+ DEFINE_STATIC_LOCAL(MemoryCacheDumpProvider, instance, ());
+ return &instance;
+}
+
+bool MemoryCacheDumpProvider::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, base::trace_event::ProcessMemoryDump* memoryDump)
+{
+ DCHECK(isMainThread());
+ if (!m_client)
+ return false;
+
+ WebMemoryDumpLevelOfDetail level;
+ switch (args.level_of_detail) {
+ case base::trace_event::MemoryDumpLevelOfDetail::LIGHT:
+ level = blink::WebMemoryDumpLevelOfDetail::Light;
+ break;
+ case base::trace_event::MemoryDumpLevelOfDetail::DETAILED:
+ level = blink::WebMemoryDumpLevelOfDetail::Detailed;
+ break;
+ default:
+ NOTREACHED();
+ return false;
+ }
+
+ WebProcessMemoryDumpImpl dump(args.level_of_detail, memoryDump);
+ return m_client->onMemoryDump(level, &dump);
+}
+
+MemoryCacheDumpProvider::MemoryCacheDumpProvider()
+{
+}
+
+MemoryCacheDumpProvider::~MemoryCacheDumpProvider()
+{
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/MemoryCacheDumpProvider.h ('k') | third_party/WebKit/Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698