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_SUBFRAME_NAVIGATION_FILTER
ING_THROTTLE_H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBFRAME_NAVIGATION_FILTER
ING_THROTTLE_H_ |
6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBFRAME_NAVIGATION_FILTER
ING_THROTTLE_H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBFRAME_NAVIGATION_FILTER
ING_THROTTLE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/time/time.h" |
10 #include "components/subresource_filter/content/browser/async_document_subresour
ce_filter.h" | 11 #include "components/subresource_filter/content/browser/async_document_subresour
ce_filter.h" |
11 #include "content/public/browser/navigation_throttle.h" | 12 #include "content/public/browser/navigation_throttle.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 class NavigationHandle; | 15 class NavigationHandle; |
15 } // namespace content | 16 } // namespace content |
16 | 17 |
17 namespace subresource_filter { | 18 namespace subresource_filter { |
18 | 19 |
19 class AsyncDocumentSubresourceFilter; | 20 class AsyncDocumentSubresourceFilter; |
(...skipping 19 matching lines...) Expand all Loading... |
39 override; | 40 override; |
40 const char* GetNameForLogging() override; | 41 const char* GetNameForLogging() override; |
41 | 42 |
42 private: | 43 private: |
43 content::NavigationThrottle::ThrottleCheckResult DeferToCalculateLoadPolicy(); | 44 content::NavigationThrottle::ThrottleCheckResult DeferToCalculateLoadPolicy(); |
44 void OnCalculatedLoadPolicy(LoadPolicy policy); | 45 void OnCalculatedLoadPolicy(LoadPolicy policy); |
45 | 46 |
46 // Must outlive this class. | 47 // Must outlive this class. |
47 AsyncDocumentSubresourceFilter* parent_frame_filter_; | 48 AsyncDocumentSubresourceFilter* parent_frame_filter_; |
48 | 49 |
| 50 base::TimeTicks last_defer_timestamp_; |
| 51 base::TimeDelta total_defer_time_; |
| 52 bool disallowed_ = false; |
| 53 |
49 base::WeakPtrFactory<SubframeNavigationFilteringThrottle> weak_ptr_factory_; | 54 base::WeakPtrFactory<SubframeNavigationFilteringThrottle> weak_ptr_factory_; |
50 | 55 |
51 DISALLOW_COPY_AND_ASSIGN(SubframeNavigationFilteringThrottle); | 56 DISALLOW_COPY_AND_ASSIGN(SubframeNavigationFilteringThrottle); |
52 }; | 57 }; |
53 | 58 |
54 } // namespace subresource_filter | 59 } // namespace subresource_filter |
55 | 60 |
56 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBFRAME_NAVIGATION_FIL
TERING_THROTTLE_H_ | 61 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBFRAME_NAVIGATION_FIL
TERING_THROTTLE_H_ |
OLD | NEW |