| 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 <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
| 23 #include "net/base/sdch_manager.h" | 23 #include "net/base/sdch_manager.h" |
| 24 #include "net/disk_cache/disk_cache.h" | 24 #include "net/disk_cache/disk_cache.h" |
| 25 #include "net/dns/host_cache.h" | 25 #include "net/dns/host_cache.h" |
| 26 #include "net/dns/host_resolver.h" | 26 #include "net/dns/host_resolver.h" |
| 27 #include "net/http/http_cache.h" | 27 #include "net/http/http_cache.h" |
| 28 #include "net/http/http_network_session.h" | 28 #include "net/http/http_network_session.h" |
| 29 #include "net/http/http_server_properties.h" | 29 #include "net/http/http_server_properties.h" |
| 30 #include "net/http/http_transaction_factory.h" | 30 #include "net/http/http_transaction_factory.h" |
| 31 #include "net/log/net_log.h" | 31 #include "net/log/net_log.h" |
| 32 #include "net/log/net_log_event_type.h" |
| 32 #include "net/proxy/proxy_config.h" | 33 #include "net/proxy/proxy_config.h" |
| 33 #include "net/proxy/proxy_retry_info.h" | 34 #include "net/proxy/proxy_retry_info.h" |
| 34 #include "net/proxy/proxy_service.h" | 35 #include "net/proxy/proxy_service.h" |
| 35 #include "net/quic/core/quic_protocol.h" | 36 #include "net/quic/core/quic_protocol.h" |
| 36 #include "net/quic/core/quic_utils.h" | 37 #include "net/quic/core/quic_utils.h" |
| 37 #include "net/socket/ssl_client_socket.h" | 38 #include "net/socket/ssl_client_socket.h" |
| 38 #include "net/url_request/url_request.h" | 39 #include "net/url_request/url_request.h" |
| 39 #include "net/url_request/url_request_context.h" | 40 #include "net/url_request/url_request_context.h" |
| 40 | 41 |
| 41 namespace net { | 42 namespace net { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 dict->SetInteger(kSdchProblems[i].name, kSdchProblems[i].constant); | 240 dict->SetInteger(kSdchProblems[i].name, kSdchProblems[i].constant); |
| 240 | 241 |
| 241 constants_dict->Set("sdchProblemCode", std::move(dict)); | 242 constants_dict->Set("sdchProblemCode", std::move(dict)); |
| 242 } | 243 } |
| 243 | 244 |
| 244 // Information about the relationship between event phase enums and their | 245 // Information about the relationship between event phase enums and their |
| 245 // symbolic names. | 246 // symbolic names. |
| 246 { | 247 { |
| 247 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 248 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 248 | 249 |
| 249 dict->SetInteger("PHASE_BEGIN", NetLog::PHASE_BEGIN); | 250 dict->SetInteger("PHASE_BEGIN", static_cast<int>(NetLogEventPhase::BEGIN)); |
| 250 dict->SetInteger("PHASE_END", NetLog::PHASE_END); | 251 dict->SetInteger("PHASE_END", static_cast<int>(NetLogEventPhase::END)); |
| 251 dict->SetInteger("PHASE_NONE", NetLog::PHASE_NONE); | 252 dict->SetInteger("PHASE_NONE", static_cast<int>(NetLogEventPhase::NONE)); |
| 252 | 253 |
| 253 constants_dict->Set("logEventPhase", std::move(dict)); | 254 constants_dict->Set("logEventPhase", std::move(dict)); |
| 254 } | 255 } |
| 255 | 256 |
| 256 // Information about the relationship between source type enums and | 257 // Information about the relationship between source type enums and |
| 257 // their symbolic names. | 258 // their symbolic names. |
| 258 constants_dict->Set("logSourceType", NetLog::GetSourceTypesAsValue()); | 259 constants_dict->Set("logSourceType", NetLog::GetSourceTypesAsValue()); |
| 259 | 260 |
| 260 // TODO(eroman): This is here for compatibility in loading new log files with | 261 // TODO(eroman): This is here for compatibility in loading new log files with |
| 261 // older builds of Chrome. Safe to remove this once M45 is on the stable | 262 // older builds of Chrome. Safe to remove this once M45 is on the stable |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 std::sort(requests.begin(), requests.end(), RequestCreatedBefore); | 530 std::sort(requests.begin(), requests.end(), RequestCreatedBefore); |
| 530 | 531 |
| 531 // Create fake events. | 532 // Create fake events. |
| 532 for (auto* request : requests) { | 533 for (auto* request : requests) { |
| 533 NetLog::ParametersCallback callback = | 534 NetLog::ParametersCallback callback = |
| 534 base::Bind(&GetRequestStateAsValue, base::Unretained(request)); | 535 base::Bind(&GetRequestStateAsValue, base::Unretained(request)); |
| 535 | 536 |
| 536 // Note that passing the hardcoded NetLogCaptureMode::Default() below is | 537 // Note that passing the hardcoded NetLogCaptureMode::Default() below is |
| 537 // fine, since GetRequestStateAsValue() ignores the capture mode. | 538 // fine, since GetRequestStateAsValue() ignores the capture mode. |
| 538 NetLog::EntryData entry_data( | 539 NetLog::EntryData entry_data( |
| 539 NetLog::TYPE_REQUEST_ALIVE, request->net_log().source(), | 540 NetLogEventType::REQUEST_ALIVE, request->net_log().source(), |
| 540 NetLog::PHASE_BEGIN, request->creation_time(), &callback); | 541 NetLogEventPhase::BEGIN, request->creation_time(), &callback); |
| 541 NetLog::Entry entry(&entry_data, NetLogCaptureMode::Default()); | 542 NetLog::Entry entry(&entry_data, NetLogCaptureMode::Default()); |
| 542 observer->OnAddEntry(entry); | 543 observer->OnAddEntry(entry); |
| 543 } | 544 } |
| 544 } | 545 } |
| 545 | 546 |
| 546 } // namespace net | 547 } // namespace net |
| OLD | NEW |