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/public/browser/navigation_throttle.h" | 11 #include "content/public/browser/navigation_throttle.h" |
11 #include "content/public/browser/resource_throttle.h" | 12 #include "content/public/browser/resource_throttle.h" |
12 #include "content/public/common/request_context_type.h" | 13 #include "content/public/common/request_context_type.h" |
13 | 14 |
14 namespace net { | 15 namespace net { |
15 class URLRequest; | 16 class URLRequest; |
16 } | 17 } |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 class CertStore; | 20 class CertStore; |
(...skipping 11 matching lines...) Expand all Loading... | |
31 RequestContextType request_context_type); | 32 RequestContextType request_context_type); |
32 ~NavigationResourceThrottle() override; | 33 ~NavigationResourceThrottle() override; |
33 | 34 |
34 // ResourceThrottle overrides: | 35 // ResourceThrottle overrides: |
35 void WillStartRequest(bool* defer) override; | 36 void WillStartRequest(bool* defer) override; |
36 void WillRedirectRequest(const net::RedirectInfo& redirect_info, | 37 void WillRedirectRequest(const net::RedirectInfo& redirect_info, |
37 bool* defer) override; | 38 bool* defer) override; |
38 void WillProcessResponse(bool* defer) override; | 39 void WillProcessResponse(bool* defer) override; |
39 const char* GetNameForLogging() const override; | 40 const char* GetNameForLogging() const override; |
40 | 41 |
42 // Used in unit tests to make UI checks pass when they would fail due to no | |
43 // NavigationHandle being present in the RenderFrameHost. | |
44 CONTENT_EXPORT static void SetUIChecksAlwaysSuccedForTesting( | |
45 bool ui_checks_always_succeed); | |
46 | |
47 // Used in unit tests to make all navigations transfer. | |
48 CONTENT_EXPORT static void SetForceTransferForTesting( | |
49 bool force_transfer); | |
50 | |
41 private: | 51 private: |
42 void OnUIChecksPerformed(NavigationThrottle::ThrottleCheckResult result); | 52 void OnUIChecksPerformed(NavigationThrottle::ThrottleCheckResult result); |
43 | 53 |
54 // Used in transfer navigations. | |
55 void InitiateTransfer(); | |
56 void OnTransferDone(); | |
nasko
2016/09/08 23:45:39
nit: OnTransferComplete?
clamy
2016/09/09 15:06:41
Done.
| |
57 | |
44 net::URLRequest* request_; | 58 net::URLRequest* request_; |
45 ResourceDispatcherHostDelegate* resource_dispatcher_host_delegate_; | 59 ResourceDispatcherHostDelegate* resource_dispatcher_host_delegate_; |
46 CertStore* cert_store_; | 60 CertStore* cert_store_; |
47 RequestContextType request_context_type_; | 61 RequestContextType request_context_type_; |
62 bool in_cross_site_transition_; | |
63 NavigationThrottle::ThrottleCheckResult on_transfer_done_result_; | |
64 | |
48 base::WeakPtrFactory<NavigationResourceThrottle> weak_ptr_factory_; | 65 base::WeakPtrFactory<NavigationResourceThrottle> weak_ptr_factory_; |
49 | 66 |
50 DISALLOW_COPY_AND_ASSIGN(NavigationResourceThrottle); | 67 DISALLOW_COPY_AND_ASSIGN(NavigationResourceThrottle); |
51 }; | 68 }; |
52 | 69 |
53 } // namespace content | 70 } // namespace content |
54 | 71 |
55 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_ | 72 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_ |
OLD | NEW |