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

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

Issue 7692006: IndexedDB API cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Copyright presubmit Created 9 years, 4 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
« no previous file with comments | « no previous file | content/browser/in_process_webkit/indexed_db_callbacks.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fc9ff81d4dc44d46a39826904fd9598db72f388a..df60ec0f803857dfaab5323f81adb2019b690396 100644
--- a/content/browser/in_process_webkit/indexed_db_callbacks.h
+++ b/content/browser/in_process_webkit/indexed_db_callbacks.h
@@ -16,14 +16,17 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
-class IndexedDBMsg_CallbacksSuccessIDBIndex;
+class IndexedDBMsg_CallbacksSuccessIDBDatabase;
class IndexedDBMsg_CallbacksSuccessIDBTransaction;
// Template magic to figure out what message to send to the renderer based on
// which (overloaded) onSuccess method we expect to be called.
template <class Type> struct WebIDBToMsgHelper { };
-template <> struct WebIDBToMsgHelper<WebKit::WebIDBIndex> {
- typedef IndexedDBMsg_CallbacksSuccessIDBIndex MsgType;
+template <> struct WebIDBToMsgHelper<WebKit::WebIDBDatabase> {
+ typedef IndexedDBMsg_CallbacksSuccessIDBDatabase MsgType;
+};
+template <> struct WebIDBToMsgHelper<WebKit::WebIDBTransaction> {
+ typedef IndexedDBMsg_CallbacksSuccessIDBTransaction MsgType;
};
// The code the following two classes share.
@@ -55,53 +58,19 @@ template <class WebObjectType>
class IndexedDBCallbacks : public IndexedDBCallbacksBase {
public:
IndexedDBCallbacks(
- IndexedDBDispatcherHost* dispatcher_host, int32 response_id)
- : IndexedDBCallbacksBase(dispatcher_host, response_id) { }
-
- virtual void onSuccess(WebObjectType* idb_object) {
- int32 object_id = dispatcher_host()->Add(idb_object);
- dispatcher_host()->Send(
- new typename WebIDBToMsgHelper<WebObjectType>::MsgType(response_id(),
- object_id));
- }
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
-};
-
-template <>
-class IndexedDBCallbacks<WebKit::WebIDBTransaction>
- : public IndexedDBCallbacksBase {
- public:
- IndexedDBCallbacks(
IndexedDBDispatcherHost* dispatcher_host, int32 response_id,
const GURL& origin_url)
: IndexedDBCallbacksBase(dispatcher_host, response_id),
origin_url_(origin_url) {
}
- virtual void onSuccess(WebKit::WebIDBTransaction* idb_object);
- const GURL& origin_url() const { return origin_url_; }
-
- private:
- const GURL& origin_url_;
- DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
-};
-
-template <>
-class IndexedDBCallbacks<WebKit::WebIDBDatabase>
- : public IndexedDBCallbacksBase {
- public:
- IndexedDBCallbacks(
- IndexedDBDispatcherHost* dispatcher_host, int32 response_id,
- const GURL& origin_url)
- : IndexedDBCallbacksBase(dispatcher_host, response_id),
- origin_url_(origin_url) {
+ virtual void onSuccess(WebObjectType* idb_object) {
+ int32 object_id = dispatcher_host()->Add(idb_object, origin_url_);
+ dispatcher_host()->Send(
+ new typename WebIDBToMsgHelper<WebObjectType>::MsgType(response_id(),
+ object_id));
}
- virtual void onSuccess(WebKit::WebIDBDatabase* idb_object);
- const GURL& origin_url() const { return origin_url_; }
-
private:
GURL origin_url_;
DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
« no previous file with comments | « no previous file | content/browser/in_process_webkit/indexed_db_callbacks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698