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/download/download_history.h | |
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/download/download_history.h')
-rw-r--r-- | chrome/browser/download/download_history.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/chrome/browser/download/download_history.h b/chrome/browser/download/download_history.h index 7fb114e..cdde668 100644 --- a/chrome/browser/download/download_history.h +++ b/chrome/browser/download/download_history.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -31,8 +31,7 @@ class DownloadHistory { void Load(HistoryService::DownloadQueryCallback* callback); // Adds a new entry for a download to the history database. - void AddEntry(const DownloadCreateInfo& info, - DownloadItem* download_item, + void AddEntry(DownloadItem* download_item, HistoryService::DownloadCreateCallback* callback); // Updates the history entry for |download_item|. |