Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6507)

Unified Diff: chrome/browser/download/download_history.cc

Issue 6969009: Reduced the lifetime of DownloadCreateInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_history.cc
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc
index 388ffd34b0eee85f64fb7c52a5546af16fc785d9..c77f3685fb91e574af662413768679f9a0e43f65 100644
--- a/chrome/browser/download/download_history.cc
+++ b/chrome/browser/download/download_history.cc
@@ -1,11 +1,11 @@
-// 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.
#include "chrome/browser/download/download_history.h"
#include "base/logging.h"
-#include "chrome/browser/history/download_create_info.h"
+#include "chrome/browser/history/download_history_info.h"
#include "chrome/browser/history/history_marshaling.h"
#include "chrome/browser/download/download_item.h"
#include "chrome/browser/profiles/profile.h"
@@ -40,9 +40,9 @@ void DownloadHistory::Load(HistoryService::DownloadQueryCallback* callback) {
}
void DownloadHistory::AddEntry(
- const DownloadCreateInfo& info,
DownloadItem* download_item,
HistoryService::DownloadCreateCallback* callback) {
+ DCHECK(download_item != NULL);
// Do not store the download in the history database for a few special cases:
// - incognito mode (that is the point of this mode)
// - extensions (users don't think of extension installation as 'downloading')
@@ -57,12 +57,15 @@ void DownloadHistory::AddEntry(
if (download_item->is_otr() || download_item->is_extension_install() ||
download_item->is_temporary() || !hs) {
callback->RunWithParams(
- history::DownloadCreateRequest::TupleType(info, GetNextFakeDbHandle()));
+ history::DownloadCreateRequest::TupleType(download_item->id(),
+ GetNextFakeDbHandle()));
delete callback;
return;
}
- hs->CreateDownload(info, &history_consumer_, callback);
+ hs->CreateDownload(DownloadHistoryInfo(*download_item),
+ &history_consumer_,
+ callback);
}
void DownloadHistory::UpdateEntry(DownloadItem* download_item) {

Powered by Google App Engine
This is Rietveld 408576698