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

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

Issue 1787973002: Replace blink::WebDiscardableMemory with base::DiscardableMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use StringPiece::as_string Created 4 years, 9 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
« no previous file with comments | « content/child/blink_platform_impl.cc ('k') | content/child/web_discardable_memory_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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_DISCARDABLE_MEMORY_IMPL_H_
6 #define CONTENT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_
7
8 #include <stddef.h>
9
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "third_party/WebKit/public/platform/WebDiscardableMemory.h"
13
14 namespace base {
15 class DiscardableMemory;
16 }
17
18 namespace content {
19
20 // Implementation of WebDiscardableMemory that is responsible for allocating
21 // discardable memory.
22 class WebDiscardableMemoryImpl : public blink::WebDiscardableMemory {
23 public:
24 ~WebDiscardableMemoryImpl() override;
25
26 static scoped_ptr<WebDiscardableMemoryImpl> CreateLockedMemory(size_t size);
27
28 // blink::WebDiscardableMemory:
29 bool lock() override;
30 void unlock() override;
31 void* data() override;
32 blink::WebMemoryAllocatorDump* createMemoryAllocatorDump(
33 const blink::WebString& name,
34 blink::WebProcessMemoryDump* wpmd) const override;
35
36 private:
37 WebDiscardableMemoryImpl(scoped_ptr<base::DiscardableMemory> memory);
38
39 scoped_ptr<base::DiscardableMemory> discardable_;
40
41 DISALLOW_COPY_AND_ASSIGN(WebDiscardableMemoryImpl);
42 };
43
44 } // namespace content
45
46 #endif // CONTENT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.cc ('k') | content/child/web_discardable_memory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698