diff options
Diffstat (limited to 'chrome/browser/download')
-rw-r--r-- | chrome/browser/download/download_file.cc | 7 | ||||
-rw-r--r-- | chrome/browser/download/download_file.h | 5 | ||||
-rw-r--r-- | chrome/browser/download/save_file_manager.cc | 7 | ||||
-rw-r--r-- | chrome/browser/download/save_file_manager.h | 5 | ||||
-rw-r--r-- | chrome/browser/download/save_package.cc | 5 |
5 files changed, 10 insertions, 19 deletions
diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc index 5d7b5e5c..70d733d 100644 --- a/chrome/browser/download/download_file.cc +++ b/chrome/browser/download/download_file.cc @@ -23,7 +23,6 @@ #include "chrome/common/win_util.h" #include "chrome/common/win_safe_util.h" #include "googleurl/src/gurl.h" -#include "net/base/io_buffer.h" #include "net/base/net_util.h" #include "net/url_request/url_request_context.h" @@ -266,11 +265,11 @@ void DownloadFileManager::UpdateDownload(int id, DownloadBuffer* buffer) { DownloadFile* download = LookupDownload(id); for (size_t i = 0; i < contents.size(); ++i) { - net::IOBuffer* data = contents[i].first; + char* data = contents[i].first; const int data_len = contents[i].second; if (download) - download->AppendDataToFile(data->data(), data_len); - data->Release(); + download->AppendDataToFile(data, data_len); + delete [] data; } if (download) { diff --git a/chrome/browser/download/download_file.h b/chrome/browser/download/download_file.h index f1ffcea..ea74318 100644 --- a/chrome/browser/download/download_file.h +++ b/chrome/browser/download/download_file.h @@ -52,9 +52,6 @@ #include "base/timer.h" #include "chrome/browser/history/download_types.h" -namespace net { -class IOBuffer; -} class DownloadManager; class FilePath; class GURL; @@ -73,7 +70,7 @@ class URLRequestContext; struct DownloadBuffer { Lock lock; - typedef std::pair<net::IOBuffer*, int> Contents; + typedef std::pair<char *, int> Contents; std::vector<Contents> contents; }; diff --git a/chrome/browser/download/save_file_manager.cc b/chrome/browser/download/save_file_manager.cc index 64984de..fbf5782 100644 --- a/chrome/browser/download/save_file_manager.cc +++ b/chrome/browser/download/save_file_manager.cc @@ -25,7 +25,6 @@ #include "chrome/common/win_safe_util.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" -#include "net/base/io_buffer.h" #include "net/url_request/url_request_context.h" SaveFileManager::SaveFileManager(MessageLoop* ui_loop, @@ -272,12 +271,12 @@ void SaveFileManager::StartSave(SaveFileCreateInfo* info) { // thread). We may receive a few more updates before the IO thread gets the // cancel message. We just delete the data since the SaveFile has been deleted. void SaveFileManager::UpdateSaveProgress(int save_id, - net::IOBuffer* data, + char* data, int data_len) { DCHECK(MessageLoop::current() == GetSaveLoop()); SaveFile* save_file = LookupSaveFile(save_id); if (save_file) { - bool write_success = save_file->AppendDataToFile(data->data(), data_len); + bool write_success = save_file->AppendDataToFile(data, data_len); ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, &SaveFileManager::OnUpdateSaveProgress, @@ -285,7 +284,7 @@ void SaveFileManager::UpdateSaveProgress(int save_id, save_file->bytes_so_far(), write_success)); } - data->Release(); + delete [] data; } // The IO thread will call this when saving is completed or it got error when diff --git a/chrome/browser/download/save_file_manager.h b/chrome/browser/download/save_file_manager.h index cf29e1c..8bd6e89 100644 --- a/chrome/browser/download/save_file_manager.h +++ b/chrome/browser/download/save_file_manager.h @@ -66,9 +66,6 @@ #include "base/thread.h" #include "chrome/browser/download/save_types.h" -namespace net { -class IOBuffer; -} class GURL; class SaveFile; class SavePackage; @@ -104,7 +101,7 @@ class SaveFileManager // Notifications sent from the IO thread and run on the file thread: void StartSave(SaveFileCreateInfo* info); - void UpdateSaveProgress(int save_id, net::IOBuffer* data, int size); + void UpdateSaveProgress(int save_id, char* data, int size); void SaveFinished(int save_id, std::wstring save_url, int render_process_id, bool is_success); diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc index 1eea9e5..1127017 100644 --- a/chrome/browser/download/save_package.cc +++ b/chrome/browser/download/save_package.cc @@ -31,7 +31,6 @@ #include "chrome/common/pref_service.h" #include "chrome/common/stl_util-inl.h" #include "chrome/common/win_util.h" -#include "net/base/io_buffer.h" #include "net/base/mime_util.h" #include "net/base/net_util.h" #include "net/url_request/url_request_context.h" @@ -813,8 +812,8 @@ void SavePackage::OnReceivedSerializedHtmlData(const GURL& frame_url, if (!data.empty()) { // Prepare buffer for saving HTML data. - net::IOBuffer* new_data = new net::IOBuffer(data.size()); - memcpy(new_data->data(), data.data(), data.size()); + char* new_data = static_cast<char*>(new char[data.size()]); + memcpy(new_data, data.data(), data.size()); // Call write file functionality in file thread. file_manager_->GetSaveLoop()->PostTask(FROM_HERE, |