| 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 "content/browser/devtools/protocol/network_handler.h" | 5 #include "content/browser/devtools/protocol/network_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/barrier_closure.h" | 9 #include "base/barrier_closure.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 if (completion_status.error_code != net::OK) { | 697 if (completion_status.error_code != net::OK) { |
| 698 frontend_->LoadingFailed( | 698 frontend_->LoadingFailed( |
| 699 request_id, | 699 request_id, |
| 700 base::TimeTicks::Now().ToInternalValue() / | 700 base::TimeTicks::Now().ToInternalValue() / |
| 701 static_cast<double>(base::Time::kMicrosecondsPerSecond), | 701 static_cast<double>(base::Time::kMicrosecondsPerSecond), |
| 702 Page::ResourceTypeEnum::Other, | 702 Page::ResourceTypeEnum::Other, |
| 703 net::ErrorToString(completion_status.error_code), | 703 net::ErrorToString(completion_status.error_code), |
| 704 completion_status.error_code == net::Error::ERR_ABORTED); | 704 completion_status.error_code == net::Error::ERR_ABORTED); |
| 705 } | 705 } |
| 706 frontend_->LoadingFinished( | 706 frontend_->LoadingFinished( |
| 707 request_id, base::TimeTicks::Now().ToInternalValue() / | 707 request_id, |
| 708 static_cast<double>(base::Time::kMicrosecondsPerSecond), | 708 completion_status.completion_time.ToInternalValue() / |
| 709 static_cast<double>(base::Time::kMicrosecondsPerSecond), |
| 709 completion_status.encoded_data_length); | 710 completion_status.encoded_data_length); |
| 710 } | 711 } |
| 711 | 712 |
| 712 void NetworkHandler::NavigationFailed( | 713 void NetworkHandler::NavigationFailed( |
| 713 const CommonNavigationParams& common_params, | 714 const CommonNavigationParams& common_params, |
| 714 const BeginNavigationParams& begin_params, | 715 const BeginNavigationParams& begin_params, |
| 715 net::Error error_code) { | 716 net::Error error_code) { |
| 716 if (!enabled_) | 717 if (!enabled_) |
| 717 return; | 718 return; |
| 718 | 719 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 static_cast<double>(base::Time::kMicrosecondsPerSecond), | 756 static_cast<double>(base::Time::kMicrosecondsPerSecond), |
| 756 Page::ResourceTypeEnum::Document, error_string, cancelled); | 757 Page::ResourceTypeEnum::Document, error_string, cancelled); |
| 757 } | 758 } |
| 758 | 759 |
| 759 std::string NetworkHandler::UserAgentOverride() const { | 760 std::string NetworkHandler::UserAgentOverride() const { |
| 760 return enabled_ ? user_agent_ : std::string(); | 761 return enabled_ ? user_agent_ : std::string(); |
| 761 } | 762 } |
| 762 | 763 |
| 763 } // namespace protocol | 764 } // namespace protocol |
| 764 } // namespace content | 765 } // namespace content |
| OLD | NEW |