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

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

Issue 1394183003: [tracing] Remove memory-infra plumbing classes for blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink_noglue
Patch Set: Created 5 years, 2 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 "content/child/web_process_memory_dump_impl.h"
8 #include "third_party/WebKit/public/platform/WebMemoryDumpProvider.h"
9
10 namespace content {
11
12 WebMemoryDumpProviderAdapter::WebMemoryDumpProviderAdapter(
13 blink::WebMemoryDumpProvider* wmdp)
14 : web_memory_dump_provider_(wmdp), is_registered_(false) {
15 }
16
17 WebMemoryDumpProviderAdapter::~WebMemoryDumpProviderAdapter() {
18 DCHECK(!is_registered_);
19 }
20
21 bool WebMemoryDumpProviderAdapter::OnMemoryDump(
22 const base::trace_event::MemoryDumpArgs& args,
23 base::trace_event::ProcessMemoryDump* pmd) {
24 blink::WebMemoryDumpLevelOfDetail level;
25 switch (args.level_of_detail) {
26 case base::trace_event::MemoryDumpLevelOfDetail::LIGHT:
27 level = blink::WebMemoryDumpLevelOfDetail::Light;
28 break;
29 case base::trace_event::MemoryDumpLevelOfDetail::DETAILED:
30 level = blink::WebMemoryDumpLevelOfDetail::Detailed;
31 break;
32 default:
33 NOTREACHED();
34 return false;
35 }
36 WebProcessMemoryDumpImpl web_pmd_impl(args.level_of_detail, pmd);
37
38 return web_memory_dump_provider_->onMemoryDump(level, &web_pmd_impl);
39 }
40
41 } // 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