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

Unified Diff: net/log/write_to_file_net_log_observer.cc

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 side-by-side diff with in-line comments
Download patch
Index: net/log/write_to_file_net_log_observer.cc
diff --git a/net/log/write_to_file_net_log_observer.cc b/net/log/write_to_file_net_log_observer.cc
index 5470ebbcd44d2d880fe9b1a4d8c387ea5db9f7f2..0c79ea3387146851fd923cc934fb85a547ab9ca7 100644
--- a/net/log/write_to_file_net_log_observer.cc
+++ b/net/log/write_to_file_net_log_observer.cc
@@ -67,21 +67,16 @@ void WriteToFileNetLogObserver::StartObserving(
net_log->DeprecatedAddObserver(this, capture_mode_);
}
-void WriteToFileNetLogObserver::StopObserving(
- URLRequestContext* url_request_context) {
+void WriteToFileNetLogObserver::StopObserving(base::Value* polled_data) {
net_log()->DeprecatedRemoveObserver(this);
// End events array.
fprintf(file_.get(), "]");
- // Write state of the URLRequestContext when logging stopped.
- if (url_request_context) {
- DCHECK(url_request_context->CalledOnValidThread());
-
+ if (polled_data) {
std::string json;
- base::JSONWriter::Write(
- *GetNetInfo(url_request_context, NET_INFO_ALL_SOURCES), &json);
- fprintf(file_.get(), ",\"tabInfo\": %s\n", json.c_str());
+ base::JSONWriter::Write(*polled_data, &json);
+ fprintf(file_.get(), ",\"polledData\": %s\n", json.c_str());
}
fprintf(file_.get(), "}");
« components/net_log/resources/net_export.js ('K') | « net/log/write_to_file_net_log_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698