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

Side by Side Diff: chrome/browser/history/download_database.cc

Issue 18388: Fix download path bugs (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 "SELECT id, full_path, url, start_time, received_bytes, " 62 "SELECT id, full_path, url, start_time, received_bytes, "
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 = info.path.ToWStringHack(); 72 std::wstring path_str;
73 statement->column_string16(1, &path_str); 73 statement->column_string16(1, &path_str);
74 info.path = FilePath::FromWStringHack(path_str);
74 statement->column_string16(2, &info.url); 75 statement->column_string16(2, &info.url);
75 info.start_time = Time::FromTimeT(statement->column_int64(3)); 76 info.start_time = Time::FromTimeT(statement->column_int64(3));
76 info.received_bytes = statement->column_int64(4); 77 info.received_bytes = statement->column_int64(4);
77 info.total_bytes = statement->column_int64(5); 78 info.total_bytes = statement->column_int64(5);
78 info.state = statement->column_int(6); 79 info.state = statement->column_int(6);
79 results->push_back(info); 80 results->push_back(info);
80 } 81 }
81 } 82 }
82 83
83 bool DownloadDatabase::UpdateDownload(int64 received_bytes, 84 bool DownloadDatabase::UpdateDownload(int64 received_bytes,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 text.append(search_text); 172 text.append(search_text);
172 text.append(L"%"); 173 text.append(L"%");
173 statement->bind_wstring(0, text); 174 statement->bind_wstring(0, text);
174 statement->bind_wstring(1, text); 175 statement->bind_wstring(1, text);
175 176
176 while (statement->step() == SQLITE_ROW) 177 while (statement->step() == SQLITE_ROW)
177 results->push_back(statement->column_int64(0)); 178 results->push_back(statement->column_int64(0));
178 } 179 }
179 180
180 } // namespace history 181 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698