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 #include "chrome/browser/renderer_host/cross_site_resource_handler.h" | 5 #include "chrome/browser/renderer_host/cross_site_resource_handler.h" |
6 | 6 |
7 #include "chrome/browser/renderer_host/render_view_host.h" | 7 #include "chrome/browser/renderer_host/render_view_host.h" |
8 #include "chrome/browser/tab_contents/tab_util.h" | 8 #include "chrome/browser/tab_contents/tab_util.h" |
9 #include "chrome/browser/tab_contents/web_contents.h" | 9 #include "chrome/browser/tab_contents/web_contents.h" |
10 | 10 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 if (info->is_download) { | 107 if (info->is_download) { |
108 return next_handler_->OnResponseStarted(request_id, response); | 108 return next_handler_->OnResponseStarted(request_id, response); |
109 } | 109 } |
110 | 110 |
111 // Tell the renderer to run the onunload event handler, and wait for the | 111 // Tell the renderer to run the onunload event handler, and wait for the |
112 // reply. | 112 // reply. |
113 StartCrossSiteTransition(request_id, response, global_id); | 113 StartCrossSiteTransition(request_id, response, global_id); |
114 return true; | 114 return true; |
115 } | 115 } |
116 | 116 |
117 bool CrossSiteResourceHandler::OnWillRead(int request_id, | 117 bool CrossSiteResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf, |
118 char** buf, int* buf_size, | 118 int* buf_size, int min_size) { |
119 int min_size) { | |
120 return next_handler_->OnWillRead(request_id, buf, buf_size, min_size); | 119 return next_handler_->OnWillRead(request_id, buf, buf_size, min_size); |
121 } | 120 } |
122 | 121 |
123 bool CrossSiteResourceHandler::OnReadCompleted(int request_id, | 122 bool CrossSiteResourceHandler::OnReadCompleted(int request_id, |
124 int* bytes_read) { | 123 int* bytes_read) { |
125 if (!in_cross_site_transition_) { | 124 if (!in_cross_site_transition_) { |
126 return next_handler_->OnReadCompleted(request_id, bytes_read); | 125 return next_handler_->OnReadCompleted(request_id, bytes_read); |
127 } | 126 } |
128 return true; | 127 return true; |
129 } | 128 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 242 |
244 // Tell the tab responsible for this request that a cross-site response is | 243 // Tell the tab responsible for this request that a cross-site response is |
245 // starting, so that it can tell its old renderer to run its onunload | 244 // starting, so that it can tell its old renderer to run its onunload |
246 // handler now. We will wait to hear the corresponding ClosePage_ACK. | 245 // handler now. We will wait to hear the corresponding ClosePage_ACK. |
247 CrossSiteNotifyTabTask* task = | 246 CrossSiteNotifyTabTask* task = |
248 new CrossSiteNotifyTabTask(render_process_host_id_, | 247 new CrossSiteNotifyTabTask(render_process_host_id_, |
249 render_view_id_, | 248 render_view_id_, |
250 request_id); | 249 request_id); |
251 rdh_->ui_loop()->PostTask(FROM_HERE, task); | 250 rdh_->ui_loop()->PostTask(FROM_HERE, task); |
252 } | 251 } |
OLD | NEW |