| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | |
| 9 #include "chrome/browser/renderer_host/resource_handler.h" | 8 #include "chrome/browser/renderer_host/resource_handler.h" |
| 10 | 9 |
| 10 class ResourceDispatcherHost; |
| 11 struct GlobalRequestID; |
| 12 |
| 11 // Ensures that cross-site responses are delayed until the onunload handler of | 13 // Ensures that cross-site responses are delayed until the onunload handler of |
| 12 // the previous page is allowed to run. This handler wraps an | 14 // the previous page is allowed to run. This handler wraps an |
| 13 // AsyncEventHandler, and it sits inside SafeBrowsing and Buffered event | 15 // AsyncEventHandler, and it sits inside SafeBrowsing and Buffered event |
| 14 // handlers. This is important, so that it can intercept OnResponseStarted | 16 // handlers. This is important, so that it can intercept OnResponseStarted |
| 15 // after we determine that a response is safe and not a download. | 17 // after we determine that a response is safe and not a download. |
| 16 class CrossSiteResourceHandler : public ResourceHandler { | 18 class CrossSiteResourceHandler : public ResourceHandler { |
| 17 public: | 19 public: |
| 18 CrossSiteResourceHandler(ResourceHandler* handler, | 20 CrossSiteResourceHandler(ResourceHandler* handler, |
| 19 int render_process_host_id, | 21 int render_process_host_id, |
| 20 int render_view_id, | 22 int render_view_id, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 37 void ResumeResponse(); | 39 void ResumeResponse(); |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 ~CrossSiteResourceHandler() {} | 42 ~CrossSiteResourceHandler() {} |
| 41 | 43 |
| 42 // Prepare to render the cross-site response in a new RenderViewHost, by | 44 // Prepare to render the cross-site response in a new RenderViewHost, by |
| 43 // telling the old RenderViewHost to run its onunload handler. | 45 // telling the old RenderViewHost to run its onunload handler. |
| 44 void StartCrossSiteTransition( | 46 void StartCrossSiteTransition( |
| 45 int request_id, | 47 int request_id, |
| 46 ResourceResponse* response, | 48 ResourceResponse* response, |
| 47 ResourceDispatcherHost::GlobalRequestID global_id); | 49 const GlobalRequestID& global_id); |
| 48 | 50 |
| 49 scoped_refptr<ResourceHandler> next_handler_; | 51 scoped_refptr<ResourceHandler> next_handler_; |
| 50 int render_process_host_id_; | 52 int render_process_host_id_; |
| 51 int render_view_id_; | 53 int render_view_id_; |
| 52 bool has_started_response_; | 54 bool has_started_response_; |
| 53 bool in_cross_site_transition_; | 55 bool in_cross_site_transition_; |
| 54 int request_id_; | 56 int request_id_; |
| 55 bool completed_during_transition_; | 57 bool completed_during_transition_; |
| 56 URLRequestStatus completed_status_; | 58 URLRequestStatus completed_status_; |
| 57 std::string completed_security_info_; | 59 std::string completed_security_info_; |
| 58 ResourceResponse* response_; | 60 ResourceResponse* response_; |
| 59 ResourceDispatcherHost* rdh_; | 61 ResourceDispatcherHost* rdh_; |
| 60 | 62 |
| 61 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); | 63 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 #endif // CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ | 66 #endif // CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ |
| OLD | NEW |