Index: chrome/browser/api/webdata/web_data_service_base.h |
diff --git a/chrome/browser/api/webdata/web_data_service_base.h b/chrome/browser/api/webdata/web_data_service_base.h |
index 9a6f92640cf7bc591a3da420cbd86f2be8f6b198..dc30fc123559bddf8d1a042a7cda0500b0ecfcac 100644 |
--- a/chrome/browser/api/webdata/web_data_service_base.h |
+++ b/chrome/browser/api/webdata/web_data_service_base.h |
@@ -5,6 +5,7 @@ |
#ifndef CHROME_BROWSER_API_WEBDATA_WEB_DATA_SERVICE_BASE_H_ |
#define CHROME_BROWSER_API_WEBDATA_WEB_DATA_SERVICE_BASE_H_ |
+#include "base/callback_forward.h" |
#include "base/files/file_path.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
@@ -27,7 +28,16 @@ class WebDataServiceBase |
// All requests return an opaque handle of the following type. |
typedef int Handle; |
- WebDataServiceBase(); |
+ // Users of this class may provide a callback to handle errors |
+ // (e.g. by showing a UI). The callback is called only on error, and |
+ // takes a single parameter, the sql::InitStatus value from trying |
+ // to open the database. |
+ // TODO(joi): Should we combine this with WebDatabaseService::InitCallback? |
+ typedef base::Callback<void(sql::InitStatus)> ProfileErrorCallback; |
+ |
+ // |callback| will only be invoked on error, and only if |
+ // |callback.is_null()| evaluates to false. |
+ explicit WebDataServiceBase(const ProfileErrorCallback& callback); |
// Cancel any pending request. You need to call this method if your |
// WebDataServiceConsumer is about to be deleted. |
@@ -74,6 +84,8 @@ class WebDataServiceBase |
content::BrowserThread::UI>; |
friend class base::DeleteHelper<WebDataServiceBase>; |
+ ProfileErrorCallback profile_error_callback_; |
+ |
void DBInitFailed(sql::InitStatus sql_status); |
void NotifyDatabaseLoadedOnUIThread(); |
void DatabaseInitOnDB(sql::InitStatus status); |