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; | |
67 result_.request_time = response->response_head.request_time; | 66 result_.request_time = response->response_head.request_time; |
68 result_.response_time = response->response_head.response_time; | 67 result_.response_time = response->response_head.response_time; |
69 result_.connection_id = response->response_head.connection_id; | 68 result_.connection_id = response->response_head.connection_id; |
70 result_.connection_reused = response->response_head.connection_reused; | 69 result_.connection_reused = response->response_head.connection_reused; |
71 result_.load_timing = response->response_head.load_timing; | 70 result_.load_timing = response->response_head.load_timing; |
72 return true; | 71 return true; |
73 } | 72 } |
74 | 73 |
75 bool SyncResourceHandler::OnWillStart(int request_id, | 74 bool SyncResourceHandler::OnWillStart(int request_id, |
76 const GURL& url, | 75 const GURL& url, |
(...skipping 29 matching lines...) Expand all Loading... |
106 } | 105 } |
107 | 106 |
108 void SyncResourceHandler::OnRequestClosed() { | 107 void SyncResourceHandler::OnRequestClosed() { |
109 if (!result_message_) | 108 if (!result_message_) |
110 return; | 109 return; |
111 | 110 |
112 result_message_->set_reply_error(); | 111 result_message_->set_reply_error(); |
113 receiver_->Send(result_message_); | 112 receiver_->Send(result_message_); |
114 receiver_ = NULL; // URLRequest is gone, and perhaps also the receiver. | 113 receiver_ = NULL; // URLRequest is gone, and perhaps also the receiver. |
115 } | 114 } |
OLD | NEW |