OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_ |
6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_ | 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_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 "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 void WillRedirectRequest(const net::RedirectInfo& redirect_info, | 35 void WillRedirectRequest(const net::RedirectInfo& redirect_info, |
36 bool* defer) override; | 36 bool* defer) override; |
37 void WillProcessResponse(bool* defer) override; | 37 void WillProcessResponse(bool* defer) override; |
38 const char* GetNameForLogging() const override; | 38 const char* GetNameForLogging() const override; |
39 | 39 |
40 // Used in unit tests to make UI checks pass when they would fail due to no | 40 // Used in unit tests to make UI checks pass when they would fail due to no |
41 // NavigationHandle being present in the RenderFrameHost. | 41 // NavigationHandle being present in the RenderFrameHost. |
42 CONTENT_EXPORT static void set_ui_checks_always_succeed_for_testing( | 42 CONTENT_EXPORT static void set_ui_checks_always_succeed_for_testing( |
43 bool ui_checks_always_succeed); | 43 bool ui_checks_always_succeed); |
44 | 44 |
| 45 // Used in unit tests to make all navigations transfer. |
| 46 CONTENT_EXPORT static void set_force_transfer_for_testing( |
| 47 bool force_transfer); |
| 48 |
45 private: | 49 private: |
46 void OnUIChecksPerformed(NavigationThrottle::ThrottleCheckResult result); | 50 void OnUIChecksPerformed(NavigationThrottle::ThrottleCheckResult result); |
47 | 51 |
| 52 // Used in transfer navigations. |
| 53 void InitiateTransfer(); |
| 54 void OnTransferComplete(); |
| 55 |
48 net::URLRequest* request_; | 56 net::URLRequest* request_; |
49 ResourceDispatcherHostDelegate* resource_dispatcher_host_delegate_; | 57 ResourceDispatcherHostDelegate* resource_dispatcher_host_delegate_; |
50 RequestContextType request_context_type_; | 58 RequestContextType request_context_type_; |
| 59 bool in_cross_site_transition_; |
| 60 NavigationThrottle::ThrottleCheckResult on_transfer_done_result_; |
| 61 |
51 base::WeakPtrFactory<NavigationResourceThrottle> weak_ptr_factory_; | 62 base::WeakPtrFactory<NavigationResourceThrottle> weak_ptr_factory_; |
52 | 63 |
53 DISALLOW_COPY_AND_ASSIGN(NavigationResourceThrottle); | 64 DISALLOW_COPY_AND_ASSIGN(NavigationResourceThrottle); |
54 }; | 65 }; |
55 | 66 |
56 } // namespace content | 67 } // namespace content |
57 | 68 |
58 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_ | 69 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_ |
OLD | NEW |