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

Side by Side Diff: content/child/web_memory_dump_provider_adapter.cc

Issue 1660383002: Refactoring: Move some classes from content/child to platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add PLATFORM_EXPORT; Address haraken's review Created 4 years, 10 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
OLDNEW
(Empty)
1 // Copyright 2015 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 "content/child/web_memory_dump_provider_adapter.h"
6
7 #include <stddef.h>
8
9 #include "base/trace_event/trace_event_argument.h"
10 #include "content/child/web_process_memory_dump_impl.h"
11 #include "third_party/WebKit/public/platform/WebMemoryDumpProvider.h"
12
13 namespace content {
14
15 WebMemoryDumpProviderAdapter::WebMemoryDumpProviderAdapter(
16 blink::WebMemoryDumpProvider* wmdp)
17 : web_memory_dump_provider_(wmdp), is_registered_(false) {
18 }
19
20 WebMemoryDumpProviderAdapter::~WebMemoryDumpProviderAdapter() {
21 DCHECK(!is_registered_);
22 }
23
24 bool WebMemoryDumpProviderAdapter::OnMemoryDump(
25 const base::trace_event::MemoryDumpArgs& args,
26 base::trace_event::ProcessMemoryDump* pmd) {
27 blink::WebMemoryDumpLevelOfDetail level;
28 switch (args.level_of_detail) {
29 case base::trace_event::MemoryDumpLevelOfDetail::LIGHT:
30 level = blink::WebMemoryDumpLevelOfDetail::Light;
31 break;
32 case base::trace_event::MemoryDumpLevelOfDetail::DETAILED:
33 level = blink::WebMemoryDumpLevelOfDetail::Detailed;
34 break;
35 default:
36 NOTREACHED();
37 return false;
38 }
39 WebProcessMemoryDumpImpl web_pmd_impl(args.level_of_detail, pmd);
40 return web_memory_dump_provider_->onMemoryDump(level, &web_pmd_impl);
41 }
42
43 void WebMemoryDumpProviderAdapter::OnHeapProfilingEnabled(bool enabled) {
44 if (!web_memory_dump_provider_->supportsHeapProfiling())
45 return;
46 web_memory_dump_provider_->onHeapProfilingEnabled(enabled);
47 }
48
49 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_memory_dump_provider_adapter.h ('k') | content/child/web_process_memory_dump_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698