| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_TEST_COMPLETION_CALLBACK_H_ | 5 #ifndef NET_BASE_TEST_COMPLETION_CALLBACK_H_ |
| 6 #define NET_BASE_TEST_COMPLETION_CALLBACK_H_ | 6 #define NET_BASE_TEST_COMPLETION_CALLBACK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/callback_old.h" | 9 #include "base/callback_old.h" |
| 10 #include "base/tuple.h" | 10 #include "base/tuple.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 public: | 25 public: |
| 26 TestOldCompletionCallback(); | 26 TestOldCompletionCallback(); |
| 27 virtual ~TestOldCompletionCallback(); | 27 virtual ~TestOldCompletionCallback(); |
| 28 | 28 |
| 29 int WaitForResult(); | 29 int WaitForResult(); |
| 30 | 30 |
| 31 int GetResult(int result); | 31 int GetResult(int result); |
| 32 | 32 |
| 33 bool have_result() const { return have_result_; } | 33 bool have_result() const { return have_result_; } |
| 34 | 34 |
| 35 virtual void RunWithParams(const Tuple1<int>& params); | 35 virtual void RunWithParams(const Tuple1<int>& params) OVERRIDE; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 int result_; | 38 int result_; |
| 39 bool have_result_; | 39 bool have_result_; |
| 40 bool waiting_for_result_; | 40 bool waiting_for_result_; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 namespace net { | 43 namespace net { |
| 44 | 44 |
| 45 class TestCompletionCallback { | 45 class TestCompletionCallback { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 58 private: | 58 private: |
| 59 void OnComplete(int result); | 59 void OnComplete(int result); |
| 60 | 60 |
| 61 const CompletionCallback callback_; | 61 const CompletionCallback callback_; |
| 62 TestOldCompletionCallback old_callback_impl_; | 62 TestOldCompletionCallback old_callback_impl_; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace net | 65 } // namespace net |
| 66 | 66 |
| 67 #endif // NET_BASE_TEST_COMPLETION_CALLBACK_H_ | 67 #endif // NET_BASE_TEST_COMPLETION_CALLBACK_H_ |
| OLD | NEW |