OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/resource_handler.h" | 9 #include "content/browser/renderer_host/resource_handler.h" |
10 #include "net/url_request/url_request_status.h" | 10 #include "net/url_request/url_request_status.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 int render_process_host_id, | 23 int render_process_host_id, |
24 int render_view_id, | 24 int render_view_id, |
25 ResourceDispatcherHost* resource_dispatcher_host); | 25 ResourceDispatcherHost* resource_dispatcher_host); |
26 | 26 |
27 // ResourceHandler implementation: | 27 // ResourceHandler implementation: |
28 virtual bool OnUploadProgress(int request_id, | 28 virtual bool OnUploadProgress(int request_id, |
29 uint64 position, | 29 uint64 position, |
30 uint64 size) OVERRIDE; | 30 uint64 size) OVERRIDE; |
31 virtual bool OnRequestRedirected(int request_id, | 31 virtual bool OnRequestRedirected(int request_id, |
32 const GURL& new_url, | 32 const GURL& new_url, |
33 ResourceResponse* response, | 33 content::ResourceResponse* response, |
34 bool* defer) OVERRIDE; | 34 bool* defer) OVERRIDE; |
35 virtual bool OnResponseStarted(int request_id, | 35 virtual bool OnResponseStarted(int request_id, |
36 ResourceResponse* response) OVERRIDE; | 36 content::ResourceResponse* response) OVERRIDE; |
37 virtual bool OnWillStart(int request_id, | 37 virtual bool OnWillStart(int request_id, |
38 const GURL& url, | 38 const GURL& url, |
39 bool* defer) OVERRIDE; | 39 bool* defer) OVERRIDE; |
40 virtual bool OnWillRead(int request_id, | 40 virtual bool OnWillRead(int request_id, |
41 net::IOBuffer** buf, | 41 net::IOBuffer** buf, |
42 int* buf_size, | 42 int* buf_size, |
43 int min_size) OVERRIDE; | 43 int min_size) OVERRIDE; |
44 virtual bool OnReadCompleted(int request_id, | 44 virtual bool OnReadCompleted(int request_id, |
45 int* bytes_read) OVERRIDE; | 45 int* bytes_read) OVERRIDE; |
46 virtual bool OnResponseCompleted(int request_id, | 46 virtual bool OnResponseCompleted(int request_id, |
47 const net::URLRequestStatus& status, | 47 const net::URLRequestStatus& status, |
48 const std::string& security_info) OVERRIDE; | 48 const std::string& security_info) OVERRIDE; |
49 virtual void OnRequestClosed() OVERRIDE; | 49 virtual void OnRequestClosed() OVERRIDE; |
50 | 50 |
51 // We can now send the response to the new renderer, which will cause | 51 // We can now send the response to the new renderer, which will cause |
52 // TabContents to swap in the new renderer and destroy the old one. | 52 // TabContents to swap in the new renderer and destroy the old one. |
53 void ResumeResponse(); | 53 void ResumeResponse(); |
54 | 54 |
55 private: | 55 private: |
56 virtual ~CrossSiteResourceHandler(); | 56 virtual ~CrossSiteResourceHandler(); |
57 | 57 |
58 // Prepare to render the cross-site response in a new RenderViewHost, by | 58 // Prepare to render the cross-site response in a new RenderViewHost, by |
59 // telling the old RenderViewHost to run its onunload handler. | 59 // telling the old RenderViewHost to run its onunload handler. |
60 void StartCrossSiteTransition( | 60 void StartCrossSiteTransition( |
61 int request_id, | 61 int request_id, |
62 ResourceResponse* response, | 62 content::ResourceResponse* response, |
63 const GlobalRequestID& global_id); | 63 const GlobalRequestID& global_id); |
64 | 64 |
65 scoped_refptr<ResourceHandler> next_handler_; | 65 scoped_refptr<ResourceHandler> next_handler_; |
66 int render_process_host_id_; | 66 int render_process_host_id_; |
67 int render_view_id_; | 67 int render_view_id_; |
68 bool has_started_response_; | 68 bool has_started_response_; |
69 bool in_cross_site_transition_; | 69 bool in_cross_site_transition_; |
70 int request_id_; | 70 int request_id_; |
71 bool completed_during_transition_; | 71 bool completed_during_transition_; |
72 net::URLRequestStatus completed_status_; | 72 net::URLRequestStatus completed_status_; |
73 std::string completed_security_info_; | 73 std::string completed_security_info_; |
74 ResourceResponse* response_; | 74 content::ResourceResponse* response_; |
75 ResourceDispatcherHost* rdh_; | 75 ResourceDispatcherHost* rdh_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); | 77 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); |
78 }; | 78 }; |
79 | 79 |
80 #endif // CONTENT_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ | 80 #endif // CONTENT_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ |
OLD | NEW |