Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(612)

Side by Side Diff: chrome/browser/renderer_host/sync_resource_handler.cc

Issue 3396029: Flesh out URLLoader's download_to_file function.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/resource_handler.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698