Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: components/history/core/browser/history_backend.h

Issue 2406423003: Remove MessageLoop::current() from history_service.cc (Closed)
Patch Set: CR sdefresne #11 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/history/core/browser/history_backend.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 23 matching lines...) Expand all
34 #include "components/history/core/browser/visit_tracker.h" 34 #include "components/history/core/browser/visit_tracker.h"
35 #include "sql/init_status.h" 35 #include "sql/init_status.h"
36 36
37 class HistoryURLProvider; 37 class HistoryURLProvider;
38 struct HistoryURLProviderParams; 38 struct HistoryURLProviderParams;
39 class SkBitmap; 39 class SkBitmap;
40 class TestingProfile; 40 class TestingProfile;
41 struct ThumbnailScore; 41 struct ThumbnailScore;
42 42
43 namespace base { 43 namespace base {
44 class MessageLoop;
45 class SingleThreadTaskRunner; 44 class SingleThreadTaskRunner;
46 } 45 }
47 46
48 namespace history { 47 namespace history {
49 class CommitLaterTask; 48 class CommitLaterTask;
50 struct DownloadRow; 49 struct DownloadRow;
51 class HistoryBackendClient; 50 class HistoryBackendClient;
52 class HistoryBackendDBBaseTest; 51 class HistoryBackendDBBaseTest;
53 class HistoryBackendObserver; 52 class HistoryBackendObserver;
54 class HistoryBackendTest; 53 class HistoryBackendTest;
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 // This object will TAKE OWNERSHIP of the given data pointer, and will 449 // This object will TAKE OWNERSHIP of the given data pointer, and will
451 // delete the object if it is changed or the object is destroyed. 450 // delete the object if it is changed or the object is destroyed.
452 base::SupportsUserData::Data* GetUserData(const void* key) const; 451 base::SupportsUserData::Data* GetUserData(const void* key) const;
453 void SetUserData(const void* key, base::SupportsUserData::Data* data); 452 void SetUserData(const void* key, base::SupportsUserData::Data* data);
454 453
455 // Testing ------------------------------------------------------------------- 454 // Testing -------------------------------------------------------------------
456 455
457 // Sets the task to run and the message loop to run it on when this object 456 // Sets the task to run and the message loop to run it on when this object
458 // is destroyed. See HistoryService::SetOnBackendDestroyTask for a more 457 // is destroyed. See HistoryService::SetOnBackendDestroyTask for a more
459 // complete description. 458 // complete description.
460 void SetOnBackendDestroyTask(base::MessageLoop* message_loop, 459 void SetOnBackendDestroyTask(
461 const base::Closure& task); 460 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
461 const base::Closure& task);
462 462
463 // Adds the given rows to the database if it doesn't exist. A visit will be 463 // Adds the given rows to the database if it doesn't exist. A visit will be
464 // added for each given URL at the last visit time in the URLRow if the 464 // added for each given URL at the last visit time in the URLRow if the
465 // passed visit type != SOURCE_SYNCED (the sync code manages visits itself). 465 // passed visit type != SOURCE_SYNCED (the sync code manages visits itself).
466 // Each visit will have the visit_source type set. 466 // Each visit will have the visit_source type set.
467 void AddPagesWithDetails(const URLRows& info, VisitSource visit_source); 467 void AddPagesWithDetails(const URLRows& info, VisitSource visit_source);
468 468
469 #if defined(UNIT_TEST) 469 #if defined(UNIT_TEST)
470 HistoryDatabase* db() const { return db_.get(); } 470 HistoryDatabase* db() const { return db_.get(); }
471 471
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 // 845 //
846 // As with AddPage, the last item in the redirect chain will be the 846 // As with AddPage, the last item in the redirect chain will be the
847 // destination of the redirect (i.e., the key into recent_redirects_); 847 // destination of the redirect (i.e., the key into recent_redirects_);
848 typedef base::MRUCache<GURL, RedirectList> RedirectCache; 848 typedef base::MRUCache<GURL, RedirectList> RedirectCache;
849 RedirectCache recent_redirects_; 849 RedirectCache recent_redirects_;
850 850
851 // Timestamp of the first entry in our database. 851 // Timestamp of the first entry in our database.
852 base::Time first_recorded_time_; 852 base::Time first_recorded_time_;
853 853
854 // When set, this is the task that should be invoked on destruction. 854 // When set, this is the task that should be invoked on destruction.
855 base::MessageLoop* backend_destroy_message_loop_; 855 scoped_refptr<base::SingleThreadTaskRunner> backend_destroy_task_runner_;
856 base::Closure backend_destroy_task_; 856 base::Closure backend_destroy_task_;
857 857
858 // Tracks page transition types. 858 // Tracks page transition types.
859 VisitTracker tracker_; 859 VisitTracker tracker_;
860 860
861 // A boolean variable to track whether we have already purged obsolete segment 861 // A boolean variable to track whether we have already purged obsolete segment
862 // data. 862 // data.
863 bool segment_queried_; 863 bool segment_queried_;
864 864
865 // List of QueuedHistoryDBTasks to run; 865 // List of QueuedHistoryDBTasks to run;
(...skipping 26 matching lines...) Expand all
892 892
893 // List of observers 893 // List of observers
894 base::ObserverList<HistoryBackendObserver> observers_; 894 base::ObserverList<HistoryBackendObserver> observers_;
895 895
896 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); 896 DISALLOW_COPY_AND_ASSIGN(HistoryBackend);
897 }; 897 };
898 898
899 } // namespace history 899 } // namespace history
900 900
901 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ 901 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_
OLDNEW
« no previous file with comments | « no previous file | components/history/core/browser/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698