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

Side by Side Diff: components/net_log/net_export_file_writer.cc

Issue 2966283002: Remove the file thread dependency from FileNetLogObserver. (Closed)
Patch Set: undo const-ref changes Created 3 years, 5 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 (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
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
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
OLDNEW
« no previous file with comments | « components/cronet/android/cronet_url_request_context_adapter.cc ('k') | components/net_log/net_export_file_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698