| 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 "content/browser/renderer_host/sync_resource_handler.h" | 5 #include "content/browser/renderer_host/sync_resource_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/browser/debugger/devtools_netlog_observer.h" | 8 #include "content/browser/debugger/devtools_netlog_observer.h" |
| 9 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" | 9 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
| 10 #include "content/browser/renderer_host/resource_message_filter.h" | 10 #include "content/browser/renderer_host/resource_message_filter.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 int request_id, | 63 int request_id, |
| 64 ResourceResponse* response) { | 64 ResourceResponse* response) { |
| 65 net::URLRequest* request = rdh_->GetURLRequest( | 65 net::URLRequest* request = rdh_->GetURLRequest( |
| 66 GlobalRequestID(filter_->child_id(), request_id)); | 66 GlobalRequestID(filter_->child_id(), request_id)); |
| 67 if (rdh_->delegate()) | 67 if (rdh_->delegate()) |
| 68 rdh_->delegate()->OnResponseStarted(request, response, filter_); | 68 rdh_->delegate()->OnResponseStarted(request, response, filter_); |
| 69 | 69 |
| 70 DevToolsNetLogObserver::PopulateResponseInfo(request, response); | 70 DevToolsNetLogObserver::PopulateResponseInfo(request, response); |
| 71 | 71 |
| 72 // We don't care about copying the status here. | 72 // We don't care about copying the status here. |
| 73 result_.headers = response->headers; | 73 result_.headers = response->data.headers; |
| 74 result_.mime_type = response->mime_type; | 74 result_.mime_type = response->data.mime_type; |
| 75 result_.charset = response->charset; | 75 result_.charset = response->data.charset; |
| 76 result_.download_file_path = response->download_file_path; | 76 result_.download_file_path = response->data.download_file_path; |
| 77 result_.request_time = response->request_time; | 77 result_.request_time = response->data.request_time; |
| 78 result_.response_time = response->response_time; | 78 result_.response_time = response->data.response_time; |
| 79 result_.connection_id = response->connection_id; | 79 result_.connection_id = response->data.connection_id; |
| 80 result_.connection_reused = response->connection_reused; | 80 result_.connection_reused = response->data.connection_reused; |
| 81 result_.load_timing = response->load_timing; | 81 result_.load_timing = response->data.load_timing; |
| 82 result_.devtools_info = response->devtools_info; | 82 result_.devtools_info = response->data.devtools_info; |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool SyncResourceHandler::OnWillStart(int request_id, | 86 bool SyncResourceHandler::OnWillStart(int request_id, |
| 87 const GURL& url, | 87 const GURL& url, |
| 88 bool* defer) { | 88 bool* defer) { |
| 89 return true; | 89 return true; |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool SyncResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf, | 92 bool SyncResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 123 | 123 |
| 124 void SyncResourceHandler::OnRequestClosed() { | 124 void SyncResourceHandler::OnRequestClosed() { |
| 125 if (!result_message_) | 125 if (!result_message_) |
| 126 return; | 126 return; |
| 127 | 127 |
| 128 result_message_->set_reply_error(); | 128 result_message_->set_reply_error(); |
| 129 filter_->Send(result_message_); | 129 filter_->Send(result_message_); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace content | 132 } // namespace content |
| OLD | NEW |