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

Side by Side Diff: net/disk_cache/disk_cache_test_util.h

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 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/blockfile/backend_worker_v3.cc ('k') | net/disk_cache/simple/simple_index.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 #ifndef NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ 5 #ifndef NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
6 #define NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ 6 #define NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Sets the number of callbacks that can be received so far. 57 // Sets the number of callbacks that can be received so far.
58 void ExpectCallbacks(int num_callbacks) { 58 void ExpectCallbacks(int num_callbacks) {
59 num_callbacks_ = num_callbacks; 59 num_callbacks_ = num_callbacks;
60 num_iterations_ = last_ = 0; 60 num_iterations_ = last_ = 0;
61 completed_ = false; 61 completed_ = false;
62 } 62 }
63 63
64 // Called periodically to test if WaitUntilCacheIoFinished should return. 64 // Called periodically to test if WaitUntilCacheIoFinished should return.
65 void TimerExpired(); 65 void TimerExpired();
66 66
67 base::RepeatingTimer<MessageLoopHelper> timer_; 67 base::RepeatingTimer timer_;
68 int num_callbacks_; 68 int num_callbacks_;
69 int num_iterations_; 69 int num_iterations_;
70 int last_; 70 int last_;
71 bool completed_; 71 bool completed_;
72 72
73 // True if a callback was called/reused more than expected. 73 // True if a callback was called/reused more than expected.
74 bool callback_reused_error_; 74 bool callback_reused_error_;
75 int callbacks_called_; 75 int callbacks_called_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(MessageLoopHelper); 77 DISALLOW_COPY_AND_ASSIGN(MessageLoopHelper);
(...skipping 17 matching lines...) Expand all
95 int last_result() const { return last_result_; } 95 int last_result() const { return last_result_; }
96 96
97 private: 97 private:
98 MessageLoopHelper* helper_; 98 MessageLoopHelper* helper_;
99 int reuse_; 99 int reuse_;
100 int last_result_; 100 int last_result_;
101 DISALLOW_COPY_AND_ASSIGN(CallbackTest); 101 DISALLOW_COPY_AND_ASSIGN(CallbackTest);
102 }; 102 };
103 103
104 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ 104 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/backend_worker_v3.cc ('k') | net/disk_cache/simple/simple_index.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698