OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/plugin/chrome_plugin_host.h" | 5 #include "chrome/plugin/chrome_plugin_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 upload_content_.back().SetToBytes(bytes, bytes_len); | 140 upload_content_.back().SetToBytes(bytes, bytes_len); |
141 } | 141 } |
142 | 142 |
143 void AppendFileToUpload(const FilePath &filepath) { | 143 void AppendFileToUpload(const FilePath &filepath) { |
144 AppendFileRangeToUpload(filepath, 0, kuint64max); | 144 AppendFileRangeToUpload(filepath, 0, kuint64max); |
145 } | 145 } |
146 | 146 |
147 void AppendFileRangeToUpload(const FilePath &filepath, | 147 void AppendFileRangeToUpload(const FilePath &filepath, |
148 uint64 offset, uint64 length) { | 148 uint64 offset, uint64 length) { |
149 upload_content_.push_back(net::UploadData::Element()); | 149 upload_content_.push_back(net::UploadData::Element()); |
150 upload_content_.back().SetToFilePathRange(filepath, offset, length); | 150 upload_content_.back().SetToFilePathRange(filepath, offset, length, |
| 151 base::Time()); |
151 } | 152 } |
152 | 153 |
153 CPError Start(int renderer_id, int render_view_id) { | 154 CPError Start(int renderer_id, int render_view_id) { |
154 webkit_glue::ResourceLoaderBridge::RequestInfo request_info; | 155 webkit_glue::ResourceLoaderBridge::RequestInfo request_info; |
155 request_info.method = cprequest_->method; | 156 request_info.method = cprequest_->method; |
156 request_info.url = GURL(cprequest_->url); | 157 request_info.url = GURL(cprequest_->url); |
157 request_info.first_party_for_cookies = | 158 request_info.first_party_for_cookies = |
158 GURL(cprequest_->url); // TODO(jackson): policy url? | 159 GURL(cprequest_->url); // TODO(jackson): policy url? |
159 request_info.referrer = GURL(); // TODO(mpcomplete): referrer? | 160 request_info.referrer = GURL(); // TODO(mpcomplete): referrer? |
160 request_info.frame_origin = "null"; | 161 request_info.frame_origin = "null"; |
(...skipping 18 matching lines...) Expand all Loading... |
179 case net::UploadData::TYPE_BYTES: { | 180 case net::UploadData::TYPE_BYTES: { |
180 const std::vector<char>& bytes = upload_content_[i].bytes(); | 181 const std::vector<char>& bytes = upload_content_[i].bytes(); |
181 bridge_->AppendDataToUpload(&bytes[0], | 182 bridge_->AppendDataToUpload(&bytes[0], |
182 static_cast<int>(bytes.size())); | 183 static_cast<int>(bytes.size())); |
183 break; | 184 break; |
184 } | 185 } |
185 case net::UploadData::TYPE_FILE: { | 186 case net::UploadData::TYPE_FILE: { |
186 bridge_->AppendFileRangeToUpload( | 187 bridge_->AppendFileRangeToUpload( |
187 upload_content_[i].file_path(), | 188 upload_content_[i].file_path(), |
188 upload_content_[i].file_range_offset(), | 189 upload_content_[i].file_range_offset(), |
189 upload_content_[i].file_range_length()); | 190 upload_content_[i].file_range_length(), |
| 191 upload_content_[i].expected_file_modification_time()); |
190 break; | 192 break; |
191 } | 193 } |
192 default: { | 194 default: { |
193 NOTREACHED() << "Unknown UploadData::Element type"; | 195 NOTREACHED() << "Unknown UploadData::Element type"; |
194 } | 196 } |
195 } | 197 } |
196 } | 198 } |
197 | 199 |
198 if (sync_) { | 200 if (sync_) { |
199 ResourceLoaderBridge::SyncLoadResponse response; | 201 ResourceLoaderBridge::SyncLoadResponse response; |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 | 712 |
711 response_funcs.size = sizeof(response_funcs); | 713 response_funcs.size = sizeof(response_funcs); |
712 response_funcs.received_redirect = CPRR_ReceivedRedirect; | 714 response_funcs.received_redirect = CPRR_ReceivedRedirect; |
713 response_funcs.start_completed = CPRR_StartCompleted; | 715 response_funcs.start_completed = CPRR_StartCompleted; |
714 response_funcs.read_completed = CPRR_ReadCompleted; | 716 response_funcs.read_completed = CPRR_ReadCompleted; |
715 response_funcs.upload_progress = CPRR_UploadProgress; | 717 response_funcs.upload_progress = CPRR_UploadProgress; |
716 } | 718 } |
717 | 719 |
718 return &browser_funcs; | 720 return &browser_funcs; |
719 } | 721 } |
OLD | NEW |