| OLD | NEW |
| 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_LOG_TEST_NET_LOG_H_ | 5 #ifndef NET_LOG_TEST_NET_LOG_H_ |
| 6 #define NET_LOG_TEST_NET_LOG_H_ | 6 #define NET_LOG_TEST_NET_LOG_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // Returns a NetLog observer that will write entries to the TestNetLog's event | 37 // Returns a NetLog observer that will write entries to the TestNetLog's event |
| 38 // store. For testing code that bypasses NetLogs and adds events directly to | 38 // store. For testing code that bypasses NetLogs and adds events directly to |
| 39 // an observer. | 39 // an observer. |
| 40 NetLog::ThreadSafeObserver* GetObserver() const; | 40 NetLog::ThreadSafeObserver* GetObserver() const; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 // The underlying observer class that does all the work. | 43 // The underlying observer class that does all the work. |
| 44 class Observer; | 44 class Observer; |
| 45 | 45 |
| 46 scoped_ptr<Observer> observer_; | 46 std::unique_ptr<Observer> observer_; |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(TestNetLog); | 48 DISALLOW_COPY_AND_ASSIGN(TestNetLog); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // Helper class that exposes a similar API as BoundNetLog, but uses a | 51 // Helper class that exposes a similar API as BoundNetLog, but uses a |
| 52 // TestNetLog rather than the more generic NetLog. | 52 // TestNetLog rather than the more generic NetLog. |
| 53 // | 53 // |
| 54 // A BoundTestNetLog can easily be converted to a BoundNetLog using the | 54 // A BoundTestNetLog can easily be converted to a BoundNetLog using the |
| 55 // bound() method. | 55 // bound() method. |
| 56 class BoundTestNetLog { | 56 class BoundTestNetLog { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 79 private: | 79 private: |
| 80 TestNetLog test_net_log_; | 80 TestNetLog test_net_log_; |
| 81 const BoundNetLog net_log_; | 81 const BoundNetLog net_log_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(BoundTestNetLog); | 83 DISALLOW_COPY_AND_ASSIGN(BoundTestNetLog); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace net | 86 } // namespace net |
| 87 | 87 |
| 88 #endif // NET_LOG_TEST_NET_LOG_H_ | 88 #endif // NET_LOG_TEST_NET_LOG_H_ |
| OLD | NEW |