| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/renderer/safe_browsing/safe_browsing_url_loader_throttle.h" | 5 #include "chrome/renderer/safe_browsing/safe_browsing_url_loader_throttle.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/public/cpp/bindings/interface_request.h" | 8 #include "mojo/public/cpp/bindings/interface_request.h" |
| 9 #include "net/url_request/redirect_info.h" | 9 #include "net/url_request/redirect_info.h" |
| 10 | 10 |
| 11 namespace safe_browsing { | 11 namespace safe_browsing { |
| 12 | 12 |
| 13 SafeBrowsingURLLoaderThrottle::SafeBrowsingURLLoaderThrottle( | 13 SafeBrowsingURLLoaderThrottle::SafeBrowsingURLLoaderThrottle( |
| 14 chrome::mojom::SafeBrowsing* safe_browsing, | 14 mojom::SafeBrowsing* safe_browsing, |
| 15 int render_frame_id) | 15 int render_frame_id) |
| 16 : safe_browsing_(safe_browsing), | 16 : safe_browsing_(safe_browsing), |
| 17 render_frame_id_(render_frame_id), | 17 render_frame_id_(render_frame_id), |
| 18 weak_factory_(this) {} | 18 weak_factory_(this) {} |
| 19 | 19 |
| 20 SafeBrowsingURLLoaderThrottle::~SafeBrowsingURLLoaderThrottle() = default; | 20 SafeBrowsingURLLoaderThrottle::~SafeBrowsingURLLoaderThrottle() = default; |
| 21 | 21 |
| 22 void SafeBrowsingURLLoaderThrottle::WillStartRequest( | 22 void SafeBrowsingURLLoaderThrottle::WillStartRequest( |
| 23 const GURL& url, | 23 const GURL& url, |
| 24 int load_flags, | 24 int load_flags, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 void SafeBrowsingURLLoaderThrottle::OnConnectionError() { | 95 void SafeBrowsingURLLoaderThrottle::OnConnectionError() { |
| 96 DCHECK(!blocked_); | 96 DCHECK(!blocked_); |
| 97 | 97 |
| 98 // If a service-side disconnect happens, treat all URLs as if they are safe. | 98 // If a service-side disconnect happens, treat all URLs as if they are safe. |
| 99 url_checker_.reset(); | 99 url_checker_.reset(); |
| 100 pending_checks_ = 0; | 100 pending_checks_ = 0; |
| 101 delegate_->Resume(); | 101 delegate_->Resume(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace safe_browsing | 104 } // namespace safe_browsing |
| OLD | NEW |