| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_NET_LOG_LOGGER_H_ | 5 #ifndef NET_BASE_NET_LOG_LOGGER_H_ |
| 6 #define NET_BASE_NET_LOG_LOGGER_H_ | 6 #define NET_BASE_NET_LOG_LOGGER_H_ |
| 7 | 7 |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 | 9 |
| 10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 void set_log_level(NetLog::LogLevel log_level); | 34 void set_log_level(NetLog::LogLevel log_level); |
| 35 | 35 |
| 36 // Starts observing specified NetLog. Must not already be watching a NetLog. | 36 // Starts observing specified NetLog. Must not already be watching a NetLog. |
| 37 // Separate from constructor to enforce thread safety. | 37 // Separate from constructor to enforce thread safety. |
| 38 void StartObserving(NetLog* net_log); | 38 void StartObserving(NetLog* net_log); |
| 39 | 39 |
| 40 // Stops observing net_log(). Must already be watching. | 40 // Stops observing net_log(). Must already be watching. |
| 41 void StopObserving(); | 41 void StopObserving(); |
| 42 | 42 |
| 43 // net::NetLog::ThreadSafeObserver implementation: | 43 // net::NetLog::ThreadSafeObserver implementation: |
| 44 virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE; | 44 virtual void OnAddEntry(const NetLog::Entry& entry) override; |
| 45 | 45 |
| 46 // Create a dictionary containing legend for net/ constants. Caller takes | 46 // Create a dictionary containing legend for net/ constants. Caller takes |
| 47 // ownership of returned value. | 47 // ownership of returned value. |
| 48 static base::DictionaryValue* GetConstants(); | 48 static base::DictionaryValue* GetConstants(); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 base::ScopedFILE file_; | 51 base::ScopedFILE file_; |
| 52 | 52 |
| 53 // The LogLevel to log at. | 53 // The LogLevel to log at. |
| 54 NetLog::LogLevel log_level_; | 54 NetLog::LogLevel log_level_; |
| 55 | 55 |
| 56 // True if OnAddEntry() has been called at least once. | 56 // True if OnAddEntry() has been called at least once. |
| 57 bool added_events_; | 57 bool added_events_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(NetLogLogger); | 59 DISALLOW_COPY_AND_ASSIGN(NetLogLogger); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace net | 62 } // namespace net |
| 63 | 63 |
| 64 #endif // NET_BASE_NET_LOG_LOGGER_H_ | 64 #endif // NET_BASE_NET_LOG_LOGGER_H_ |
| OLD | NEW |