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/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 net::URLRequest* request); | 37 net::URLRequest* request); |
38 ~CrossSiteResourceHandler() override; | 38 ~CrossSiteResourceHandler() override; |
39 | 39 |
40 // ResourceHandler implementation: | 40 // ResourceHandler implementation: |
41 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | 41 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
42 ResourceResponse* response, | 42 ResourceResponse* response, |
43 bool* defer) override; | 43 bool* defer) override; |
44 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; | 44 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; |
45 bool OnReadCompleted(int bytes_read, bool* defer) override; | 45 bool OnReadCompleted(int bytes_read, bool* defer) override; |
46 void OnResponseCompleted(const net::URLRequestStatus& status, | 46 void OnResponseCompleted(const net::URLRequestStatus& status, |
47 const std::string& security_info, | |
48 bool* defer) override; | 47 bool* defer) override; |
49 | 48 |
50 // We can now send the response to the new renderer, which will cause | 49 // We can now send the response to the new renderer, which will cause |
51 // WebContentsImpl to swap in the new renderer and destroy the old one. | 50 // WebContentsImpl to swap in the new renderer and destroy the old one. |
52 void ResumeResponse(); | 51 void ResumeResponse(); |
53 | 52 |
54 // When set to true, requests are leaked when they can't be passed to a | 53 // When set to true, requests are leaked when they can't be passed to a |
55 // RenderViewHost, for unit tests. | 54 // RenderViewHost, for unit tests. |
56 CONTENT_EXPORT static void SetLeakRequestsForTesting( | 55 CONTENT_EXPORT static void SetLeakRequestsForTesting( |
57 bool leak_requests_for_testing); | 56 bool leak_requests_for_testing); |
(...skipping 17 matching lines...) Expand all Loading... |
75 | 74 |
76 // Called when about to defer a request. Sets |did_defer_| and logs the | 75 // Called when about to defer a request. Sets |did_defer_| and logs the |
77 // defferral | 76 // defferral |
78 void OnDidDefer(); | 77 void OnDidDefer(); |
79 | 78 |
80 bool has_started_response_; | 79 bool has_started_response_; |
81 bool in_cross_site_transition_; | 80 bool in_cross_site_transition_; |
82 bool completed_during_transition_; | 81 bool completed_during_transition_; |
83 bool did_defer_; | 82 bool did_defer_; |
84 net::URLRequestStatus completed_status_; | 83 net::URLRequestStatus completed_status_; |
85 std::string completed_security_info_; | |
86 scoped_refptr<ResourceResponse> response_; | 84 scoped_refptr<ResourceResponse> response_; |
87 | 85 |
88 // TODO(nasko): WeakPtr is needed in --site-per-process, since all navigations | 86 // TODO(nasko): WeakPtr is needed in --site-per-process, since all navigations |
89 // are deferred to the UI thread and come back to IO thread via | 87 // are deferred to the UI thread and come back to IO thread via |
90 // PostTaskAndReplyWithResult. If a transfer is needed, it goes back to the UI | 88 // PostTaskAndReplyWithResult. If a transfer is needed, it goes back to the UI |
91 // thread. This can be removed once the code is changed to only do one hop. | 89 // thread. This can be removed once the code is changed to only do one hop. |
92 base::WeakPtrFactory<CrossSiteResourceHandler> weak_ptr_factory_; | 90 base::WeakPtrFactory<CrossSiteResourceHandler> weak_ptr_factory_; |
93 | 91 |
94 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); | 92 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); |
95 }; | 93 }; |
96 | 94 |
97 } // namespace content | 95 } // namespace content |
98 | 96 |
99 #endif // CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ | 97 #endif // CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ |
OLD | NEW |