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 "content/browser/loader/layered_resource_handler.h" | 10 #include "content/browser/loader/layered_resource_handler.h" |
10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
11 #include "net/url_request/url_request_status.h" | 12 #include "net/url_request/url_request_status.h" |
12 | 13 |
13 namespace net { | 14 namespace net { |
14 class URLRequest; | 15 class URLRequest; |
15 } | 16 } |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 CONTENT_EXPORT static void SetLeakRequestsForTesting( | 53 CONTENT_EXPORT static void SetLeakRequestsForTesting( |
53 bool leak_requests_for_testing); | 54 bool leak_requests_for_testing); |
54 | 55 |
55 private: | 56 private: |
56 // Prepare to render the cross-site response in a new RenderViewHost, by | 57 // Prepare to render the cross-site response in a new RenderViewHost, by |
57 // telling the old RenderViewHost to run its onunload handler. | 58 // telling the old RenderViewHost to run its onunload handler. |
58 void StartCrossSiteTransition(int request_id, | 59 void StartCrossSiteTransition(int request_id, |
59 ResourceResponse* response, | 60 ResourceResponse* response, |
60 bool should_transfer); | 61 bool should_transfer); |
61 | 62 |
| 63 void ResumeOrTransfer(bool is_transfer); |
62 void ResumeIfDeferred(); | 64 void ResumeIfDeferred(); |
63 | 65 |
64 // Called when about to defer a request. Sets |did_defer_| and logs the | 66 // Called when about to defer a request. Sets |did_defer_| and logs the |
65 // defferral | 67 // defferral |
66 void OnDidDefer(); | 68 void OnDidDefer(); |
67 | 69 |
68 bool has_started_response_; | 70 bool has_started_response_; |
69 bool in_cross_site_transition_; | 71 bool in_cross_site_transition_; |
70 bool completed_during_transition_; | 72 bool completed_during_transition_; |
71 bool did_defer_; | 73 bool did_defer_; |
72 net::URLRequestStatus completed_status_; | 74 net::URLRequestStatus completed_status_; |
73 std::string completed_security_info_; | 75 std::string completed_security_info_; |
74 scoped_refptr<ResourceResponse> response_; | 76 scoped_refptr<ResourceResponse> response_; |
75 | 77 |
| 78 base::WeakPtrFactory<CrossSiteResourceHandler> weak_ptr_factory_; |
| 79 |
76 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); | 80 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); |
77 }; | 81 }; |
78 | 82 |
79 } // namespace content | 83 } // namespace content |
80 | 84 |
81 #endif // CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ | 85 #endif // CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ |
OLD | NEW |