OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/sync_resource_handler.h" | 5 #include "chrome/browser/renderer_host/sync_resource_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/net/load_timing_observer.h" | 8 #include "chrome/browser/net/load_timing_observer.h" |
9 #include "chrome/browser/renderer_host/global_request_id.h" | 9 #include "chrome/browser/renderer_host/global_request_id.h" |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 bool SyncResourceHandler::OnResponseStarted(int request_id, | 56 bool SyncResourceHandler::OnResponseStarted(int request_id, |
57 ResourceResponse* response) { | 57 ResourceResponse* response) { |
58 URLRequest* request = rdh_->GetURLRequest( | 58 URLRequest* request = rdh_->GetURLRequest( |
59 GlobalRequestID(process_id_, request_id)); | 59 GlobalRequestID(process_id_, request_id)); |
60 LoadTimingObserver::PopulateTimingInfo(request, response); | 60 LoadTimingObserver::PopulateTimingInfo(request, response); |
61 | 61 |
62 // We don't care about copying the status here. | 62 // We don't care about copying the status here. |
63 result_.headers = response->response_head.headers; | 63 result_.headers = response->response_head.headers; |
64 result_.mime_type = response->response_head.mime_type; | 64 result_.mime_type = response->response_head.mime_type; |
65 result_.charset = response->response_head.charset; | 65 result_.charset = response->response_head.charset; |
| 66 result_.download_file_path = response->response_head.download_file_path; |
66 result_.request_time = response->response_head.request_time; | 67 result_.request_time = response->response_head.request_time; |
67 result_.response_time = response->response_head.response_time; | 68 result_.response_time = response->response_head.response_time; |
68 result_.connection_id = response->response_head.connection_id; | 69 result_.connection_id = response->response_head.connection_id; |
69 result_.connection_reused = response->response_head.connection_reused; | 70 result_.connection_reused = response->response_head.connection_reused; |
70 result_.load_timing = response->response_head.load_timing; | 71 result_.load_timing = response->response_head.load_timing; |
71 return true; | 72 return true; |
72 } | 73 } |
73 | 74 |
74 bool SyncResourceHandler::OnWillStart(int request_id, | 75 bool SyncResourceHandler::OnWillStart(int request_id, |
75 const GURL& url, | 76 const GURL& url, |
(...skipping 29 matching lines...) Expand all Loading... |
105 } | 106 } |
106 | 107 |
107 void SyncResourceHandler::OnRequestClosed() { | 108 void SyncResourceHandler::OnRequestClosed() { |
108 if (!result_message_) | 109 if (!result_message_) |
109 return; | 110 return; |
110 | 111 |
111 result_message_->set_reply_error(); | 112 result_message_->set_reply_error(); |
112 receiver_->Send(result_message_); | 113 receiver_->Send(result_message_); |
113 receiver_ = NULL; // URLRequest is gone, and perhaps also the receiver. | 114 receiver_ = NULL; // URLRequest is gone, and perhaps also the receiver. |
114 } | 115 } |
OLD | NEW |