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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
664 static_cast<double>(base::Time::kMicrosecondsPerSecond), | 664 static_cast<double>(base::Time::kMicrosecondsPerSecond), |
665 Page::ResourceTypeEnum::Other, "Navigation Preload Error", | 665 Page::ResourceTypeEnum::Other, "Navigation Preload Error", |
666 completion_status.error_code == net::Error::ERR_ABORTED); | 666 completion_status.error_code == net::Error::ERR_ABORTED); |
667 } | 667 } |
668 frontend_->LoadingFinished( | 668 frontend_->LoadingFinished( |
669 request_id, base::TimeTicks::Now().ToInternalValue() / | 669 request_id, base::TimeTicks::Now().ToInternalValue() / |
670 static_cast<double>(base::Time::kMicrosecondsPerSecond), | 670 static_cast<double>(base::Time::kMicrosecondsPerSecond), |
671 completion_status.encoded_data_length); | 671 completion_status.encoded_data_length); |
672 } | 672 } |
673 | 673 |
674 void NetworkHandler::NavigationFailed(const std::string& request_id, | |
675 const std::string& error_string, | |
676 bool cancelled) { | |
677 if (!enabled_) | |
678 return; | |
679 frontend_->LoadingFailed( | |
dgozman
2017/02/27 17:31:31
We should send "requestWillBeSent" before "loading
jam
2017/02/27 20:47:35
Done.
| |
680 request_id, | |
681 base::TimeTicks::Now().ToInternalValue() / | |
682 static_cast<double>(base::Time::kMicrosecondsPerSecond), | |
683 Page::ResourceTypeEnum::Document, error_string, cancelled); | |
684 } | |
685 | |
674 std::string NetworkHandler::UserAgentOverride() const { | 686 std::string NetworkHandler::UserAgentOverride() const { |
675 return enabled_ ? user_agent_ : std::string(); | 687 return enabled_ ? user_agent_ : std::string(); |
676 } | 688 } |
677 | 689 |
678 } // namespace protocol | 690 } // namespace protocol |
679 } // namespace content | 691 } // namespace content |
OLD | NEW |