diff options
Diffstat (limited to 'chrome/browser/history')
-rw-r--r-- | chrome/browser/history/history.cc | 5 | ||||
-rw-r--r-- | chrome/browser/history/history.h | 3 | ||||
-rw-r--r-- | chrome/browser/history/history_backend.cc | 3 | ||||
-rw-r--r-- | chrome/browser/history/history_querying_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/history/history_unittest.cc | 18 |
5 files changed, 17 insertions, 14 deletions
diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index 99838a1..6e55160 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -123,14 +123,15 @@ HistoryService::~HistoryService() { } } -bool HistoryService::Init(const std::wstring& history_dir, +bool HistoryService::Init(const FilePath& history_dir, BookmarkService* bookmark_service) { if (!thread_->Start()) return false; // Create the history backend. scoped_refptr<HistoryBackend> backend( - new HistoryBackend(history_dir, new BackendDelegate(this), + new HistoryBackend(history_dir.ToWStringHack(), + new BackendDelegate(this), bookmark_service)); history_backend_.swap(backend); diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h index 0e5a492..b0351c9 100644 --- a/chrome/browser/history/history.h +++ b/chrome/browser/history/history.h @@ -27,6 +27,7 @@ class BookmarkService; struct DownloadCreateInfo; +class FilePath; class GURL; class HistoryURLProvider; struct HistoryURLProviderParams; @@ -100,7 +101,7 @@ class HistoryService : public CancelableRequestProvider, // not call any other functions. The given directory will be used for storing // the history files. The BookmarkService is used when deleting URLs to // test if a URL is bookmarked; it may be NULL during testing. - bool Init(const std::wstring& history_dir, BookmarkService* bookmark_service); + bool Init(const FilePath& history_dir, BookmarkService* bookmark_service); // Did the backend finish loading the databases? bool backend_loaded() const { return backend_loaded_; } diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index fd7d465..670555b 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -471,7 +471,8 @@ void HistoryBackend::InitImpl() { // Compute the file names. Note that the index file can be removed when the // text db manager is finished being hooked up. std::wstring history_name = history_dir_; - file_util::AppendToPath(&history_name, chrome::kHistoryFilename); + file_util::AppendToPath(&history_name, + FilePath(chrome::kHistoryFilename).ToWStringHack()); std::wstring thumbnail_name = GetThumbnailFileName(); std::wstring archived_name = GetArchivedFileName(); std::wstring tmp_bookmarks_file = history_dir_; diff --git a/chrome/browser/history/history_querying_unittest.cc b/chrome/browser/history/history_querying_unittest.cc index 18cbf21..153ee5c1 100644 --- a/chrome/browser/history/history_querying_unittest.cc +++ b/chrome/browser/history/history_querying_unittest.cc @@ -89,7 +89,7 @@ class HistoryQueryTest : public testing::Test { file_util::CreateDirectory(history_dir_); history_ = new HistoryService; - if (!history_->Init(history_dir_, NULL)) { + if (!history_->Init(FilePath::FromWStringHack(history_dir_), NULL)) { history_ = NULL; // Tests should notice this NULL ptr & fail. return; } diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index 3018f25..6677145 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -378,7 +378,7 @@ TEST_F(HistoryTest, ClearBrowsingData_Downloads) { TEST_F(HistoryTest, AddPage) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); // Add the page once from a child frame. const GURL test_url("http://www.google.com/"); @@ -402,7 +402,7 @@ TEST_F(HistoryTest, AddPage) { TEST_F(HistoryTest, AddPageSameTimes) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); Time now = Time::Now(); const GURL test_urls[] = { @@ -442,7 +442,7 @@ TEST_F(HistoryTest, AddPageSameTimes) { TEST_F(HistoryTest, AddRedirect) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); const wchar_t* first_sequence[] = { L"http://first.page/", @@ -513,7 +513,7 @@ TEST_F(HistoryTest, AddRedirect) { TEST_F(HistoryTest, Typed) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); // Add the page once as typed. const GURL test_url("http://www.google.com/"); @@ -556,7 +556,7 @@ TEST_F(HistoryTest, Typed) { TEST_F(HistoryTest, SetTitle) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); // Add a URL. const GURL existing_url(L"http://www.google.com/"); @@ -587,7 +587,7 @@ TEST_F(HistoryTest, Segments) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); static const void* scope = static_cast<void*>(this); @@ -653,7 +653,7 @@ TEST_F(HistoryTest, Segments) { TEST_F(HistoryTest, Thumbnails) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); scoped_ptr<SkBitmap> thumbnail( JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); @@ -803,7 +803,7 @@ class HistoryDBTaskImpl : public HistoryDBTask { TEST_F(HistoryTest, HistoryDBTask) { CancelableRequestConsumerT<int, 0> request_consumer; HistoryService* history = new HistoryService(); - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); scoped_refptr<HistoryDBTaskImpl> task(new HistoryDBTaskImpl()); history_service_ = history; history->ScheduleDBTask(task.get(), &request_consumer); @@ -821,7 +821,7 @@ TEST_F(HistoryTest, HistoryDBTask) { TEST_F(HistoryTest, HistoryDBTaskCanceled) { CancelableRequestConsumerT<int, 0> request_consumer; HistoryService* history = new HistoryService(); - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); scoped_refptr<HistoryDBTaskImpl> task(new HistoryDBTaskImpl()); history_service_ = history; history->ScheduleDBTask(task.get(), &request_consumer); |