OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CROSS_SITE_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ |
6 #define CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "content/browser/loader/layered_resource_handler.h" | 10 #include "content/browser/loader/layered_resource_handler.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // We can now send the response to the new renderer, which will cause | 43 // We can now send the response to the new renderer, which will cause |
44 // WebContentsImpl to swap in the new renderer and destroy the old one. | 44 // WebContentsImpl to swap in the new renderer and destroy the old one. |
45 void ResumeResponse(); | 45 void ResumeResponse(); |
46 | 46 |
47 // When set to true, requests are leaked when they can't be passed to a | 47 // When set to true, requests are leaked when they can't be passed to a |
48 // RenderViewHost, for unit tests. | 48 // RenderViewHost, for unit tests. |
49 CONTENT_EXPORT static void SetLeakRequestsForTesting( | 49 CONTENT_EXPORT static void SetLeakRequestsForTesting( |
50 bool leak_requests_for_testing); | 50 bool leak_requests_for_testing); |
51 | 51 |
52 // Returns whether the handler is deferred. | |
53 bool did_defer_for_testing() const { return did_defer_; } | |
54 | |
55 private: | 52 private: |
56 // Prepare to transfer the cross-site response to a new RenderFrameHost, by | 53 // Prepare to transfer the cross-site response to a new RenderFrameHost, by |
57 // asking it to issue an identical request (on the UI thread). | 54 // asking it to issue an identical request (on the UI thread). |
58 void StartCrossSiteTransition(ResourceResponse* response); | 55 void StartCrossSiteTransition(ResourceResponse* response); |
59 | 56 |
60 // Defer the navigation to the UI thread to check whether transfer is required | 57 // Defer the navigation to the UI thread to check whether transfer is required |
61 // or not. Currently only used in --site-per-process. | 58 // or not. Currently only used in --site-per-process. |
62 bool DeferForNavigationPolicyCheck(ResourceRequestInfoImpl* info, | 59 bool DeferForNavigationPolicyCheck(ResourceRequestInfoImpl* info, |
63 ResourceResponse* response, | 60 ResourceResponse* response, |
64 bool* defer); | 61 bool* defer); |
(...skipping 21 matching lines...) Expand all Loading... |
86 // PostTaskAndReplyWithResult. If a transfer is needed, it goes back to the UI | 83 // PostTaskAndReplyWithResult. If a transfer is needed, it goes back to the UI |
87 // thread. This can be removed once the code is changed to only do one hop. | 84 // thread. This can be removed once the code is changed to only do one hop. |
88 base::WeakPtrFactory<CrossSiteResourceHandler> weak_ptr_factory_; | 85 base::WeakPtrFactory<CrossSiteResourceHandler> weak_ptr_factory_; |
89 | 86 |
90 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); | 87 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); |
91 }; | 88 }; |
92 | 89 |
93 } // namespace content | 90 } // namespace content |
94 | 91 |
95 #endif // CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ | 92 #endif // CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ |
OLD | NEW |