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

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: Stupid clang! 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
« no previous file with comments | « chrome/browser/download/download_history.h ('k') | chrome/browser/download/download_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b19f240a3a61e2529a9f036834c5692edee289a1 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);
// 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);
+ int32 id = download_item->id();
+ DownloadHistoryInfo history_info = download_item->GetHistoryInfo();
+ hs->CreateDownload(id, history_info, &history_consumer_, callback);
}
void DownloadHistory::UpdateEntry(DownloadItem* download_item) {
« no previous file with comments | « chrome/browser/download/download_history.h ('k') | chrome/browser/download/download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698