[email protected] | d0c005a | 2010-06-09 16:58:32 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | acb9472 | 2011-03-18 01:33:34 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_RENDERER_WEBIDBOBJECTSTORE_IMPL_H_ |
| 6 | #define CONTENT_RENDERER_RENDERER_WEBIDBOBJECTSTORE_IMPL_H_ |
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 7 | #pragma once |
[email protected] | d0c005a | 2010-06-09 16:58:32 | [diff] [blame] | 8 | |
| 9 | #include "base/basictypes.h" |
[email protected] | 8bd0fe6 | 2011-01-17 06:44:37 | [diff] [blame] | 10 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" |
| 11 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBObjectStore.h" |
[email protected] | d0c005a | 2010-06-09 16:58:32 | [diff] [blame] | 12 | |
| 13 | namespace WebKit { |
| 14 | class WebFrame; |
| 15 | class WebIDBCallbacks; |
[email protected] | e14eab9 | 2010-06-14 13:50:15 | [diff] [blame] | 16 | class WebIDBIndex; |
[email protected] | 5c71640c | 2010-07-14 14:29:40 | [diff] [blame] | 17 | class WebIDBKey; |
[email protected] | 5196b0cd | 2010-08-11 09:03:52 | [diff] [blame] | 18 | class WebIDBKeyRange; |
[email protected] | d0c005a | 2010-06-09 16:58:32 | [diff] [blame] | 19 | class WebString; |
| 20 | } |
| 21 | |
| 22 | class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore { |
| 23 | public: |
| 24 | explicit RendererWebIDBObjectStoreImpl(int32 idb_object_store_id); |
[email protected] | 3690ebe0 | 2011-05-25 09:08:19 | [diff] [blame] | 25 | virtual ~RendererWebIDBObjectStoreImpl(); |
[email protected] | d0c005a | 2010-06-09 16:58:32 | [diff] [blame] | 26 | |
| 27 | // WebKit::WebIDBObjectStore |
[email protected] | 78994ab0 | 2010-12-08 18:06:44 | [diff] [blame] | 28 | virtual WebKit::WebString name() const; |
| 29 | virtual WebKit::WebString keyPath() const; |
| 30 | virtual WebKit::WebDOMStringList indexNames() const; |
[email protected] | 5c71640c | 2010-07-14 14:29:40 | [diff] [blame] | 31 | |
[email protected] | 78994ab0 | 2010-12-08 18:06:44 | [diff] [blame] | 32 | virtual void get(const WebKit::WebIDBKey& key, |
| 33 | WebKit::WebIDBCallbacks* callbacks, |
| 34 | const WebKit::WebIDBTransaction& transaction, |
| 35 | WebKit::WebExceptionCode& ec); |
| 36 | virtual void put(const WebKit::WebSerializedScriptValue& value, |
| 37 | const WebKit::WebIDBKey& key, |
[email protected] | 2758531 | 2011-02-02 16:50:42 | [diff] [blame] | 38 | PutMode put_mode, |
[email protected] | 78994ab0 | 2010-12-08 18:06:44 | [diff] [blame] | 39 | WebKit::WebIDBCallbacks* callbacks, |
| 40 | const WebKit::WebIDBTransaction& transaction, |
| 41 | WebKit::WebExceptionCode& ec); |
| 42 | virtual void deleteFunction(const WebKit::WebIDBKey& key, |
| 43 | WebKit::WebIDBCallbacks* callbacks, |
| 44 | const WebKit::WebIDBTransaction& transaction, |
| 45 | WebKit::WebExceptionCode& ec); |
[email protected] | 68fd322 | 2011-02-10 23:06:31 | [diff] [blame] | 46 | virtual void clear(WebKit::WebIDBCallbacks* callbacks, |
| 47 | const WebKit::WebIDBTransaction& transaction, |
| 48 | WebKit::WebExceptionCode& ec); |
[email protected] | e14eab9 | 2010-06-14 13:50:15 | [diff] [blame] | 49 | |
[email protected] | 78994ab0 | 2010-12-08 18:06:44 | [diff] [blame] | 50 | virtual WebKit::WebIDBIndex* createIndex( |
[email protected] | 6450c6e0 | 2010-10-06 21:27:17 | [diff] [blame] | 51 | const WebKit::WebString& name, |
| 52 | const WebKit::WebString& key_path, |
| 53 | bool unique, |
[email protected] | fb033cdc | 2010-10-13 07:19:42 | [diff] [blame] | 54 | const WebKit::WebIDBTransaction& transaction, |
| 55 | WebKit::WebExceptionCode& ec); |
[email protected] | e14eab9 | 2010-06-14 13:50:15 | [diff] [blame] | 56 | // Transfers ownership of the WebIDBIndex to the caller. |
[email protected] | 78994ab0 | 2010-12-08 18:06:44 | [diff] [blame] | 57 | virtual WebKit::WebIDBIndex* index(const WebKit::WebString& name, |
| 58 | WebKit::WebExceptionCode& ec); |
| 59 | virtual void deleteIndex(const WebKit::WebString& name, |
| 60 | const WebKit::WebIDBTransaction& transaction, |
| 61 | WebKit::WebExceptionCode& ec); |
[email protected] | d5fbd539 | 2010-09-23 13:34:02 | [diff] [blame] | 62 | |
[email protected] | 78994ab0 | 2010-12-08 18:06:44 | [diff] [blame] | 63 | virtual void openCursor(const WebKit::WebIDBKeyRange& idb_key_range, |
[email protected] | d5fbd539 | 2010-09-23 13:34:02 | [diff] [blame] | 64 | unsigned short direction, |
| 65 | WebKit::WebIDBCallbacks* callbacks, |
[email protected] | fb033cdc | 2010-10-13 07:19:42 | [diff] [blame] | 66 | const WebKit::WebIDBTransaction& transaction, |
| 67 | WebKit::WebExceptionCode& ec); |
[email protected] | d0c005a | 2010-06-09 16:58:32 | [diff] [blame] | 68 | private: |
| 69 | int32 idb_object_store_id_; |
| 70 | }; |
| 71 | |
[email protected] | acb9472 | 2011-03-18 01:33:34 | [diff] [blame] | 72 | #endif // CONTENT_RENDERER_RENDERER_WEBIDBOBJECTSTORE_IMPL_H_ |