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/visitsegment_database.h" | 5 #include "chrome/browser/history/visitsegment_database.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/history/page_usage_data.h" | 9 #include "chrome/browser/history/page_usage_data.h" |
10 #include "chrome/common/sqlite_compiled_statement.h" | 10 #include "chrome/common/sqlite_compiled_statement.h" |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 NOTREACHED(); | 308 NOTREACHED(); |
309 return; | 309 return; |
310 } | 310 } |
311 for (size_t i = 0; i < results->size(); ++i) { | 311 for (size_t i = 0; i < results->size(); ++i) { |
312 PageUsageData* pud = (*results)[i]; | 312 PageUsageData* pud = (*results)[i]; |
313 statement2->bind_int64(0, pud->GetID()); | 313 statement2->bind_int64(0, pud->GetID()); |
314 if (statement2->step() == SQLITE_ROW) { | 314 if (statement2->step() == SQLITE_ROW) { |
315 std::string url; | 315 std::string url; |
316 std::wstring title; | 316 std::wstring title; |
317 statement2->column_string(0, &url); | 317 statement2->column_string(0, &url); |
318 statement2->column_string16(1, &title); | 318 statement2->column_wstring(1, &title); |
319 pud->SetURL(GURL(url)); | 319 pud->SetURL(GURL(url)); |
320 pud->SetTitle(title); | 320 pud->SetTitle(title); |
321 } | 321 } |
322 statement2->reset(); | 322 statement2->reset(); |
323 } | 323 } |
324 } | 324 } |
325 | 325 |
326 void VisitSegmentDatabase::DeleteSegmentData(const Time& older_than) { | 326 void VisitSegmentDatabase::DeleteSegmentData(const Time& older_than) { |
327 SQLITE_UNIQUE_STATEMENT(statement, GetStatementCache(), | 327 SQLITE_UNIQUE_STATEMENT(statement, GetStatementCache(), |
328 "DELETE FROM segment_usage WHERE time_slot < ?"); | 328 "DELETE FROM segment_usage WHERE time_slot < ?"); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 NOTREACHED(); | 381 NOTREACHED(); |
382 r = false; | 382 r = false; |
383 } | 383 } |
384 delete_usage->reset(); | 384 delete_usage->reset(); |
385 delete_seg->reset(); | 385 delete_seg->reset(); |
386 } | 386 } |
387 return r; | 387 return r; |
388 } | 388 } |
389 | 389 |
390 } // namespace history | 390 } // namespace history |
OLD | NEW |