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

Side by Side Diff: mojo/services/html_viewer/discardable_memory_allocator_unittest.cc

Issue 1094433002: base: Rename DiscardableMemory::Memory() to ::data(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mojo unittest Created 5 years, 8 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 "mojo/services/html_viewer/discardable_memory_allocator.h" 5 #include "mojo/services/html_viewer/discardable_memory_allocator.h"
6 6
7 #include "base/memory/discardable_memory.h" 7 #include "base/memory/discardable_memory.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace html_viewer { 10 namespace html_viewer {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 DiscardableMemoryAllocator allocator(kOneMegabyte); 56 DiscardableMemoryAllocator allocator(kOneMegabyte);
57 57
58 scoped_ptr<base::DiscardableMemory> chunk_one = 58 scoped_ptr<base::DiscardableMemory> chunk_one =
59 allocator.AllocateLockedDiscardableMemory(kAlmostOneMegabyte); 59 allocator.AllocateLockedDiscardableMemory(kAlmostOneMegabyte);
60 scoped_ptr<base::DiscardableMemory> chunk_two = 60 scoped_ptr<base::DiscardableMemory> chunk_two =
61 allocator.AllocateLockedDiscardableMemory(kAlmostOneMegabyte); 61 allocator.AllocateLockedDiscardableMemory(kAlmostOneMegabyte);
62 scoped_ptr<base::DiscardableMemory> chunk_three = 62 scoped_ptr<base::DiscardableMemory> chunk_three =
63 allocator.AllocateLockedDiscardableMemory(kAlmostOneMegabyte); 63 allocator.AllocateLockedDiscardableMemory(kAlmostOneMegabyte);
64 64
65 // These accesses will fail if the underlying weak ptr has been deallocated. 65 // These accesses will fail if the underlying weak ptr has been deallocated.
66 EXPECT_NE(nullptr, chunk_one->Memory()); 66 EXPECT_NE(nullptr, chunk_one->data());
67 EXPECT_NE(nullptr, chunk_two->Memory()); 67 EXPECT_NE(nullptr, chunk_two->data());
68 EXPECT_NE(nullptr, chunk_three->Memory()); 68 EXPECT_NE(nullptr, chunk_three->data());
69 69
70 chunk_one->Unlock(); 70 chunk_one->Unlock();
71 chunk_two->Unlock(); 71 chunk_two->Unlock();
72 chunk_three->Unlock(); 72 chunk_three->Unlock();
73 } 73 }
74 74
75 } // namespace 75 } // namespace
76 } // namespace html_viewer 76 } // namespace html_viewer
OLDNEW
« no previous file with comments | « mojo/services/html_viewer/discardable_memory_allocator.cc ('k') | skia/ext/SkDiscardableMemory_chrome.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698