OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/history/download_database.h" | 5 #include "chrome/browser/history/download_database.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "chrome/browser/download/download_manager.h" | 10 #include "chrome/browser/download/download_manager.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 "total_bytes, state " | 63 "total_bytes, state " |
64 "FROM downloads " | 64 "FROM downloads " |
65 "ORDER BY start_time"); | 65 "ORDER BY start_time"); |
66 if (!statement.is_valid()) | 66 if (!statement.is_valid()) |
67 return; | 67 return; |
68 | 68 |
69 while (statement->step() == SQLITE_ROW) { | 69 while (statement->step() == SQLITE_ROW) { |
70 DownloadCreateInfo info; | 70 DownloadCreateInfo info; |
71 info.db_handle = statement->column_int64(0); | 71 info.db_handle = statement->column_int64(0); |
72 std::wstring path_str; | 72 std::wstring path_str; |
73 statement->column_string16(1, &path_str); | 73 statement->column_wstring(1, &path_str); |
74 info.path = FilePath::FromWStringHack(path_str); | 74 info.path = FilePath::FromWStringHack(path_str); |
75 statement->column_string16(2, &info.url); | 75 statement->column_wstring(2, &info.url); |
76 info.start_time = Time::FromTimeT(statement->column_int64(3)); | 76 info.start_time = Time::FromTimeT(statement->column_int64(3)); |
77 info.received_bytes = statement->column_int64(4); | 77 info.received_bytes = statement->column_int64(4); |
78 info.total_bytes = statement->column_int64(5); | 78 info.total_bytes = statement->column_int64(5); |
79 info.state = statement->column_int(6); | 79 info.state = statement->column_int(6); |
80 results->push_back(info); | 80 results->push_back(info); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 bool DownloadDatabase::UpdateDownload(int64 received_bytes, | 84 bool DownloadDatabase::UpdateDownload(int64 received_bytes, |
85 int32 state, | 85 int32 state, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 text.append(search_text); | 172 text.append(search_text); |
173 text.append(L"%"); | 173 text.append(L"%"); |
174 statement->bind_wstring(0, text); | 174 statement->bind_wstring(0, text); |
175 statement->bind_wstring(1, text); | 175 statement->bind_wstring(1, text); |
176 | 176 |
177 while (statement->step() == SQLITE_ROW) | 177 while (statement->step() == SQLITE_ROW) |
178 results->push_back(statement->column_int64(0)); | 178 results->push_back(statement->column_int64(0)); |
179 } | 179 } |
180 | 180 |
181 } // namespace history | 181 } // namespace history |
OLD | NEW |