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

Unified Diff: components/webdata/common/web_database_observer.h

Issue 14103021: Use Observer to notify of WebDB load instead of callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix WIN builds Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/webdata/common/web_database_observer.h
diff --git a/components/webdata/common/web_database_observer.h b/components/webdata/common/web_database_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ea80026afed53952096a1feaf915d7b2b2b207d
--- /dev/null
+++ b/components/webdata/common/web_database_observer.h
@@ -0,0 +1,26 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_OBSERVER_H_
+#define COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_OBSERVER_H_
+
+#include "components/webdata/common/webdata_export.h"
+#include "sql/init_status.h"
+
+// WebDatabase loads asynchronously on the DB thread. Clients on the UI thread
+// can use this interface to be notified when the load is complete, or if it
+// fails.
+class WEBDATA_EXPORT WebDatabaseObserver {
+ public:
+ // Called when DB has been loaded successfully.
+ virtual void WebDatabaseLoaded() = 0;
+ // Called when load failed. |status| contains error code.
+ virtual void WebDatabaseLoadFailed(sql::InitStatus status) {};
+
+ protected:
+ virtual ~WebDatabaseObserver() {}
+};
+
+
+#endif // COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_OBSERVER_H_
« no previous file with comments | « components/webdata/common/web_data_service_base.cc ('k') | components/webdata/common/web_database_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698