| 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> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | |
| 14 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 15 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 16 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 18 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
| 19 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
| 20 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 21 #include "base/time.h" | 20 #include "base/time.h" |
| 22 #include "chrome/browser/autocomplete/history_url_provider.h" | 21 #include "chrome/browser/autocomplete/history_url_provider.h" |
| 23 #include "chrome/browser/bookmarks/bookmark_service.h" | 22 #include "chrome/browser/bookmarks/bookmark_service.h" |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 delegate_->NotifyProfileError(id_, status); | 572 delegate_->NotifyProfileError(id_, status); |
| 574 db_.reset(); | 573 db_.reset(); |
| 575 return; | 574 return; |
| 576 default: | 575 default: |
| 577 NOTREACHED(); | 576 NOTREACHED(); |
| 578 } | 577 } |
| 579 | 578 |
| 580 // Fill the in-memory database and send it back to the history service on the | 579 // Fill the in-memory database and send it back to the history service on the |
| 581 // main thread. | 580 // main thread. |
| 582 InMemoryHistoryBackend* mem_backend = new InMemoryHistoryBackend; | 581 InMemoryHistoryBackend* mem_backend = new InMemoryHistoryBackend; |
| 583 if (mem_backend->Init(history_name, history_dir_, db_.get(), languages)) | 582 if (mem_backend->Init(history_name, db_.get())) |
| 584 delegate_->SetInMemoryBackend(id_, mem_backend); // Takes ownership of | 583 delegate_->SetInMemoryBackend(id_, mem_backend); // Takes ownership of |
| 585 // pointer. | 584 // pointer. |
| 586 else | 585 else |
| 587 delete mem_backend; // Error case, run without the in-memory DB. | 586 delete mem_backend; // Error case, run without the in-memory DB. |
| 588 db_->BeginExclusiveMode(); // Must be after the mem backend read the data. | 587 db_->BeginExclusiveMode(); // Must be after the mem backend read the data. |
| 589 | 588 |
| 590 // Create the history publisher which needs to be passed on to the text and | 589 // Create the history publisher which needs to be passed on to the text and |
| 591 // thumbnail databases for publishing history. | 590 // thumbnail databases for publishing history. |
| 592 history_publisher_.reset(new HistoryPublisher()); | 591 history_publisher_.reset(new HistoryPublisher()); |
| 593 if (!history_publisher_->Init()) { | 592 if (!history_publisher_->Init()) { |
| (...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2315 break; | 2314 break; |
| 2316 } | 2315 } |
| 2317 } | 2316 } |
| 2318 } | 2317 } |
| 2319 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name | 2318 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name |
| 2320 TimeTicks::Now() - beginning_time); | 2319 TimeTicks::Now() - beginning_time); |
| 2321 return success; | 2320 return success; |
| 2322 } | 2321 } |
| 2323 | 2322 |
| 2324 } // namespace history | 2323 } // namespace history |
| OLD | NEW |