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

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

Issue 2603523002: Move net-export thread-hopping code into NetLogFileWriter and add IO polled data. (Closed)
Patch Set: Fixed tommycli's nits from patchset 13 Created 3 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_FILE_NET_LOG_OBSERVER_H_ 5 #ifndef NET_LOG_FILE_NET_LOG_OBSERVER_H_
6 #define NET_LOG_FILE_NET_LOG_OBSERVER_H_ 6 #define NET_LOG_FILE_NET_LOG_OBSERVER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 // Stops observing net_log(). Must be called after StartObservingBounded/ 103 // Stops observing net_log(). Must be called after StartObservingBounded/
104 // StartObservingUnbounded. Should be called before destruction of the 104 // StartObservingUnbounded. Should be called before destruction of the
105 // FileNetLogObserver and the NetLog, or the NetLog files will be deleted when 105 // FileNetLogObserver and the NetLog, or the NetLog files will be deleted when
106 // the observer is destroyed. 106 // the observer is destroyed.
107 // 107 //
108 // |callback| will be run on whichever thread StopObserving() was called on 108 // |callback| will be run on whichever thread StopObserving() was called on
109 // once all file writing is complete and the netlog files can be accessed 109 // once all file writing is complete and the netlog files can be accessed
110 // safely. 110 // safely.
111 // 111 //
112 // |url_request_context| is an optional argument used to add additional 112 // |polled_data| is an optional argument used to add additional network stack
113 // network stack state to the log. If the context is non-NULL, 113 // state to the log.
114 // StopObserving() must be called on the context's thread. 114 void StopObserving(std::unique_ptr<base::Value> polled_data,
115 void StopObserving(URLRequestContext* url_request_context,
116 const base::Closure& callback); 115 const base::Closure& callback);
117 116
118 // NetLog::ThreadSafeObserver 117 // NetLog::ThreadSafeObserver
119 void OnAddEntry(const NetLogEntry& entry) override; 118 void OnAddEntry(const NetLogEntry& entry) override;
120 119
121 private: 120 private:
122 class WriteQueue; 121 class WriteQueue;
123 class FileWriter; 122 class FileWriter;
124 class BoundedFileWriter; 123 class BoundedFileWriter;
125 class UnboundedFileWriter; 124 class UnboundedFileWriter;
(...skipping 22 matching lines...) Expand all
148 // thread is safe because the FileWriter object will be alive until the 147 // thread is safe because the FileWriter object will be alive until the
149 // observer's destruction. 148 // observer's destruction.
150 FileWriter* file_writer_; 149 FileWriter* file_writer_;
151 150
152 DISALLOW_COPY_AND_ASSIGN(FileNetLogObserver); 151 DISALLOW_COPY_AND_ASSIGN(FileNetLogObserver);
153 }; 152 };
154 153
155 } // namespace net 154 } // namespace net
156 155
157 #endif // NET_LOG_FILE_NET_LOG_OBSERVER_H_ 156 #endif // NET_LOG_FILE_NET_LOG_OBSERVER_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/webui/net_export/net_export_ui.cc ('k') | net/log/file_net_log_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698