| OLD | NEW |
| 1 // Copyright (c) 2011 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 #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_history_info.h" | 8 #include "chrome/browser/history/download_history_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" | |
| 11 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "content/browser/download/download_item.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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 VisitedBeforeRequestsMap::iterator request = | 148 VisitedBeforeRequestsMap::iterator request = |
| 149 visited_before_requests_.find(handle); | 149 visited_before_requests_.find(handle); |
| 150 DCHECK(request != visited_before_requests_.end()); | 150 DCHECK(request != visited_before_requests_.end()); |
| 151 int32 download_id = request->second.first; | 151 int32 download_id = request->second.first; |
| 152 VisitedBeforeDoneCallback* callback = request->second.second; | 152 VisitedBeforeDoneCallback* callback = request->second.second; |
| 153 visited_before_requests_.erase(request); | 153 visited_before_requests_.erase(request); |
| 154 callback->Run(download_id, found_visits && count && | 154 callback->Run(download_id, found_visits && count && |
| 155 (first_visit.LocalMidnight() < base::Time::Now().LocalMidnight())); | 155 (first_visit.LocalMidnight() < base::Time::Now().LocalMidnight())); |
| 156 delete callback; | 156 delete callback; |
| 157 } | 157 } |
| OLD | NEW |