OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/child/web_discardable_memory_impl.h" | 5 #include "content/child/web_discardable_memory_impl.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/memory/discardable_memory.h" | 9 #include "base/memory/discardable_memory.h" |
8 #include "base/memory/discardable_memory_allocator.h" | 10 #include "base/memory/discardable_memory_allocator.h" |
9 #include "content/child/web_process_memory_dump_impl.h" | 11 #include "content/child/web_process_memory_dump_impl.h" |
10 #include "third_party/WebKit/public/platform/WebString.h" | 12 #include "third_party/WebKit/public/platform/WebString.h" |
11 | 13 |
12 namespace content { | 14 namespace content { |
13 | 15 |
14 WebDiscardableMemoryImpl::~WebDiscardableMemoryImpl() {} | 16 WebDiscardableMemoryImpl::~WebDiscardableMemoryImpl() {} |
15 | 17 |
16 // static | 18 // static |
(...skipping 19 matching lines...) Expand all Loading... |
36 blink::WebMemoryAllocatorDump* | 38 blink::WebMemoryAllocatorDump* |
37 WebDiscardableMemoryImpl::createMemoryAllocatorDump( | 39 WebDiscardableMemoryImpl::createMemoryAllocatorDump( |
38 const blink::WebString& name, | 40 const blink::WebString& name, |
39 blink::WebProcessMemoryDump* wpmd) const { | 41 blink::WebProcessMemoryDump* wpmd) const { |
40 return static_cast<content::WebProcessMemoryDumpImpl*>(wpmd) | 42 return static_cast<content::WebProcessMemoryDumpImpl*>(wpmd) |
41 ->CreateDiscardableMemoryAllocatorDump(name.utf8(), discardable_.get()); | 43 ->CreateDiscardableMemoryAllocatorDump(name.utf8(), discardable_.get()); |
42 } | 44 } |
43 | 45 |
44 WebDiscardableMemoryImpl::WebDiscardableMemoryImpl( | 46 WebDiscardableMemoryImpl::WebDiscardableMemoryImpl( |
45 scoped_ptr<base::DiscardableMemory> memory) | 47 scoped_ptr<base::DiscardableMemory> memory) |
46 : discardable_(memory.Pass()) { | 48 : discardable_(std::move(memory)) {} |
47 } | |
48 | 49 |
49 } // namespace content | 50 } // namespace content |
OLD | NEW |