| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/download/download_history.h" | 5 #include "chrome/browser/download/download_history.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/history/download_create_info.h" | 8 #include "chrome/browser/history/download_create_info.h" |
| 9 #include "chrome/browser/history/history_marshaling.h" | 9 #include "chrome/browser/history/history_marshaling.h" |
| 10 #include "chrome/browser/download/download_item.h" | 10 #include "chrome/browser/download/download_item.h" |
| 11 #include "chrome/browser/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 | 12 |
| 13 // Our download table ID starts at 1, so we use 0 to represent a download that | 13 // Our download table ID starts at 1, so we use 0 to represent a download that |
| 14 // has started, but has not yet had its data persisted in the table. We use fake | 14 // has started, but has not yet had its data persisted in the table. We use fake |
| 15 // database handles in incognito mode starting at -1 and progressively getting | 15 // database handles in incognito mode starting at -1 and progressively getting |
| 16 // more negative. | 16 // more negative. |
| 17 // static | 17 // static |
| 18 const int DownloadHistory::kUninitializedHandle = 0; | 18 const int DownloadHistory::kUninitializedHandle = 0; |
| 19 | 19 |
| 20 DownloadHistory::DownloadHistory(Profile* profile) | 20 DownloadHistory::DownloadHistory(Profile* profile) |
| 21 : profile_(profile), | 21 : profile_(profile), |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 const base::Time remove_end) { | 108 const base::Time remove_end) { |
| 109 // TODO(paulg) see bug 958058. EXPLICIT_ACCESS below is wrong. | 109 // TODO(paulg) see bug 958058. EXPLICIT_ACCESS below is wrong. |
| 110 HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); | 110 HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); |
| 111 if (hs) | 111 if (hs) |
| 112 hs->RemoveDownloadsBetween(remove_begin, remove_end); | 112 hs->RemoveDownloadsBetween(remove_begin, remove_end); |
| 113 } | 113 } |
| 114 | 114 |
| 115 int64 DownloadHistory::GetNextFakeDbHandle() { | 115 int64 DownloadHistory::GetNextFakeDbHandle() { |
| 116 return next_fake_db_handle_--; | 116 return next_fake_db_handle_--; |
| 117 } | 117 } |
| OLD | NEW |