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 COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER
_THROTTLE_MANAGER_H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER
_THROTTLE_MANAGER_H_ |
6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER
_THROTTLE_MANAGER_H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER
_THROTTLE_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 class ContentSubresourceFilterThrottleManager | 45 class ContentSubresourceFilterThrottleManager |
46 : public content::WebContentsObserver { | 46 : public content::WebContentsObserver { |
47 public: | 47 public: |
48 // It is expected that the Delegate outlives |this|, and manages the lifetime | 48 // It is expected that the Delegate outlives |this|, and manages the lifetime |
49 // of this class. | 49 // of this class. |
50 class Delegate { | 50 class Delegate { |
51 public: | 51 public: |
52 // The embedder may be interested in displaying UI to the user when the | 52 // The embedder may be interested in displaying UI to the user when the |
53 // first load is disallowed for a given page load. | 53 // first load is disallowed for a given page load. |
54 virtual void OnFirstSubresourceLoadDisallowed() {} | 54 virtual void OnFirstSubresourceLoadDisallowed() {} |
| 55 |
| 56 // Temporary method to help the delegate compute the activation decision. |
| 57 virtual void WillProcessResponse( |
| 58 content::NavigationHandle* navigation_handle) {} |
55 }; | 59 }; |
56 | 60 |
57 ContentSubresourceFilterThrottleManager( | 61 ContentSubresourceFilterThrottleManager( |
58 Delegate* delegate, | 62 Delegate* delegate, |
59 VerifiedRulesetDealer::Handle* dealer_handle, | 63 VerifiedRulesetDealer::Handle* dealer_handle, |
60 content::WebContents* web_contents); | 64 content::WebContents* web_contents); |
61 ~ContentSubresourceFilterThrottleManager() override; | 65 ~ContentSubresourceFilterThrottleManager() override; |
62 | 66 |
63 // Sets the desired page-level |activation_state| for the currently ongoing | 67 // Sets the desired page-level |activation_state| for the currently ongoing |
64 // page load, identified by its main-frame |navigation_handle|. To be called | 68 // page load, identified by its main-frame |navigation_handle|. To be called |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 161 |
158 base::WeakPtrFactory<ContentSubresourceFilterThrottleManager> | 162 base::WeakPtrFactory<ContentSubresourceFilterThrottleManager> |
159 weak_ptr_factory_; | 163 weak_ptr_factory_; |
160 | 164 |
161 DISALLOW_COPY_AND_ASSIGN(ContentSubresourceFilterThrottleManager); | 165 DISALLOW_COPY_AND_ASSIGN(ContentSubresourceFilterThrottleManager); |
162 }; | 166 }; |
163 | 167 |
164 } // namespace subresource_filter | 168 } // namespace subresource_filter |
165 | 169 |
166 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FIL
TER_THROTTLE_MANAGER_H_ | 170 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FIL
TER_THROTTLE_MANAGER_H_ |
OLD | NEW |