| 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/memory/scoped_handle.h" | 10 #include "base/files/scoped_file.h" |
| 11 #include "net/base/net_log.h" | 11 #include "net/base/net_log.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class FilePath; | 14 class FilePath; |
| 15 class Value; | 15 class Value; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 // NetLogLogger watches the NetLog event stream, and sends all entries to | 20 // NetLogLogger watches the NetLog event stream, and sends all entries to |
| (...skipping 19 matching lines...) Expand all Loading... |
| 40 void StopObserving(); | 40 void StopObserving(); |
| 41 | 41 |
| 42 // net::NetLog::ThreadSafeObserver implementation: | 42 // net::NetLog::ThreadSafeObserver implementation: |
| 43 virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE; | 43 virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE; |
| 44 | 44 |
| 45 // Create a dictionary containing legend for net/ constants. Caller takes | 45 // Create a dictionary containing legend for net/ constants. Caller takes |
| 46 // ownership of returned value. | 46 // ownership of returned value. |
| 47 static base::DictionaryValue* GetConstants(); | 47 static base::DictionaryValue* GetConstants(); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 ScopedStdioHandle file_; | 50 base::ScopedFILE file_; |
| 51 | 51 |
| 52 // The LogLevel to log at. | 52 // The LogLevel to log at. |
| 53 NetLog::LogLevel log_level_; | 53 NetLog::LogLevel log_level_; |
| 54 | 54 |
| 55 // True if OnAddEntry() has been called at least once. | 55 // True if OnAddEntry() has been called at least once. |
| 56 bool added_events_; | 56 bool added_events_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(NetLogLogger); | 58 DISALLOW_COPY_AND_ASSIGN(NetLogLogger); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace net | 61 } // namespace net |
| 62 | 62 |
| 63 #endif // NET_BASE_NET_LOG_LOGGER_H_ | 63 #endif // NET_BASE_NET_LOG_LOGGER_H_ |
| OLD | NEW |