| 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_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/browser/renderer_host/layered_resource_handler.h" | 9 #include "content/browser/renderer_host/layered_resource_handler.h" |
| 10 #include "net/url_request/url_request_status.h" | 10 #include "net/url_request/url_request_status.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 int render_process_host_id, | 24 int render_process_host_id, |
| 25 int render_view_id, | 25 int render_view_id, |
| 26 ResourceDispatcherHostImpl* rdh); | 26 ResourceDispatcherHostImpl* rdh); |
| 27 | 27 |
| 28 // ResourceHandler implementation: | 28 // ResourceHandler implementation: |
| 29 virtual bool OnRequestRedirected(int request_id, | 29 virtual bool OnRequestRedirected(int request_id, |
| 30 const GURL& new_url, | 30 const GURL& new_url, |
| 31 ResourceResponse* response, | 31 ResourceResponse* response, |
| 32 bool* defer) OVERRIDE; | 32 bool* defer) OVERRIDE; |
| 33 virtual bool OnResponseStarted(int request_id, | 33 virtual bool OnResponseStarted(int request_id, |
| 34 ResourceResponse* response) OVERRIDE; | 34 ResourceResponse* response, |
| 35 bool* defer) OVERRIDE; |
| 35 virtual bool OnReadCompleted(int request_id, | 36 virtual bool OnReadCompleted(int request_id, |
| 36 int* bytes_read) OVERRIDE; | 37 int* bytes_read, |
| 38 bool* defer) OVERRIDE; |
| 37 virtual bool OnResponseCompleted(int request_id, | 39 virtual bool OnResponseCompleted(int request_id, |
| 38 const net::URLRequestStatus& status, | 40 const net::URLRequestStatus& status, |
| 39 const std::string& security_info) OVERRIDE; | 41 const std::string& security_info) OVERRIDE; |
| 40 | 42 |
| 41 // 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 |
| 42 // 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. |
| 43 void ResumeResponse(); | 45 void ResumeResponse(); |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 virtual ~CrossSiteResourceHandler(); | 48 virtual ~CrossSiteResourceHandler(); |
| 47 | 49 |
| 48 // Prepare to render the cross-site response in a new RenderViewHost, by | 50 // Prepare to render the cross-site response in a new RenderViewHost, by |
| 49 // telling the old RenderViewHost to run its onunload handler. | 51 // telling the old RenderViewHost to run its onunload handler. |
| 50 void StartCrossSiteTransition( | 52 void StartCrossSiteTransition( |
| 51 int request_id, | 53 int request_id, |
| 52 ResourceResponse* response, | 54 ResourceResponse* response, |
| 53 const GlobalRequestID& global_id); | 55 const GlobalRequestID& global_id, |
| 56 bool* defer); |
| 54 | 57 |
| 55 int render_process_host_id_; | 58 int render_process_host_id_; |
| 56 int render_view_id_; | 59 int render_view_id_; |
| 57 bool has_started_response_; | 60 bool has_started_response_; |
| 58 bool in_cross_site_transition_; | 61 bool in_cross_site_transition_; |
| 59 int request_id_; | 62 int request_id_; |
| 60 bool completed_during_transition_; | 63 bool completed_during_transition_; |
| 61 net::URLRequestStatus completed_status_; | 64 net::URLRequestStatus completed_status_; |
| 62 std::string completed_security_info_; | 65 std::string completed_security_info_; |
| 63 ResourceResponse* response_; | 66 ResourceResponse* response_; |
| 64 ResourceDispatcherHostImpl* rdh_; | 67 ResourceDispatcherHostImpl* rdh_; |
| 65 | 68 |
| 66 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); | 69 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 } // namespace content | 72 } // namespace content |
| 70 | 73 |
| 71 #endif // CONTENT_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ | 74 #endif // CONTENT_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ |
| OLD | NEW |