diff options
author | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-23 19:15:01 +0000 |
---|---|---|
committer | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-23 19:15:01 +0000 |
commit | 4cd82f72da57dac8a4b810d8a99fbe5b379cf593 (patch) | |
tree | 5c503dfa4605672086765819a2af1ab9f669dd2e /chrome/browser/automation/automation_provider.cc | |
parent | 088e6a3814c7de976650e8ad2b5cb075656d8665 (diff) | |
download | chromium_src-4cd82f72da57dac8a4b810d8a99fbe5b379cf593.zip chromium_src-4cd82f72da57dac8a4b810d8a99fbe5b379cf593.tar.gz chromium_src-4cd82f72da57dac8a4b810d8a99fbe5b379cf593.tar.bz2 |
Part 2 of downloads data flow refactor.
Reduced the lifetime of DownloadCreateInfo.
DownloadCreateInfo now only lives until DownloadFileManager::CreateDownloadFile(). It's contents are put into DownloadItem, and then only the download ID is passed around to get at the information.
In addition, most of DownloadItem's members are grouped into sub-structures by functionality:
- history_
Passed to the history data base, and includes the data relevant to that.
- request_
Contains the information about the request, which is not present in the other structures.
- state_
Contains data that is used to manage the download process. It is part of DownloadItem because it is specific to that item, but it could instead be passed around as an extra parameter.
Some notes on the refactoring:
- DownloadItem is only accessed in the UI thread. This means that the state_ structure needs to be passed by value to DownloadManager::CheckIfSuggestedPathExists(), modified there, and then passed by value again to DownloadManager::OnPathExistenceAvailable(), where it is copied bach into DownloadItem.
BUG=78084,77188
TEST=Passes all download unit tests.
Review URL: http://codereview.chromium.org/6969009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86319 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_provider.cc')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index d8a5f20..da4cc5d 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -254,7 +254,7 @@ DictionaryValue* AutomationProvider::GetDictionaryFromDownloadItem( DictionaryValue* dl_item_value = new DictionaryValue; dl_item_value->SetInteger("id", static_cast<int>(download->id())); - dl_item_value->SetString("url", download->url().spec()); + dl_item_value->SetString("url", download->GetURL().spec()); dl_item_value->SetString("referrer_url", download->referrer_url().spec()); dl_item_value->SetString("file_name", download->GetFileNameToReportUser().value()); |