Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: net/log/write_to_file_net_log_observer.h

Issue 2603523002: Move net-export thread-hopping code into NetLogFileWriter and add IO polled data. (Closed)
Patch Set: Various refactors to make code cleaner Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_LOG_WRITE_TO_FILE_NET_LOG_OBSERVER_H_ 5 #ifndef NET_LOG_WRITE_TO_FILE_NET_LOG_OBSERVER_H_
6 #define NET_LOG_WRITE_TO_FILE_NET_LOG_OBSERVER_H_ 6 #define NET_LOG_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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // pre-populate the log with information about in-progress events. 46 // pre-populate the log with information about in-progress events.
47 // If the context is non-NULL, this must be called on the context's thread. 47 // If the context is non-NULL, this must be called on the context's thread.
48 void StartObserving(NetLog* net_log, 48 void StartObserving(NetLog* net_log,
49 base::ScopedFILE file, 49 base::ScopedFILE file,
50 base::Value* constants, 50 base::Value* constants,
51 URLRequestContext* url_request_context); 51 URLRequestContext* url_request_context);
52 52
53 // Stops observing net_log(). Must already be watching. Must be called 53 // Stops observing net_log(). Must already be watching. Must be called
54 // before destruction of the WriteToFileNetLogObserver and the NetLog. 54 // before destruction of the WriteToFileNetLogObserver and the NetLog.
55 // 55 //
56 // |url_request_context| is an optional argument used to added additional 56 // |polled_data| is an optional argument used to added additional
57 // network stack state to the log. If the context is non-NULL, this must be 57 // network stack state to the log.
58 // called on the context's thread. 58 void StopObserving(base::Value* polled_data);
59 void StopObserving(URLRequestContext* url_request_context);
60 59
61 // net::NetLog::ThreadSafeObserver implementation: 60 // net::NetLog::ThreadSafeObserver implementation:
62 void OnAddEntry(const NetLogEntry& entry) override; 61 void OnAddEntry(const NetLogEntry& entry) override;
63 62
64 private: 63 private:
65 // ---------------- 64 // ----------------
66 // Thread safety 65 // Thread safety
67 // ---------------- 66 // ----------------
68 // 67 //
69 // NetLog observers are invoked on arbitrary threads, however are notified of 68 // NetLog observers are invoked on arbitrary threads, however are notified of
(...skipping 14 matching lines...) Expand all
84 83
85 // True if OnAddEntry() has been called at least once. 84 // True if OnAddEntry() has been called at least once.
86 bool added_events_; 85 bool added_events_;
87 86
88 DISALLOW_COPY_AND_ASSIGN(WriteToFileNetLogObserver); 87 DISALLOW_COPY_AND_ASSIGN(WriteToFileNetLogObserver);
89 }; 88 };
90 89
91 } // namespace net 90 } // namespace net
92 91
93 #endif // NET_LOG_WRITE_TO_FILE_NET_LOG_OBSERVER_H_ 92 #endif // NET_LOG_WRITE_TO_FILE_NET_LOG_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698