OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WEBDATA_WEB_DATA_SERVICE_H__ | 5 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
6 #define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ | 6 #define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
| 16 #include "base/message_loop_helpers.h" |
16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
17 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
18 #include "chrome/browser/search_engines/template_url_id.h" | 19 #include "chrome/browser/search_engines/template_url_id.h" |
19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
20 #include "sql/init_status.h" | 21 #include "sql/init_status.h" |
21 | 22 |
22 class AutocompleteSyncableService; | 23 class AutocompleteSyncableService; |
23 class AutofillChange; | 24 class AutofillChange; |
24 class AutofillProfile; | 25 class AutofillProfile; |
25 class AutofillProfileSyncableService; | 26 class AutofillProfileSyncableService; |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 void RegisterRequest(WebDataRequest* request); | 565 void RegisterRequest(WebDataRequest* request); |
565 | 566 |
566 ////////////////////////////////////////////////////////////////////////////// | 567 ////////////////////////////////////////////////////////////////////////////// |
567 // | 568 // |
568 // The following methods are only invoked in the web data service thread. | 569 // The following methods are only invoked in the web data service thread. |
569 // | 570 // |
570 ////////////////////////////////////////////////////////////////////////////// | 571 ////////////////////////////////////////////////////////////////////////////// |
571 private: | 572 private: |
572 friend struct content::BrowserThread::DeleteOnThread< | 573 friend struct content::BrowserThread::DeleteOnThread< |
573 content::BrowserThread::UI>; | 574 content::BrowserThread::UI>; |
574 friend class DeleteTask<WebDataService>; | 575 friend class base::DeleteHelper<WebDataService>; |
575 friend class ShutdownTask; | |
576 | 576 |
577 typedef GenericRequest2<std::vector<const TemplateURL*>, | 577 typedef GenericRequest2<std::vector<const TemplateURL*>, |
578 std::vector<TemplateURL*> > SetKeywordsRequest; | 578 std::vector<TemplateURL*> > SetKeywordsRequest; |
579 | 579 |
580 // Invoked on the main thread if initializing the db fails. | 580 // Invoked on the main thread if initializing the db fails. |
581 void DBInitFailed(sql::InitStatus init_status); | 581 void DBInitFailed(sql::InitStatus init_status); |
582 | 582 |
583 // Initialize the database, if it hasn't already been initialized. | 583 // Initialize the database, if it hasn't already been initialized. |
584 void InitializeDatabaseIfNecessary(); | 584 void InitializeDatabaseIfNecessary(); |
585 | 585 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 // result can be NULL, if no result is expected or if the database could | 754 // result can be NULL, if no result is expected or if the database could |
755 // not be opened. The result object is destroyed after this call. | 755 // not be opened. The result object is destroyed after this call. |
756 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, | 756 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, |
757 const WDTypedResult* result) = 0; | 757 const WDTypedResult* result) = 0; |
758 | 758 |
759 protected: | 759 protected: |
760 virtual ~WebDataServiceConsumer() {} | 760 virtual ~WebDataServiceConsumer() {} |
761 }; | 761 }; |
762 | 762 |
763 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ | 763 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
OLD | NEW |