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 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "content/browser/renderer_host/cross_site_resource_handler.h" | 7 #include "content/browser/renderer_host/cross_site_resource_handler.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "content/browser/renderer_host/render_view_host.h" | 11 #include "content/browser/renderer_host/render_view_host.h" |
12 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 12 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
13 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 13 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/browser/global_request_id.h" | 15 #include "content/public/browser/global_request_id.h" |
16 #include "content/public/browser/render_view_host_delegate.h" | 16 #include "content/public/browser/render_view_host_delegate.h" |
17 #include "content/public/common/resource_response.h" | 17 #include "content/public/common/resource_response.h" |
18 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
19 #include "net/http/http_response_headers.h" | 19 #include "net/http/http_response_headers.h" |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 void OnCrossSiteResponseHelper(int render_process_id, | 25 void OnCrossSiteResponseHelper(int render_process_id, |
26 int render_view_id, | 26 int render_view_id, |
27 int request_id) { | 27 int request_id) { |
28 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, | 28 RenderViewHostImpl* rvh = RenderViewHostImpl::FromID(render_process_id, |
29 render_view_id); | 29 render_view_id); |
30 if (rvh && rvh->delegate()->GetRendererManagementDelegate()) { | 30 if (rvh && rvh->GetDelegate()->GetRendererManagementDelegate()) { |
31 rvh->delegate()->GetRendererManagementDelegate()->OnCrossSiteResponse( | 31 rvh->GetDelegate()->GetRendererManagementDelegate()->OnCrossSiteResponse( |
32 render_process_id, request_id); | 32 render_process_id, request_id); |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
36 } // namespace | 36 } // namespace |
37 | 37 |
38 CrossSiteResourceHandler::CrossSiteResourceHandler( | 38 CrossSiteResourceHandler::CrossSiteResourceHandler( |
39 ResourceHandler* handler, | 39 ResourceHandler* handler, |
40 int render_process_host_id, | 40 int render_process_host_id, |
41 int render_view_id, | 41 int render_view_id, |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 &OnCrossSiteResponseHelper, | 225 &OnCrossSiteResponseHelper, |
226 render_process_host_id_, | 226 render_process_host_id_, |
227 render_view_id_, | 227 render_view_id_, |
228 request_id)); | 228 request_id)); |
229 | 229 |
230 // TODO(creis): If the above call should fail, then we need to notify the IO | 230 // TODO(creis): If the above call should fail, then we need to notify the IO |
231 // thread to proceed anyway, using ResourceDispatcherHost::OnClosePageACK. | 231 // thread to proceed anyway, using ResourceDispatcherHost::OnClosePageACK. |
232 } | 232 } |
233 | 233 |
234 } // namespace content | 234 } // namespace content |
OLD | NEW |