| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file contains an implementation of the ResourceLoaderBridge class. | 5 // This file contains an implementation of the ResourceLoaderBridge class. |
| 6 // The class is implemented using URLRequest, meaning it is a "simple" version | 6 // The class is implemented using URLRequest, meaning it is a "simple" version |
| 7 // that directly issues requests. The more complicated one used in the | 7 // that directly issues requests. The more complicated one used in the |
| 8 // browser uses IPC. | 8 // browser uses IPC. |
| 9 // | 9 // |
| 10 // Because URLRequest only provides an asynchronous resource loading API, this | 10 // Because URLRequest only provides an asynchronous resource loading API, this |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // -------------------------------------------------------------------------- | 449 // -------------------------------------------------------------------------- |
| 450 // ResourceLoaderBridge implementation: | 450 // ResourceLoaderBridge implementation: |
| 451 | 451 |
| 452 virtual void AppendDataToUpload(const char* data, int data_len) { | 452 virtual void AppendDataToUpload(const char* data, int data_len) { |
| 453 DCHECK(params_.get()); | 453 DCHECK(params_.get()); |
| 454 if (!params_->upload) | 454 if (!params_->upload) |
| 455 params_->upload = new net::UploadData(); | 455 params_->upload = new net::UploadData(); |
| 456 params_->upload->AppendBytes(data, data_len); | 456 params_->upload->AppendBytes(data, data_len); |
| 457 } | 457 } |
| 458 | 458 |
| 459 virtual void AppendFileRangeToUpload(const std::wstring& file_path, | 459 virtual void AppendFileRangeToUpload(const FilePath& file_path, |
| 460 uint64 offset, uint64 length) { | 460 uint64 offset, uint64 length) { |
| 461 DCHECK(params_.get()); | 461 DCHECK(params_.get()); |
| 462 if (!params_->upload) | 462 if (!params_->upload) |
| 463 params_->upload = new net::UploadData(); | 463 params_->upload = new net::UploadData(); |
| 464 params_->upload->AppendFileRange(file_path, offset, length); | 464 params_->upload->AppendFileRange(file_path, offset, length); |
| 465 } | 465 } |
| 466 | 466 |
| 467 virtual void SetUploadIdentifier(int64 identifier) { | 467 virtual void SetUploadIdentifier(int64 identifier) { |
| 468 DCHECK(params_.get()); | 468 DCHECK(params_.get()); |
| 469 if (!params_->upload) | 469 if (!params_->upload) |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 return std::string(); | 644 return std::string(); |
| 645 } | 645 } |
| 646 | 646 |
| 647 scoped_refptr<CookieGetter> getter = new CookieGetter(); | 647 scoped_refptr<CookieGetter> getter = new CookieGetter(); |
| 648 | 648 |
| 649 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 649 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
| 650 getter.get(), &CookieGetter::Get, url)); | 650 getter.get(), &CookieGetter::Get, url)); |
| 651 | 651 |
| 652 return getter->GetResult(); | 652 return getter->GetResult(); |
| 653 } | 653 } |
| OLD | NEW |