cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / content / child / web_memory_dump_provider_adapter.cc
blob7260803bdf366838c29d59af59ec2c2c9f2307b4
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.
5 #include "content/child/web_memory_dump_provider_adapter.h"
7 #include "content/child/web_process_memory_dump_impl.h"
8 #include "third_party/WebKit/public/platform/WebMemoryDumpProvider.h"
10 namespace content {
12 WebMemoryDumpProviderAdapter::WebMemoryDumpProviderAdapter(
13 blink::WebMemoryDumpProvider* wmdp)
14 : web_memory_dump_provider_(wmdp), is_registered_(false) {
17 WebMemoryDumpProviderAdapter::~WebMemoryDumpProviderAdapter() {
18 DCHECK(!is_registered_);
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::MemoryDumpArgs::LevelOfDetail::LOW:
27 level = blink::WebMemoryDumpLevelOfDetail::Low;
28 break;
29 case base::trace_event::MemoryDumpArgs::LevelOfDetail::HIGH:
30 level = blink::WebMemoryDumpLevelOfDetail::High;
31 break;
32 default:
33 NOTREACHED();
34 return false;
36 WebProcessMemoryDumpImpl web_pmd_impl(pmd);
38 return web_memory_dump_provider_->onMemoryDump(level, &web_pmd_impl);
41 } // namespace content