| 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 CHROME_BROWSER_NET_NET_LOG_LOGGER_H_ | 5 #ifndef CHROME_BROWSER_NET_NET_LOG_LOGGER_H_ |
| 6 #define CHROME_BROWSER_NET_NET_LOG_LOGGER_H_ | 6 #define CHROME_BROWSER_NET_NET_LOG_LOGGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_handle.h" | 9 #include "base/memory/scoped_handle.h" |
| 10 #include "net/base/net_log.h" | 10 #include "net/base/net_log.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Otherwise, writes to |log_path|. Uses one line per entry, for | 27 // Otherwise, writes to |log_path|. Uses one line per entry, for |
| 28 // easy parsing. | 28 // easy parsing. |
| 29 explicit NetLogLogger(const FilePath &log_path); | 29 explicit NetLogLogger(const FilePath &log_path); |
| 30 virtual ~NetLogLogger(); | 30 virtual ~NetLogLogger(); |
| 31 | 31 |
| 32 // Starts observing specified NetLog. Must not already be watching a NetLog. | 32 // Starts observing specified NetLog. Must not already be watching a NetLog. |
| 33 // Separate from constructor to enforce thread safety. | 33 // Separate from constructor to enforce thread safety. |
| 34 void StartObserving(net::NetLog* net_log); | 34 void StartObserving(net::NetLog* net_log); |
| 35 | 35 |
| 36 // net::NetLog::ThreadSafeObserver implementation: | 36 // net::NetLog::ThreadSafeObserver implementation: |
| 37 virtual void OnAddEntry(net::NetLog::EventType type, | 37 virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE; |
| 38 const base::TimeTicks& time, | |
| 39 const net::NetLog::Source& source, | |
| 40 net::NetLog::EventPhase phase, | |
| 41 net::NetLog::EventParameters* params) OVERRIDE; | |
| 42 | 38 |
| 43 private: | 39 private: |
| 44 ScopedStdioHandle file_; | 40 ScopedStdioHandle file_; |
| 45 | 41 |
| 46 DISALLOW_COPY_AND_ASSIGN(NetLogLogger); | 42 DISALLOW_COPY_AND_ASSIGN(NetLogLogger); |
| 47 }; | 43 }; |
| 48 | 44 |
| 49 #endif // CHROME_BROWSER_NET_NET_LOG_LOGGER_H_ | 45 #endif // CHROME_BROWSER_NET_NET_LOG_LOGGER_H_ |
| OLD | NEW |