| 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 #ifndef CONTENT_BROWSER_FRAME_HOST_MIXED_CONTENT_NAVIGATION_THROTTLE_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_MIXED_CONTENT_NAVIGATION_THROTTLE_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_MIXED_CONTENT_NAVIGATION_THROTTLE_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_MIXED_CONTENT_NAVIGATION_THROTTLE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 using ThrottleCheckResult = NavigationThrottle::ThrottleCheckResult; | 23 using ThrottleCheckResult = NavigationThrottle::ThrottleCheckResult; |
| 24 | 24 |
| 25 // Responsible for browser-process-side mixed content security checks. It is | 25 // Responsible for browser-process-side mixed content security checks. It is |
| 26 // only enabled if PlzNavigate is and checks only for frame-level resource loads | 26 // only enabled if PlzNavigate is and checks only for frame-level resource loads |
| 27 // (aka navigation loads). Sub-resources fetches are checked in the renderer | 27 // (aka navigation loads). Sub-resources fetches are checked in the renderer |
| 28 // process by MixedContentChecker. Changes to this class might need to be | 28 // process by MixedContentChecker. Changes to this class might need to be |
| 29 // reflected on its renderer counterpart. | 29 // reflected on its renderer counterpart. |
| 30 // | 30 // |
| 31 // Current mixed content W3C draft that drives this implementation: | 31 // Current mixed content W3C draft that drives this implementation: |
| 32 // https://w3c.github.io/webappsec-mixed-content/ | 32 // https://w3c.github.io/webappsec-mixed-content/ |
| 33 // | |
| 34 // TODO(carlosk): For HSTS to work properly in PlzNavigate when these browser | |
| 35 // side mixed content checks happen it needs to be ported to the browser as a | |
| 36 // navigation throttle implementation. See https://crbug.com/692157. | |
| 37 class MixedContentNavigationThrottle : public NavigationThrottle { | 33 class MixedContentNavigationThrottle : public NavigationThrottle { |
| 38 public: | 34 public: |
| 39 static std::unique_ptr<NavigationThrottle> CreateThrottleForNavigation( | 35 static std::unique_ptr<NavigationThrottle> CreateThrottleForNavigation( |
| 40 NavigationHandle* navigation_handle); | 36 NavigationHandle* navigation_handle); |
| 41 | 37 |
| 42 MixedContentNavigationThrottle(NavigationHandle* navigation_handle); | 38 MixedContentNavigationThrottle(NavigationHandle* navigation_handle); |
| 43 ~MixedContentNavigationThrottle() override; | 39 ~MixedContentNavigationThrottle() override; |
| 44 | 40 |
| 45 // NavigationThrottle overrides. | 41 // NavigationThrottle overrides. |
| 46 ThrottleCheckResult WillStartRequest() override; | 42 ThrottleCheckResult WillStartRequest() override; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // values are reported to the respective renderer process after each mixed | 85 // values are reported to the respective renderer process after each mixed |
| 90 // content check is finished. | 86 // content check is finished. |
| 91 std::set<int> mixed_content_features_; | 87 std::set<int> mixed_content_features_; |
| 92 | 88 |
| 93 DISALLOW_COPY_AND_ASSIGN(MixedContentNavigationThrottle); | 89 DISALLOW_COPY_AND_ASSIGN(MixedContentNavigationThrottle); |
| 94 }; | 90 }; |
| 95 | 91 |
| 96 } // namespace content | 92 } // namespace content |
| 97 | 93 |
| 98 #endif // CONTENT_BROWSER_FRAME_HOST_MIXED_CONTENT_NAVIGATION_THROTTLE_H_ | 94 #endif // CONTENT_BROWSER_FRAME_HOST_MIXED_CONTENT_NAVIGATION_THROTTLE_H_ |
| OLD | NEW |