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

Side by Side Diff: chrome/browser/download/download_history.h

Issue 6969009: Reduced the lifetime of DownloadCreateInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed an early return to a DCHECK. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "chrome/browser/history/history.h" 10 #include "chrome/browser/history/history.h"
11 #include "content/browser/cancelable_request.h" 11 #include "content/browser/cancelable_request.h"
(...skipping 12 matching lines...) Expand all
24 // but is not yet in the table. 24 // but is not yet in the table.
25 static const int kUninitializedHandle; 25 static const int kUninitializedHandle;
26 26
27 explicit DownloadHistory(Profile* profile); 27 explicit DownloadHistory(Profile* profile);
28 ~DownloadHistory(); 28 ~DownloadHistory();
29 29
30 // Retrieves DownloadCreateInfos saved in the history. 30 // Retrieves DownloadCreateInfos saved in the history.
31 void Load(HistoryService::DownloadQueryCallback* callback); 31 void Load(HistoryService::DownloadQueryCallback* callback);
32 32
33 // Adds a new entry for a download to the history database. 33 // Adds a new entry for a download to the history database.
34 void AddEntry(const DownloadCreateInfo& info, 34 void AddEntry(DownloadItem* download_item,
35 DownloadItem* download_item,
36 HistoryService::DownloadCreateCallback* callback); 35 HistoryService::DownloadCreateCallback* callback);
37 36
38 // Updates the history entry for |download_item|. 37 // Updates the history entry for |download_item|.
39 void UpdateEntry(DownloadItem* download_item); 38 void UpdateEntry(DownloadItem* download_item);
40 39
41 // Updates the download path for |download_item| to |new_path|. 40 // Updates the download path for |download_item| to |new_path|.
42 void UpdateDownloadPath(DownloadItem* download_item, 41 void UpdateDownloadPath(DownloadItem* download_item,
43 const FilePath& new_path); 42 const FilePath& new_path);
44 43
45 // Removes |download_item| from the history database. 44 // Removes |download_item| from the history database.
(...skipping 14 matching lines...) Expand all
60 // Downloads are expected to have unique handles, so we decrement the next 59 // Downloads are expected to have unique handles, so we decrement the next
61 // fake handle value on every use. 60 // fake handle value on every use.
62 int64 next_fake_db_handle_; 61 int64 next_fake_db_handle_;
63 62
64 CancelableRequestConsumer history_consumer_; 63 CancelableRequestConsumer history_consumer_;
65 64
66 DISALLOW_COPY_AND_ASSIGN(DownloadHistory); 65 DISALLOW_COPY_AND_ASSIGN(DownloadHistory);
67 }; 66 };
68 67
69 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ 68 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698