Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ |
| 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" | 11 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseError.h " | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseError.h " |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
| 18 | 18 |
| 19 class IndexedDBMsg_CallbacksSuccessIDBIndex; | |
| 20 class IndexedDBMsg_CallbacksSuccessIDBTransaction; | 19 class IndexedDBMsg_CallbacksSuccessIDBTransaction; |
| 21 | 20 |
| 22 // Template magic to figure out what message to send to the renderer based on | 21 // Template magic to figure out what message to send to the renderer based on |
| 23 // which (overloaded) onSuccess method we expect to be called. | 22 // which (overloaded) onSuccess method we expect to be called. |
| 24 template <class Type> struct WebIDBToMsgHelper { }; | 23 template <class Type> struct WebIDBToMsgHelper { }; |
|
dgrogan
2011/08/19 21:30:53
Can you add a TODO to (or just) delete WebIDBToMsg
adamk
2011/08/19 22:24:24
I've re-templatized two of these specializations,
| |
| 25 template <> struct WebIDBToMsgHelper<WebKit::WebIDBIndex> { | |
| 26 typedef IndexedDBMsg_CallbacksSuccessIDBIndex MsgType; | |
| 27 }; | |
| 28 | 24 |
| 29 // The code the following two classes share. | 25 // The code the following two classes share. |
| 30 class IndexedDBCallbacksBase : public WebKit::WebIDBCallbacks { | 26 class IndexedDBCallbacksBase : public WebKit::WebIDBCallbacks { |
| 31 public: | 27 public: |
| 32 IndexedDBCallbacksBase(IndexedDBDispatcherHost* dispatcher_host, | 28 IndexedDBCallbacksBase(IndexedDBDispatcherHost* dispatcher_host, |
| 33 int32 response_id); | 29 int32 response_id); |
| 34 | 30 |
| 35 virtual ~IndexedDBCallbacksBase(); | 31 virtual ~IndexedDBCallbacksBase(); |
| 36 | 32 |
| 37 virtual void onError(const WebKit::WebIDBDatabaseError& error); | 33 virtual void onError(const WebKit::WebIDBDatabaseError& error); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 IndexedDBDispatcherHost* dispatcher_host, int32 response_id) | 149 IndexedDBDispatcherHost* dispatcher_host, int32 response_id) |
| 154 : IndexedDBCallbacksBase(dispatcher_host, response_id) { } | 150 : IndexedDBCallbacksBase(dispatcher_host, response_id) { } |
| 155 | 151 |
| 156 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); | 152 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); |
| 157 | 153 |
| 158 private: | 154 private: |
| 159 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); | 155 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); |
| 160 }; | 156 }; |
| 161 | 157 |
| 162 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ | 158 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ |
| OLD | NEW |