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 WRITE_TO_FILE_NET_LOG_OBSERVER_H_ | 5 #ifndef WRITE_TO_FILE_NET_LOG_OBSERVER_H_ |
6 #define WRITE_TO_FILE_NET_LOG_OBSERVER_H_ | 6 #define WRITE_TO_FILE_NET_LOG_OBSERVER_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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 // Stops observing net_log(). Must already be watching. Must be called | 54 // Stops observing net_log(). Must already be watching. Must be called |
55 // before destruction of the WriteToFileNetLogObserver and the NetLog. | 55 // before destruction of the WriteToFileNetLogObserver and the NetLog. |
56 // | 56 // |
57 // |url_request_context| is an optional argument used to added additional | 57 // |url_request_context| is an optional argument used to added additional |
58 // network stack state to the log. If the context is non-NULL, this must be | 58 // network stack state to the log. If the context is non-NULL, this must be |
59 // called on the context's thread. | 59 // called on the context's thread. |
60 void StopObserving(URLRequestContext* url_request_context); | 60 void StopObserving(URLRequestContext* url_request_context); |
61 | 61 |
62 // net::NetLog::ThreadSafeObserver implementation: | 62 // net::NetLog::ThreadSafeObserver implementation: |
63 void OnAddEntry(const NetLog::Entry& entry) override; | 63 void OnAddEntry(const NetLogEntry& entry) override; |
64 | 64 |
65 private: | 65 private: |
66 // ---------------- | 66 // ---------------- |
67 // Thread safety | 67 // Thread safety |
68 // ---------------- | 68 // ---------------- |
69 // | 69 // |
70 // NetLog observers are invoked on arbitrary threads, however are notified of | 70 // NetLog observers are invoked on arbitrary threads, however are notified of |
71 // events in a serial fashion (the NetLog lock is held while dispatching | 71 // events in a serial fashion (the NetLog lock is held while dispatching |
72 // events to observers). | 72 // events to observers). |
73 // | 73 // |
(...skipping 11 matching lines...) Expand all Loading... |
85 | 85 |
86 // True if OnAddEntry() has been called at least once. | 86 // True if OnAddEntry() has been called at least once. |
87 bool added_events_; | 87 bool added_events_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(WriteToFileNetLogObserver); | 89 DISALLOW_COPY_AND_ASSIGN(WriteToFileNetLogObserver); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace net | 92 } // namespace net |
93 | 93 |
94 #endif // WRITE_TO_FILE_NET_LOG_OBSERVER_H_ | 94 #endif // WRITE_TO_FILE_NET_LOG_OBSERVER_H_ |
OLD | NEW |