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 COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BASE_H_ | 5 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BASE_H_ |
6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BASE_H_ | 6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BASE_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "components/webdata/common/web_database_observer.h" | 12 #include "components/webdata/common/web_database_observer.h" |
13 #include "components/webdata/common/webdata_export.h" | 13 #include "components/webdata/common/webdata_export.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/browser/notification_source.h" | |
16 #include "sql/init_status.h" | 15 #include "sql/init_status.h" |
17 | 16 |
18 class WebDatabase; | 17 class WebDatabase; |
19 class WebDatabaseService; | 18 class WebDatabaseService; |
20 class WebDatabaseTable; | 19 class WebDatabaseTable; |
21 | 20 |
22 namespace base { | 21 namespace base { |
23 class Thread; | 22 class Thread; |
24 } | 23 } |
25 | 24 |
(...skipping 25 matching lines...) Expand all Loading... |
51 const ProfileErrorCallback& callback); | 50 const ProfileErrorCallback& callback); |
52 | 51 |
53 // WebDatabaseObserver implementation. | 52 // WebDatabaseObserver implementation. |
54 virtual void WebDatabaseLoaded() OVERRIDE; | 53 virtual void WebDatabaseLoaded() OVERRIDE; |
55 virtual void WebDatabaseLoadFailed(sql::InitStatus status) OVERRIDE; | 54 virtual void WebDatabaseLoadFailed(sql::InitStatus status) OVERRIDE; |
56 | 55 |
57 // Cancel any pending request. You need to call this method if your | 56 // Cancel any pending request. You need to call this method if your |
58 // WebDataServiceConsumer is about to be deleted. | 57 // WebDataServiceConsumer is about to be deleted. |
59 virtual void CancelRequest(Handle h); | 58 virtual void CancelRequest(Handle h); |
60 | 59 |
61 // Returns the notification source for this service. This may use a | |
62 // pointer other than this object's |this| pointer. | |
63 virtual content::NotificationSource GetNotificationSource(); | |
64 | |
65 // Shutdown the web data service. The service can no longer be used after this | 60 // Shutdown the web data service. The service can no longer be used after this |
66 // call. | 61 // call. |
67 virtual void ShutdownOnUIThread(); | 62 virtual void ShutdownOnUIThread(); |
68 | 63 |
69 // Initializes the web data service. | 64 // Initializes the web data service. |
70 virtual void Init(); | 65 virtual void Init(); |
71 | 66 |
72 // Unloads the database without actually shutting down the service. This can | 67 // Unloads the database without actually shutting down the service. This can |
73 // be used to temporarily reduce the browser process' memory footprint. | 68 // be used to temporarily reduce the browser process' memory footprint. |
74 void UnloadDatabase(); | 69 void UnloadDatabase(); |
(...skipping 27 matching lines...) Expand all Loading... |
102 content::BrowserThread::UI>; | 97 content::BrowserThread::UI>; |
103 friend class base::DeleteHelper<WebDataServiceBase>; | 98 friend class base::DeleteHelper<WebDataServiceBase>; |
104 // We have to friend RCTS<> so WIN shared-lib build is happy (crbug/112250). | 99 // We have to friend RCTS<> so WIN shared-lib build is happy (crbug/112250). |
105 friend class base::RefCountedThreadSafe<WebDataServiceBase, | 100 friend class base::RefCountedThreadSafe<WebDataServiceBase, |
106 content::BrowserThread::DeleteOnUIThread>; | 101 content::BrowserThread::DeleteOnUIThread>; |
107 | 102 |
108 ProfileErrorCallback profile_error_callback_; | 103 ProfileErrorCallback profile_error_callback_; |
109 }; | 104 }; |
110 | 105 |
111 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BASE_H_ | 106 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BASE_H_ |
OLD | NEW |