| 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_log_file_writer.h" | 5 #include "components/net_log/net_log_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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } else { | 237 } else { |
| 238 StopNetLogAfterAddNetInfo(std::move(polled_data)); | 238 StopNetLogAfterAddNetInfo(std::move(polled_data)); |
| 239 } | 239 } |
| 240 } | 240 } |
| 241 | 241 |
| 242 std::unique_ptr<base::DictionaryValue> NetLogFileWriter::GetState() const { | 242 std::unique_ptr<base::DictionaryValue> NetLogFileWriter::GetState() const { |
| 243 DCHECK(thread_checker_.CalledOnValidThread()); | 243 DCHECK(thread_checker_.CalledOnValidThread()); |
| 244 | 244 |
| 245 auto dict = base::MakeUnique<base::DictionaryValue>(); | 245 auto dict = base::MakeUnique<base::DictionaryValue>(); |
| 246 | 246 |
| 247 #ifndef NDEBUG | |
| 248 dict->SetString("file", log_path_.LossyDisplayName()); | 247 dict->SetString("file", log_path_.LossyDisplayName()); |
| 249 #endif // NDEBUG | |
| 250 | 248 |
| 251 base::StringPiece state_string; | 249 base::StringPiece state_string; |
| 252 switch (state_) { | 250 switch (state_) { |
| 253 case STATE_UNINITIALIZED: | 251 case STATE_UNINITIALIZED: |
| 254 state_string = "UNINITIALIZED"; | 252 state_string = "UNINITIALIZED"; |
| 255 break; | 253 break; |
| 256 case STATE_INITIALIZING: | 254 case STATE_INITIALIZING: |
| 257 state_string = "INITIALIZING"; | 255 state_string = "INITIALIZING"; |
| 258 break; | 256 break; |
| 259 case STATE_NOT_LOGGING: | 257 case STATE_NOT_LOGGING: |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 371 |
| 374 void NetLogFileWriter::ResetObserverThenSetStateNotLogging() { | 372 void NetLogFileWriter::ResetObserverThenSetStateNotLogging() { |
| 375 DCHECK(thread_checker_.CalledOnValidThread()); | 373 DCHECK(thread_checker_.CalledOnValidThread()); |
| 376 file_net_log_observer_.reset(); | 374 file_net_log_observer_.reset(); |
| 377 state_ = STATE_NOT_LOGGING; | 375 state_ = STATE_NOT_LOGGING; |
| 378 | 376 |
| 379 NotifyStateObservers(); | 377 NotifyStateObservers(); |
| 380 } | 378 } |
| 381 | 379 |
| 382 } // namespace net_log | 380 } // namespace net_log |
| OLD | NEW |