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

Side by Side Diff: net/disk_cache/entry_unittest.cc

Issue 623213004: replace OVERRIDE and FINAL with override and final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo unwanted change in comment Created 6 years, 2 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 | « net/disk_cache/disk_cache_test_base.h ('k') | net/disk_cache/memory/mem_backend_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/files/file.h" 8 #include "base/files/file.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 // The way a CompletionCallback works means that all tasks (even new ones) 2056 // The way a CompletionCallback works means that all tasks (even new ones)
2057 // are executed by the message loop before returning to the caller so the only 2057 // are executed by the message loop before returning to the caller so the only
2058 // way to simulate a race is to execute what we want on the callback. 2058 // way to simulate a race is to execute what we want on the callback.
2059 class SparseTestCompletionCallback: public net::TestCompletionCallback { 2059 class SparseTestCompletionCallback: public net::TestCompletionCallback {
2060 public: 2060 public:
2061 explicit SparseTestCompletionCallback(scoped_ptr<disk_cache::Backend> cache) 2061 explicit SparseTestCompletionCallback(scoped_ptr<disk_cache::Backend> cache)
2062 : cache_(cache.Pass()) { 2062 : cache_(cache.Pass()) {
2063 } 2063 }
2064 2064
2065 private: 2065 private:
2066 virtual void SetResult(int result) OVERRIDE { 2066 virtual void SetResult(int result) override {
2067 cache_.reset(); 2067 cache_.reset();
2068 TestCompletionCallback::SetResult(result); 2068 TestCompletionCallback::SetResult(result);
2069 } 2069 }
2070 2070
2071 scoped_ptr<disk_cache::Backend> cache_; 2071 scoped_ptr<disk_cache::Backend> cache_;
2072 DISALLOW_COPY_AND_ASSIGN(SparseTestCompletionCallback); 2072 DISALLOW_COPY_AND_ASSIGN(SparseTestCompletionCallback);
2073 }; 2073 };
2074 2074
2075 // Tests that we don't crash when the backend is deleted while we are working 2075 // Tests that we don't crash when the backend is deleted while we are working
2076 // deleting the sub-entries of a sparse entry. 2076 // deleting the sub-entries of a sparse entry.
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after
4058 EXPECT_EQ(kSize, callback.GetResult(ret)); 4058 EXPECT_EQ(kSize, callback.GetResult(ret));
4059 4059
4060 // Make sure the first range was removed when the second was written. 4060 // Make sure the first range was removed when the second was written.
4061 ret = entry->ReadSparseData(0, buffer.get(), kSize, callback.callback()); 4061 ret = entry->ReadSparseData(0, buffer.get(), kSize, callback.callback());
4062 EXPECT_EQ(0, callback.GetResult(ret)); 4062 EXPECT_EQ(0, callback.GetResult(ret));
4063 4063
4064 entry->Close(); 4064 entry->Close();
4065 } 4065 }
4066 4066
4067 #endif // defined(OS_POSIX) 4067 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_test_base.h ('k') | net/disk_cache/memory/mem_backend_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698