OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "components/net_log/net_export_file_writer.h" | 5 #include "components/net_log/net_export_file_writer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 log_path_ = log_path; | 177 log_path_ = log_path; |
178 | 178 |
179 DCHECK(!log_path_.empty()); | 179 DCHECK(!log_path_.empty()); |
180 | 180 |
181 state_ = STATE_STARTING_LOG; | 181 state_ = STATE_STARTING_LOG; |
182 | 182 |
183 NotifyStateObserversAsync(); | 183 NotifyStateObserversAsync(); |
184 | 184 |
185 std::unique_ptr<base::Value> constants( | 185 std::unique_ptr<base::Value> constants( |
186 ChromeNetLog::GetConstants(command_line_string, channel_string)); | 186 ChromeNetLog::GetConstants(command_line_string, channel_string)); |
187 // Instantiate a FileNetLogObserver in unbounded mode. | 187 |
188 file_net_log_observer_ = net::FileNetLogObserver::CreateUnbounded( | 188 file_net_log_observer_ = |
189 file_task_runner_, log_path_, std::move(constants)); | 189 net::FileNetLogObserver::CreateUnbounded(log_path_, std::move(constants)); |
190 | 190 |
191 net_task_runner_->PostTaskAndReply( | 191 net_task_runner_->PostTaskAndReply( |
192 FROM_HERE, | 192 FROM_HERE, |
193 base::Bind(&CreateNetLogEntriesForActiveObjects, context_getters, | 193 base::Bind(&CreateNetLogEntriesForActiveObjects, context_getters, |
194 base::Unretained(file_net_log_observer_.get())), | 194 base::Unretained(file_net_log_observer_.get())), |
195 base::Bind( | 195 base::Bind( |
196 &NetExportFileWriter::StartNetLogAfterCreateEntriesForActiveObjects, | 196 &NetExportFileWriter::StartNetLogAfterCreateEntriesForActiveObjects, |
197 weak_ptr_factory_.GetWeakPtr(), capture_mode)); | 197 weak_ptr_factory_.GetWeakPtr(), capture_mode)); |
198 } | 198 } |
199 | 199 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 void NetExportFileWriter::ResetObserverThenSetStateNotLogging() { | 369 void NetExportFileWriter::ResetObserverThenSetStateNotLogging() { |
370 DCHECK(thread_checker_.CalledOnValidThread()); | 370 DCHECK(thread_checker_.CalledOnValidThread()); |
371 file_net_log_observer_.reset(); | 371 file_net_log_observer_.reset(); |
372 state_ = STATE_NOT_LOGGING; | 372 state_ = STATE_NOT_LOGGING; |
373 | 373 |
374 NotifyStateObservers(); | 374 NotifyStateObservers(); |
375 } | 375 } |
376 | 376 |
377 } // namespace net_log | 377 } // namespace net_log |
OLD | NEW |