| 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/in_memory_url_index.h" | 5 #include "chrome/browser/history/in_memory_url_index.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "content/public/browser/notification_source.h" | 24 #include "content/public/browser/notification_source.h" |
| 25 | 25 |
| 26 using in_memory_url_index::InMemoryURLIndexCacheItem; | 26 using in_memory_url_index::InMemoryURLIndexCacheItem; |
| 27 | 27 |
| 28 namespace history { | 28 namespace history { |
| 29 | 29 |
| 30 // Called by DoSaveToCacheFile to delete any old cache file at |path| when | 30 // Called by DoSaveToCacheFile to delete any old cache file at |path| when |
| 31 // there is no private data to save. Runs on the FILE thread. | 31 // there is no private data to save. Runs on the FILE thread. |
| 32 void DeleteCacheFile(const base::FilePath& path) { | 32 void DeleteCacheFile(const base::FilePath& path) { |
| 33 DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 33 DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 34 base::Delete(path, false); | 34 base::DeleteFile(path, false); |
| 35 } | 35 } |
| 36 | 36 |
| 37 // Initializes a whitelist of URL schemes. | 37 // Initializes a whitelist of URL schemes. |
| 38 void InitializeSchemeWhitelist(std::set<std::string>* whitelist) { | 38 void InitializeSchemeWhitelist(std::set<std::string>* whitelist) { |
| 39 DCHECK(whitelist); | 39 DCHECK(whitelist); |
| 40 if (!whitelist->empty()) | 40 if (!whitelist->empty()) |
| 41 return; // Nothing to do, already initialized. | 41 return; // Nothing to do, already initialized. |
| 42 whitelist->insert(std::string(chrome::kAboutScheme)); | 42 whitelist->insert(std::string(chrome::kAboutScheme)); |
| 43 whitelist->insert(std::string(chrome::kChromeUIScheme)); | 43 whitelist->insert(std::string(chrome::kChromeUIScheme)); |
| 44 whitelist->insert(std::string(chrome::kFileScheme)); | 44 whitelist->insert(std::string(chrome::kFileScheme)); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 base::Bind(DeleteCacheFile, path)); | 339 base::Bind(DeleteCacheFile, path)); |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 | 342 |
| 343 void InMemoryURLIndex::OnCacheSaveDone(bool succeeded) { | 343 void InMemoryURLIndex::OnCacheSaveDone(bool succeeded) { |
| 344 if (save_cache_observer_) | 344 if (save_cache_observer_) |
| 345 save_cache_observer_->OnCacheSaveFinished(succeeded); | 345 save_cache_observer_->OnCacheSaveFinished(succeeded); |
| 346 } | 346 } |
| 347 | 347 |
| 348 } // namespace history | 348 } // namespace history |
| OLD | NEW |