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

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

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 #ifndef CONTENT_CHILD_WEB_MEMORY_DUMP_PROVIDER_ADAPTER_H_
6 #define CONTENT_CHILD_WEB_MEMORY_DUMP_PROVIDER_ADAPTER_H_
7
8 #include "base/macros.h"
9 #include "base/trace_event/memory_dump_provider.h"
10
11 namespace blink {
12 class WebMemoryDumpProvider;
13 } // namespace blink
14
15 namespace content {
16
17 // Adapter class which makes it possible to register a WebMemoryDumpProvider (
18 // from blink) to base::trace_event::MemoryDumpManager, which expects a
19 // MemoryDumpProvider instead.
20 // This is essentially proxying the OnMemoryDump from chromium base to blink.
21 class WebMemoryDumpProviderAdapter
22 : public base::trace_event::MemoryDumpProvider {
23 public:
24 explicit WebMemoryDumpProviderAdapter(blink::WebMemoryDumpProvider* wmdp);
25 ~WebMemoryDumpProviderAdapter() override;
26
27 // base::trace_event::MemoryDumpProvider implementation.
28 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
29 base::trace_event::ProcessMemoryDump* pmd) override;
30
31 void OnHeapProfilingEnabled(bool enabled) override;
32
33 bool is_registered() const { return is_registered_; }
34 void set_is_registered(bool is_registered) { is_registered_ = is_registered; }
35
36 private:
37 // The underlying WebMemoryDumpProvider instance to which the OnMemoryDump()
38 // calls will be proxied to.
39 blink::WebMemoryDumpProvider* web_memory_dump_provider_; // Not owned.
40
41 // True iff this has been registered with the MDM (and not unregistered yet).
42 bool is_registered_;
43
44 DISALLOW_COPY_AND_ASSIGN(WebMemoryDumpProviderAdapter);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_CHILD_WEB_MEMORY_DUMP_PROVIDER_ADAPTER_H_
OLDNEW
« no previous file with comments | « content/child/web_memory_allocator_dump_impl.cc ('k') | content/child/web_memory_dump_provider_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698