| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/history_backend.h" | 5 #include "chrome/browser/history/history_backend.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 // we only set db_ to the created database if creation is successful. That | 600 // we only set db_ to the created database if creation is successful. That |
| 601 // way other methods won't do anything as db_ is still NULL. | 601 // way other methods won't do anything as db_ is still NULL. |
| 602 | 602 |
| 603 TimeTicks beginning_time = TimeTicks::Now(); | 603 TimeTicks beginning_time = TimeTicks::Now(); |
| 604 | 604 |
| 605 // Compute the file names. Note that the index file can be removed when the | 605 // Compute the file names. Note that the index file can be removed when the |
| 606 // text db manager is finished being hooked up. | 606 // text db manager is finished being hooked up. |
| 607 FilePath history_name = history_dir_.Append(chrome::kHistoryFilename); | 607 FilePath history_name = history_dir_.Append(chrome::kHistoryFilename); |
| 608 FilePath thumbnail_name = GetThumbnailFileName(); | 608 FilePath thumbnail_name = GetThumbnailFileName(); |
| 609 FilePath archived_name = GetArchivedFileName(); | 609 FilePath archived_name = GetArchivedFileName(); |
| 610 FilePath tmp_bookmarks_file = history_dir_.Append( | |
| 611 chrome::kHistoryBookmarksFileName); | |
| 612 | 610 |
| 613 // History database. | 611 // History database. |
| 614 db_.reset(new HistoryDatabase()); | 612 db_.reset(new HistoryDatabase()); |
| 615 sql::InitStatus status = db_->Init(history_name, tmp_bookmarks_file); | 613 sql::InitStatus status = db_->Init(history_name); |
| 616 switch (status) { | 614 switch (status) { |
| 617 case sql::INIT_OK: | 615 case sql::INIT_OK: |
| 618 break; | 616 break; |
| 619 case sql::INIT_FAILURE: | 617 case sql::INIT_FAILURE: |
| 620 // A NULL db_ will cause all calls on this object to notice this error | 618 // A NULL db_ will cause all calls on this object to notice this error |
| 621 // and to not continue. | 619 // and to not continue. |
| 622 delegate_->NotifyProfileError(id_, status); | 620 delegate_->NotifyProfileError(id_, status); |
| 623 db_.reset(); | 621 db_.reset(); |
| 624 return; | 622 return; |
| 625 default: | 623 default: |
| (...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2490 info.url_id = visit.url_id; | 2488 info.url_id = visit.url_id; |
| 2491 info.time = visit.visit_time; | 2489 info.time = visit.visit_time; |
| 2492 info.transition = visit.transition; | 2490 info.transition = visit.transition; |
| 2493 // If we don't have a delegate yet during setup or shutdown, we will drop | 2491 // If we don't have a delegate yet during setup or shutdown, we will drop |
| 2494 // these notifications. | 2492 // these notifications. |
| 2495 if (delegate_.get()) | 2493 if (delegate_.get()) |
| 2496 delegate_->NotifyVisitDBObserversOnAddVisit(info); | 2494 delegate_->NotifyVisitDBObserversOnAddVisit(info); |
| 2497 } | 2495 } |
| 2498 | 2496 |
| 2499 } // namespace history | 2497 } // namespace history |
| OLD | NEW |