| 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 #ifndef CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ |
| 6 #define CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ | 6 #define CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ |
| 7 | 7 |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/scoped_observer.h" |
| 19 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 20 #include "base/task/cancelable_task_tracker.h" | 21 #include "base/task/cancelable_task_tracker.h" |
| 21 #include "chrome/browser/history/history_db_task.h" | 22 #include "chrome/browser/history/history_db_task.h" |
| 22 #include "chrome/browser/history/in_memory_url_index_types.h" | 23 #include "chrome/browser/history/in_memory_url_index_types.h" |
| 23 #include "chrome/browser/history/scored_history_match.h" | 24 #include "chrome/browser/history/scored_history_match.h" |
| 24 #include "components/history/core/browser/history_service_observer.h" | 25 #include "components/history/core/browser/history_service_observer.h" |
| 25 #include "components/history/core/browser/history_types.h" | 26 #include "components/history/core/browser/history_types.h" |
| 26 #include "content/public/browser/notification_observer.h" | 27 #include "content/public/browser/notification_observer.h" |
| 27 #include "content/public/browser/notification_registrar.h" | 28 #include "content/public/browser/notification_registrar.h" |
| 28 #include "sql/connection.h" | 29 #include "sql/connection.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 const content::NotificationDetails& details) override; | 241 const content::NotificationDetails& details) override; |
| 241 | 242 |
| 242 // HistoryServiceObserver: | 243 // HistoryServiceObserver: |
| 243 void OnURLVisited(HistoryService* history_service, | 244 void OnURLVisited(HistoryService* history_service, |
| 244 ui::PageTransition transition, | 245 ui::PageTransition transition, |
| 245 const URLRow& row, | 246 const URLRow& row, |
| 246 const RedirectList& redirects, | 247 const RedirectList& redirects, |
| 247 base::Time visit_time) override; | 248 base::Time visit_time) override; |
| 248 void OnURLsModified(HistoryService* history_service, | 249 void OnURLsModified(HistoryService* history_service, |
| 249 const URLRows& changed_urls) override; | 250 const URLRows& changed_urls) override; |
| 251 void OnHistoryServiceLoaded(HistoryService* history_service) override; |
| 250 | 252 |
| 251 // Notification handlers. | 253 // Notification handlers. |
| 252 void OnURLsDeleted(const URLsDeletedDetails* details); | 254 void OnURLsDeleted(const URLsDeletedDetails* details); |
| 253 | 255 |
| 254 // Sets the directory wherein the cache file will be maintained. | 256 // Sets the directory wherein the cache file will be maintained. |
| 255 // For unit test usage only. | 257 // For unit test usage only. |
| 256 void set_history_dir(const base::FilePath& dir_path) { | 258 void set_history_dir(const base::FilePath& dir_path) { |
| 257 history_dir_ = dir_path; | 259 history_dir_ = dir_path; |
| 258 } | 260 } |
| 259 | 261 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 305 |
| 304 // Set to true once the index restoration is complete. | 306 // Set to true once the index restoration is complete. |
| 305 bool restored_; | 307 bool restored_; |
| 306 | 308 |
| 307 // Set to true when changes to the index have been made and the index needs | 309 // Set to true when changes to the index have been made and the index needs |
| 308 // to be cached. Set to false when the index has been cached. Used as a | 310 // to be cached. Set to false when the index has been cached. Used as a |
| 309 // temporary safety check to insure that the cache is saved before the | 311 // temporary safety check to insure that the cache is saved before the |
| 310 // index has been destructed. | 312 // index has been destructed. |
| 311 bool needs_to_be_cached_; | 313 bool needs_to_be_cached_; |
| 312 | 314 |
| 315 ScopedObserver<HistoryService, HistoryServiceObserver> |
| 316 history_service_observer_; |
| 317 |
| 313 DISALLOW_COPY_AND_ASSIGN(InMemoryURLIndex); | 318 DISALLOW_COPY_AND_ASSIGN(InMemoryURLIndex); |
| 314 }; | 319 }; |
| 315 | 320 |
| 316 } // namespace history | 321 } // namespace history |
| 317 | 322 |
| 318 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ | 323 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ |
| OLD | NEW |