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 #include "chrome/browser/automation/url_request_automation_job.h" | 5 #include "chrome/browser/automation/url_request_automation_job.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/automation/automation_resource_message_filter.h" | 10 #include "chrome/browser/automation/automation_resource_message_filter.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 bool scheme_is_https = request->url().SchemeIs("https"); | 98 bool scheme_is_https = request->url().SchemeIs("https"); |
99 | 99 |
100 // Returning null here just means that the built-in handler will be used. | 100 // Returning null here just means that the built-in handler will be used. |
101 if (scheme_is_http || scheme_is_https) { | 101 if (scheme_is_http || scheme_is_https) { |
102 ResourceDispatcherHostRequestInfo* request_info = NULL; | 102 ResourceDispatcherHostRequestInfo* request_info = NULL; |
103 if (request->GetUserData(NULL)) | 103 if (request->GetUserData(NULL)) |
104 request_info = ResourceDispatcherHost::InfoForRequest(request); | 104 request_info = ResourceDispatcherHost::InfoForRequest(request); |
105 if (request_info) { | 105 if (request_info) { |
106 int child_id = request_info->child_id(); | 106 int child_id = request_info->child_id(); |
107 int route_id = request_info->route_id(); | 107 int route_id = request_info->route_id(); |
108 | |
109 if (request_info->process_type() == ChildProcessInfo::PLUGIN_PROCESS) { | |
110 child_id = request_info->host_renderer_id(); | |
111 route_id = request_info->host_render_view_id(); | |
112 } | |
113 | |
114 AutomationResourceMessageFilter::AutomationDetails details; | 108 AutomationResourceMessageFilter::AutomationDetails details; |
115 if (AutomationResourceMessageFilter::LookupRegisteredRenderView( | 109 if (AutomationResourceMessageFilter::LookupRegisteredRenderView( |
116 child_id, route_id, &details)) { | 110 child_id, route_id, &details)) { |
117 URLRequestAutomationJob* job = new URLRequestAutomationJob(request, | 111 URLRequestAutomationJob* job = new URLRequestAutomationJob(request, |
118 details.tab_handle, request_info->request_id(), details.filter, | 112 details.tab_handle, request_info->request_id(), details.filter, |
119 details.is_pending_render_view); | 113 details.is_pending_render_view); |
120 return job; | 114 return job; |
121 } | 115 } |
122 } | 116 } |
123 | 117 |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 if (!is_done()) { | 482 if (!is_done()) { |
489 NotifyDone(request_status_); | 483 NotifyDone(request_status_); |
490 } | 484 } |
491 // Reset any pending reads. | 485 // Reset any pending reads. |
492 if (pending_buf_) { | 486 if (pending_buf_) { |
493 pending_buf_ = NULL; | 487 pending_buf_ = NULL; |
494 pending_buf_size_ = 0; | 488 pending_buf_size_ = 0; |
495 NotifyReadComplete(0); | 489 NotifyReadComplete(0); |
496 } | 490 } |
497 } | 491 } |
OLD | NEW |