| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "net/log/net_log_util.h" | 5 #include "net/log/net_log_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 514 |
| 515 // Sort by creation time. | 515 // Sort by creation time. |
| 516 std::sort(requests.begin(), requests.end(), RequestCreatedBefore); | 516 std::sort(requests.begin(), requests.end(), RequestCreatedBefore); |
| 517 | 517 |
| 518 // Create fake events. | 518 // Create fake events. |
| 519 ScopedVector<NetLog::Entry> entries; | 519 ScopedVector<NetLog::Entry> entries; |
| 520 for (const auto& request : requests) { | 520 for (const auto& request : requests) { |
| 521 NetLog::ParametersCallback callback = | 521 NetLog::ParametersCallback callback = |
| 522 base::Bind(&GetRequestStateAsValue, base::Unretained(request)); | 522 base::Bind(&GetRequestStateAsValue, base::Unretained(request)); |
| 523 | 523 |
| 524 // Note that passing the hardcoded NetLogCaptureMode::Default() below is |
| 525 // fine, since GetRequestStateAsValue() ignores the capture mode. |
| 524 NetLog::EntryData entry_data( | 526 NetLog::EntryData entry_data( |
| 525 NetLog::TYPE_REQUEST_ALIVE, request->net_log().source(), | 527 NetLog::TYPE_REQUEST_ALIVE, request->net_log().source(), |
| 526 NetLog::PHASE_BEGIN, request->creation_time(), &callback); | 528 NetLog::PHASE_BEGIN, request->creation_time(), &callback); |
| 527 NetLog::Entry entry(&entry_data, request->net_log().GetCaptureMode()); | 529 NetLog::Entry entry(&entry_data, NetLogCaptureMode::Default()); |
| 528 observer->OnAddEntry(entry); | 530 observer->OnAddEntry(entry); |
| 529 } | 531 } |
| 530 } | 532 } |
| 531 | 533 |
| 532 } // namespace net | 534 } // namespace net |
| OLD | NEW |