| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_BROWSING_DATA_CLEAR_SITE_DATA_THROTTLE_H_ | 5 #ifndef CONTENT_BROWSER_BROWSING_DATA_CLEAR_SITE_DATA_THROTTLE_H_ |
| 6 #define CONTENT_BROWSER_BROWSING_DATA_CLEAR_SITE_DATA_THROTTLE_H_ | 6 #define CONTENT_BROWSER_BROWSING_DATA_CLEAR_SITE_DATA_THROTTLE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 NavigationHandle* handle); | 37 NavigationHandle* handle); |
| 38 | 38 |
| 39 ~ClearSiteDataThrottle() override; | 39 ~ClearSiteDataThrottle() override; |
| 40 | 40 |
| 41 // NavigationThrottle implementation: | 41 // NavigationThrottle implementation: |
| 42 ThrottleCheckResult WillStartRequest() override; | 42 ThrottleCheckResult WillStartRequest() override; |
| 43 ThrottleCheckResult WillRedirectRequest() override; | 43 ThrottleCheckResult WillRedirectRequest() override; |
| 44 ThrottleCheckResult WillProcessResponse() override; | 44 ThrottleCheckResult WillProcessResponse() override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 friend class ClearSiteDataFuzzerTest; |
| 47 friend class ClearSiteDataThrottleTest; | 48 friend class ClearSiteDataThrottleTest; |
| 48 FRIEND_TEST_ALL_PREFIXES(ClearSiteDataThrottleTest, ParseHeader); | 49 FRIEND_TEST_ALL_PREFIXES(ClearSiteDataThrottleTest, ParseHeader); |
| 49 FRIEND_TEST_ALL_PREFIXES(ClearSiteDataThrottleTest, InvalidHeader); | 50 FRIEND_TEST_ALL_PREFIXES(ClearSiteDataThrottleTest, InvalidHeader); |
| 50 | 51 |
| 51 explicit ClearSiteDataThrottle(NavigationHandle* navigation_handle); | 52 explicit ClearSiteDataThrottle(NavigationHandle* navigation_handle); |
| 52 | 53 |
| 53 // Scans for the first occurrence of the 'Clear-Site-Data' header, calls | 54 // Scans for the first occurrence of the 'Clear-Site-Data' header, calls |
| 54 // ParseHeader() to parse it, and requests the actual data clearing. This is | 55 // ParseHeader() to parse it, and requests the actual data clearing. This is |
| 55 // the common logic of WillRedirectRequest() and WillProcessResponse(). | 56 // the common logic of WillRedirectRequest() and WillProcessResponse(). |
| 56 void HandleHeader(); | 57 void HandleHeader(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 82 | 83 |
| 83 // Needed for asynchronous parsing and deletion tasks. | 84 // Needed for asynchronous parsing and deletion tasks. |
| 84 base::WeakPtrFactory<ClearSiteDataThrottle> weak_ptr_factory_; | 85 base::WeakPtrFactory<ClearSiteDataThrottle> weak_ptr_factory_; |
| 85 | 86 |
| 86 DISALLOW_COPY_AND_ASSIGN(ClearSiteDataThrottle); | 87 DISALLOW_COPY_AND_ASSIGN(ClearSiteDataThrottle); |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 } // namespace content | 90 } // namespace content |
| 90 | 91 |
| 91 #endif // CONTENT_BROWSER_BROWSING_DATA_CLEAR_SITE_DATA_THROTTLE_H_ | 92 #endif // CONTENT_BROWSER_BROWSING_DATA_CLEAR_SITE_DATA_THROTTLE_H_ |
| OLD | NEW |