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

Unified Diff: content/browser/in_process_webkit/indexed_db_callbacks.h

Issue 16573003: Remove content/browser dependency on WebKit::WebIDBCallbacks and WebKit::WebIDBDatabaseCallbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove more #includes and forward declarations Created 7 years, 6 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: content/browser/in_process_webkit/indexed_db_callbacks.h
diff --git a/content/browser/in_process_webkit/indexed_db_callbacks.h b/content/browser/in_process_webkit/indexed_db_callbacks.h
index e4e283900411adeb3dfa7591596436f46bd2d4a7..022615a421404ab0e14a2ae46800a03e602d3298 100644
--- a/content/browser/in_process_webkit/indexed_db_callbacks.h
+++ b/content/browser/in_process_webkit/indexed_db_callbacks.h
@@ -10,21 +10,47 @@
#include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/public/platform/WebData.h"
-#include "third_party/WebKit/public/platform/WebIDBCallbacks.h"
-#include "third_party/WebKit/public/platform/WebIDBCursor.h"
#include "third_party/WebKit/public/platform/WebIDBDatabase.h"
#include "third_party/WebKit/public/platform/WebIDBDatabaseError.h"
#include "third_party/WebKit/public/platform/WebString.h"
namespace content {
+class WebIDBCursorImpl;
+class WebIDBDatabaseImpl;
-class IndexedDBCallbacksBase : public WebKit::WebIDBCallbacks {
+class IndexedDBCallbacksBase {
public:
virtual ~IndexedDBCallbacksBase();
virtual void onError(const WebKit::WebIDBDatabaseError& error);
virtual void onBlocked(long long old_version);
+ // implemented by subclasses, but need to be called later
+ virtual void onSuccess(const WebKit::WebVector<WebKit::WebString>& value);
+ virtual void onSuccess(WebIDBDatabaseImpl* idb_object,
+ const WebKit::WebIDBMetadata& metadata);
+ virtual void onUpgradeNeeded(long long old_version,
+ WebIDBDatabaseImpl* database,
+ const WebKit::WebIDBMetadata&);
+ virtual void onSuccess(WebIDBCursorImpl* idb_object,
+ const WebKit::WebIDBKey& key,
+ const WebKit::WebIDBKey& primaryKey,
+ const WebKit::WebData& value);
+ virtual void onSuccess(const WebKit::WebIDBKey& key,
+ const WebKit::WebIDBKey& primaryKey,
+ const WebKit::WebData& value);
+ virtual void onSuccess(const WebKit::WebData& value);
+ virtual void onSuccessWithPrefetch(
+ const WebKit::WebVector<WebKit::WebIDBKey>& keys,
+ const WebKit::WebVector<WebKit::WebIDBKey>& primaryKeys,
+ const WebKit::WebVector<WebKit::WebData>& values);
+ virtual void onSuccess(const WebKit::WebIDBKey& value);
+ virtual void onSuccess(const WebKit::WebData& value,
+ const WebKit::WebIDBKey& key,
+ const WebKit::WebIDBKeyPath& keyPath);
+ virtual void onSuccess(long long value);
+ virtual void onSuccess();
+
protected:
IndexedDBCallbacksBase(IndexedDBDispatcherHost* dispatcher_host,
int32 ipc_thread_id,
@@ -52,21 +78,18 @@ class IndexedDBCallbacks : public IndexedDBCallbacksBase {
class IndexedDBCallbacksDatabase : public IndexedDBCallbacksBase {
public:
- IndexedDBCallbacksDatabase(
- IndexedDBDispatcherHost* dispatcher_host,
- int32 ipc_thread_id,
- int32 ipc_callbacks_id,
- int32 ipc_database_callbacks_id,
- int64 host_transaction_id,
- const GURL& origin_url);
-
- virtual void onSuccess(
- WebKit::WebIDBDatabase* idb_object,
- const WebKit::WebIDBMetadata& metadata);
- virtual void onUpgradeNeeded(
- long long old_version,
- WebKit::WebIDBDatabase* database,
- const WebKit::WebIDBMetadata&);
+ IndexedDBCallbacksDatabase(IndexedDBDispatcherHost* dispatcher_host,
+ int32 ipc_thread_id,
+ int32 ipc_callbacks_id,
+ int32 ipc_database_callbacks_id,
+ int64 host_transaction_id,
+ const GURL& origin_url);
+
+ virtual void onSuccess(WebIDBDatabaseImpl* idb_object,
+ const WebKit::WebIDBMetadata& metadata) OVERRIDE;
+ virtual void onUpgradeNeeded(long long old_version,
+ WebIDBDatabaseImpl* database,
+ const WebKit::WebIDBMetadata&) OVERRIDE;
private:
int64 host_transaction_id_;
@@ -76,8 +99,8 @@ class IndexedDBCallbacksDatabase : public IndexedDBCallbacksBase {
DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacksDatabase);
};
-// WebIDBCursor uses:
-// * onSuccess(WebIDBCursor*, WebIDBKey, WebIDBKey, WebData)
+// WebIDBCursorImpl uses:
+// * onSuccess(WebIDBCursorImpl*, WebIDBKey, WebIDBKey, WebData)
// when an openCursor()/openKeyCursor() call has succeeded,
// * onSuccess(WebIDBKey, WebIDBKey, WebData)
// when an advance()/continue() call has succeeded, or
@@ -85,19 +108,18 @@ class IndexedDBCallbacksDatabase : public IndexedDBCallbacksBase {
// to indicate it does not contain any data, i.e., there is no key within
// the key range, or it has reached the end.
template <>
-class IndexedDBCallbacks<WebKit::WebIDBCursor>
- : public IndexedDBCallbacksBase {
+class IndexedDBCallbacks<WebIDBCursorImpl> : public IndexedDBCallbacksBase {
public:
- IndexedDBCallbacks(
- IndexedDBDispatcherHost* dispatcher_host,
- int32 ipc_thread_id,
- int32 ipc_callbacks_id,
- int32 ipc_cursor_id)
- : IndexedDBCallbacksBase(dispatcher_host, ipc_thread_id,
+ IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host,
+ int32 ipc_thread_id,
+ int32 ipc_callbacks_id,
+ int32 ipc_cursor_id)
+ : IndexedDBCallbacksBase(dispatcher_host,
+ ipc_thread_id,
ipc_callbacks_id),
- ipc_cursor_id_(ipc_cursor_id) { }
+ ipc_cursor_id_(ipc_cursor_id) {}
- virtual void onSuccess(WebKit::WebIDBCursor* idb_object,
+ virtual void onSuccess(WebIDBCursorImpl* idb_object,
const WebKit::WebIDBKey& key,
const WebKit::WebIDBKey& primaryKey,
const WebKit::WebData& value);
@@ -122,14 +144,14 @@ class IndexedDBCallbacks<WebKit::WebIDBCursor>
// implements. Thus we pass a const ___& version and thus we need this
// specialization.
template <>
-class IndexedDBCallbacks<WebKit::WebIDBKey>
- : public IndexedDBCallbacksBase {
+class IndexedDBCallbacks<WebKit::WebIDBKey> : public IndexedDBCallbacksBase {
public:
IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host,
int32 ipc_thread_id,
int32 ipc_callbacks_id)
- : IndexedDBCallbacksBase(dispatcher_host, ipc_thread_id,
- ipc_callbacks_id) { }
+ : IndexedDBCallbacksBase(dispatcher_host,
+ ipc_thread_id,
+ ipc_callbacks_id) {}
virtual void onSuccess(const WebKit::WebIDBKey& value);
@@ -141,17 +163,17 @@ class IndexedDBCallbacks<WebKit::WebIDBKey>
// interface Chromium implements. Thus we pass a const ___& version and thus
// we need this specialization.
template <>
-class IndexedDBCallbacks<WebKit::WebVector<WebKit::WebString> >
- : public IndexedDBCallbacksBase {
+class IndexedDBCallbacks<
+ WebKit::WebVector<WebKit::WebString> > : public IndexedDBCallbacksBase {
public:
- IndexedDBCallbacks(
- IndexedDBDispatcherHost* dispatcher_host,
- int32 ipc_thread_id,
- int32 ipc_callbacks_id)
- : IndexedDBCallbacksBase(dispatcher_host, ipc_thread_id,
- ipc_callbacks_id) { }
+ IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host,
+ int32 ipc_thread_id,
+ int32 ipc_callbacks_id)
+ : IndexedDBCallbacksBase(dispatcher_host,
+ ipc_thread_id,
+ ipc_callbacks_id) {}
- virtual void onSuccess(const WebKit::WebVector<WebKit::WebString>& value);
+ virtual void onSuccess(const WebKit::WebVector<WebKit::WebString>& value);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
@@ -161,14 +183,14 @@ class IndexedDBCallbacks<WebKit::WebVector<WebKit::WebString> >
// Chromium implements. Thus we pass a const ___& version and thus we
// need this specialization.
template <>
-class IndexedDBCallbacks<WebKit::WebData>
- : public IndexedDBCallbacksBase {
+class IndexedDBCallbacks<WebKit::WebData> : public IndexedDBCallbacksBase {
public:
IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host,
int32 ipc_thread_id,
int32 ipc_callbacks_id)
- : IndexedDBCallbacksBase(dispatcher_host, ipc_thread_id,
- ipc_callbacks_id) { }
+ : IndexedDBCallbacksBase(dispatcher_host,
+ ipc_thread_id,
+ ipc_callbacks_id) {}
virtual void onSuccess(const WebKit::WebData& value);
virtual void onSuccess(const WebKit::WebData& value,

Powered by Google App Engine
This is Rietveld 408576698