Changeset 56713 in webkit
- Timestamp:
- Mar 29, 2010 2:26:16 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r56711 r56713 1 2010-03-24 Jeremy Orlow <jorlow@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 A few more steps towards IndexedDB 6 https://bugs.webkit.org/show_bug.cgi?id=36546 7 8 Add a callback interface to be used by all async methods. 9 Add the first fragments of IDBDatabase. 10 Clean up on IDBDatabaseError. 11 Flesh out IndexedDatabase further. 12 13 Not enough hooked up yet to test. Soon though... 14 15 * WebCore.gypi: 16 * storage/IDBCallbacks.h: Added. 17 (WebCore::IDBCallbacks::~IDBCallbacks): 18 * storage/IDBDatabase.cpp: Added. 19 * storage/IDBDatabase.h: Added. 20 (WebCore::IDBDatabase::~IDBDatabase): 21 * storage/IDBDatabaseError.h: 22 (WebCore::IDBDatabaseError::create): 23 (WebCore::IDBDatabaseError::message): 24 (WebCore::IDBDatabaseError::IDBDatabaseError): 25 * storage/IndexedDatabase.h: 26 * storage/IndexedDatabaseImpl.cpp: 27 (WebCore::IndexedDatabaseImpl::IndexedDatabaseImpl): 28 (WebCore::IndexedDatabaseImpl::~IndexedDatabaseImpl): 29 (WebCore::IndexedDatabaseImpl::open): 30 * storage/IndexedDatabaseImpl.h: 31 * storage/IndexedDatabaseRequest.cpp: 32 (WebCore::IndexedDatabaseRequest::open): 33 1 34 2010-03-29 Mikhail Naganov <mnaganov@chromium.org> 2 35 -
trunk/WebCore/WebCore.gypi
r56704 r56713 3268 3268 'storage/DatabaseTracker.h', 3269 3269 'storage/DatabaseTrackerClient.h', 3270 'storage/IDBCallbacks.h', 3271 'storage/IDBDatabase.h', 3272 'storage/IDBDatabase.cpp', 3270 3273 'storage/IDBDatabaseError.h', 3271 3274 'storage/IDBDatabaseException.h', -
trunk/WebCore/storage/IDBCallbacks.h
r56712 r56713 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 #include "config.h"29 #include "IndexedDatabaseRequest.h"30 28 31 #if ENABLE(INDEXED_DATABASE) 29 #ifndef IDBCallbacks_h 30 #define IDBCallbacks_h 32 31 33 #include "ExceptionCode.h"34 #include "IDBRequest.h"32 #include <wtf/PassRefPtr.h> 33 #include <wtf/RefCounted.h> 35 34 36 35 namespace WebCore { 37 36 38 IndexedDatabaseRequest::IndexedDatabaseRequest() 39 { 40 } 37 class IDBDatabaseError; 41 38 42 IndexedDatabaseRequest::~IndexedDatabaseRequest() 43 { 44 } 39 template <typename ResultType> 40 class IDBCallbacks : public RefCounted<IDBCallbacks<ResultType> > { 41 public: 42 virtual ~IDBCallbacks() { } 45 43 46 void IndexedDatabaseRequest::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& exception) 47 { 48 } 44 virtual void onSuccess(PassRefPtr<ResultType>) = 0; 45 virtual void onError(PassRefPtr<IDBDatabaseError>) = 0; 46 }; 49 47 50 48 } // namespace WebCore 51 49 52 #endif // ENABLE(INDEXED_DATABASE)50 #endif // IDBCallbacks_h 53 51 -
trunk/WebCore/storage/IDBDatabase.h
r56712 r56713 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 #ifndef IndexedDatabaseImpl_h29 #define IndexedDatabaseImpl_h30 28 31 #include "IndexedDatabase.h" 29 #ifndef IDBDatabase_h 30 #define IDBDatabase_h 31 32 #include <wtf/Threading.h> 32 33 33 34 #if ENABLE(INDEXED_DATABASE) … … 35 36 namespace WebCore { 36 37 37 class IndexedDatabaseImpl : public IndexedDatabase { 38 // This class is shared by IDBDatabaseRequest (async) and IDBDatabaseSync (sync). 39 // This is implemented by IDBDatabaseImpl and optionally others (in order to proxy 40 // calls across process barriers). All calls to these classes should be non-blocking and 41 // trigger work on a background thread if necessary. 42 class IDBDatabase : public ThreadSafeShared<IDBDatabase> { 38 43 public: 39 static PassRefPtr<IndexedDatabaseImpl> get(); 40 virtual ~IndexedDatabaseImpl(); 41 42 virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&); 43 44 private: 45 IndexedDatabaseImpl(); 46 47 // We only create one instance of this class at a time. 48 static IndexedDatabaseImpl* indexedDatabaseImpl; 44 virtual ~IDBDatabase() { } 45 // FIXME: Write. 49 46 }; 50 47 … … 53 50 #endif 54 51 55 #endif // I ndexedDatabaseImpl_h52 #endif // IDBDatabase_h 56 53 -
trunk/WebCore/storage/IDBDatabaseError.h
r54085 r56713 39 39 class IDBDatabaseError : public RefCounted<IDBDatabaseError> { 40 40 public: 41 static PassRefPtr<IDBDatabaseError> create( )41 static PassRefPtr<IDBDatabaseError> create(unsigned short code, const String& message) 42 42 { 43 return adoptRef(new IDBDatabaseError( ));43 return adoptRef(new IDBDatabaseError(code, message)); 44 44 } 45 45 ~IDBDatabaseError() { } … … 47 47 unsigned short code() const { return m_code; } 48 48 void setCode(unsigned short value) { m_code = value; } 49 Stringmessage() const { return m_message; }49 const String& message() const { return m_message; } 50 50 void setMessage(const String& value) { m_message = value; } 51 51 52 52 private: 53 IDBDatabaseError() { } 53 IDBDatabaseError(unsigned short code, const String& message) 54 : m_code(code), m_message(message) { } 54 55 55 56 unsigned short m_code; -
trunk/WebCore/storage/IndexedDatabase.h
r55784 r56713 30 30 31 31 #include "ExceptionCode.h" 32 #include "IDBCallbacks.h" 32 33 #include "PlatformString.h" 33 34 #include <wtf/Threading.h> … … 36 37 37 38 namespace WebCore { 39 40 class IDBDatabase; 41 42 typedef IDBCallbacks<IDBDatabase> IDBDatabaseCallbacks; 38 43 39 44 // This class is shared by IndexedDatabaseRequest (async) and IndexedDatabaseSync (sync). … … 46 51 virtual ~IndexedDatabase() { } 47 52 48 virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& ) = 0;53 virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks>) = 0; 49 54 }; 50 55 -
trunk/WebCore/storage/IndexedDatabaseImpl.cpp
r55784 r56713 29 29 #include "IndexedDatabaseImpl.h" 30 30 31 #include "IDBDatabase.h" 32 #include "IDBDatabaseError.h" 31 33 #include <wtf/Threading.h> 32 34 … … 47 49 IndexedDatabaseImpl::IndexedDatabaseImpl() 48 50 { 49 // FIXME: Make this thread safe .51 // FIXME: Make this thread safe before implementing a sync interface. 50 52 ASSERT(!indexedDatabaseImpl); 51 53 indexedDatabaseImpl = this; … … 54 56 IndexedDatabaseImpl::~IndexedDatabaseImpl() 55 57 { 56 // FIXME: Make this thread safe .58 // FIXME: Make this thread safe before implementing a sync interface. 57 59 ASSERT(indexedDatabaseImpl == this); 58 60 indexedDatabaseImpl = 0; 59 61 } 60 62 61 void IndexedDatabaseImpl::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& )63 void IndexedDatabaseImpl::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks>) 62 64 { 63 65 // FIXME: Write. 66 ASSERT_NOT_REACHED(); 64 67 } 65 68 -
trunk/WebCore/storage/IndexedDatabaseImpl.h
r55784 r56713 40 40 virtual ~IndexedDatabaseImpl(); 41 41 42 virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& );42 virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBCallbacks<IDBDatabase> >); 43 43 44 44 private: -
trunk/WebCore/storage/IndexedDatabaseRequest.cpp
r54085 r56713 46 46 void IndexedDatabaseRequest::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& exception) 47 47 { 48 // FIXME: This should initiate a request. 48 49 } 49 50 -
trunk/WebKit/chromium/ChangeLog
r56711 r56713 1 2010-03-24 Jeremy Orlow <jorlow@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 More IndexedDB plumbing 6 https://bugs.webkit.org/show_bug.cgi?id=36546 7 8 Plumbing work towards the goal of making IndexedDatabase::open work. 9 10 * WebKit.gyp: 11 * public/WebIDBCallbacks.h: Added. 12 (WebKit::WebIDBCallbacks::~WebIDBCallbacks): 13 * public/WebIDBDatabase.h: Added. 14 (WebKit::WebIDBDatabase::~WebIDBDatabase): 15 * public/WebIDBDatabaseError.h: Added. 16 (WebKit::WebIDBDatabaseError::WebIDBDatabaseError): 17 (WebKit::WebIDBDatabaseError::operator=): 18 * public/WebIndexedDatabase.h: 19 * public/WebKitClient.h: 20 (WebKit::WebKitClient::indexedDatabase): 21 * public/WebSerializedScriptValue.h: 22 * src/IDBCallbacksProxy.h: Added. 23 (WebCore::IDBCallbacksProxy::IDBCallbacksProxy): 24 (WebCore::IDBCallbacksProxy::~IDBCallbacksProxy): 25 (WebCore::IDBCallbacksProxy::onSuccess): 26 (WebCore::IDBCallbacksProxy::onError): 27 * src/IDBDatabaseProxy.cpp: Added. 28 (WebCore::IDBDatabaseProxy::create): 29 (WebCore::IDBDatabaseProxy::IDBDatabaseProxy): 30 (WebCore::IDBDatabaseProxy::~IDBDatabaseProxy): 31 * src/IDBDatabaseProxy.h: Added. 32 * src/IndexedDatabaseProxy.cpp: 33 (WebCore::IndexedDatabaseProxy::IndexedDatabaseProxy): 34 (WebCore::IndexedDatabaseProxy::open): 35 * src/IndexedDatabaseProxy.h: 36 * src/WebIDBDatabaseError.cpp: Added. 37 (WebKit::WebIDBDatabaseError::~WebIDBDatabaseError): 38 (WebKit::WebIDBDatabaseError::WebIDBDatabaseError): 39 (WebKit::WebIDBDatabaseError::assign): 40 (WebKit::WebIDBDatabaseError::code): 41 (WebKit::WebIDBDatabaseError::message): 42 (WebKit::WebIDBDatabaseError::operator=): 43 (WebKit::WebIDBDatabaseError::operator PassRefPtr<IDBDatabaseError>): 44 1 45 2010-03-29 Mikhail Naganov <mnaganov@chromium.org> 2 46 -
trunk/WebKit/chromium/WebKit.gyp
r56637 r56713 129 129 'public/WebImage.h', 130 130 'public/WebImageDecoder.h', 131 'public/WebIDBCallbacks.h', 132 'public/WebIDBDatabase.h', 133 'public/WebIDBDatabaseError.h', 131 134 'public/WebIndexedDatabase.h', 132 135 'public/WebInputElement.h', … … 248 251 'src/gtk/WebFontInfo.h', 249 252 'src/gtk/WebInputEventFactory.cpp', 253 'src/IDBCallbacksProxy.h', 254 'src/IDBDatabaseProxy.cpp', 255 'src/IDBDatabaseProxy.h', 250 256 'src/IndexedDatabaseProxy.cpp', 251 257 'src/IndexedDatabaseProxy.h', … … 324 330 'src/WebHistoryItem.cpp', 325 331 'src/WebHTTPBody.cpp', 332 'src/WebIDBDatabaseError.cpp', 326 333 'src/WebImageCG.cpp', 327 334 'src/WebImageDecoder.cpp', -
trunk/WebKit/chromium/public/WebIDBCallbacks.h
r56712 r56713 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 #ifndef WebIndexedDatabase_h 29 #define WebIndexedDatabase_h 28 29 #ifndef WebIDBCallbacks_h 30 #define WebIDBCallbacks_h 30 31 31 32 #include "WebCommon.h" … … 33 34 namespace WebKit { 34 35 35 class Web String;36 class WebIDBDatabaseError; 36 37 37 // The entry point into the IndexedDatabase API. These classes match their _____Request and 38 // _____Sync counterparts in the spec, but operate only in an async manner. 39 // http://dev.w3.org/2006/webapi/WebSimpleDB/ 40 class WebIndexedDatabase { 38 // Every IndexedDB method takes in a pair of callbacks for error/success which 39 // implement this class. Either 0 or 1 of these methods will be called and the 40 // callback class may be deleted any time after the callback is called. 41 template <typename ResultType> 42 class WebIDBCallbacks { 41 43 public: 42 // FIXME: Implement entry back into WebKit for this API.44 virtual ~WebIDBCallbacks() { } 43 45 44 virtual ~WebIndexedDatabase() { } 46 // If the method was a success, this method is called with the result. The 47 // result is a pointer that the callback takes ownership of. 48 virtual void onSuccess(ResultType*) = 0; 45 49 46 // FIXME: This should return an AsyncReturn<> object.47 virtual void o pen(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode) = 0;50 // Called in the event of an error. 51 virtual void onError(const WebIDBDatabaseError&) = 0; 48 52 }; 49 53 50 54 } // namespace WebKit 51 55 52 #endif // Web StorageNamespace_h56 #endif // WebIDBCallbacks_h -
trunk/WebKit/chromium/public/WebIDBDatabase.h
r56712 r56713 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 #include "config.h"29 #include "IndexedDatabaseRequest.h"30 28 31 #if ENABLE(INDEXED_DATABASE) 29 #ifndef WebIDBDatabase_h 30 #define WebIDBDatabase_h 32 31 33 #include "ExceptionCode.h" 34 #include "IDBRequest.h" 32 #include "WebCommon.h" 35 33 36 namespace Web Core{34 namespace WebKit { 37 35 38 IndexedDatabaseRequest::IndexedDatabaseRequest() 39 { 40 } 36 // See comment in WebIndexedDatabase for a high level overview these classes. 37 class WebIDBDatabase { 38 public: 39 virtual ~WebIDBDatabase() { } 41 40 42 IndexedDatabaseRequest::~IndexedDatabaseRequest() 43 { 44 } 41 // FIXME: Implement. 42 }; 45 43 46 void IndexedDatabaseRequest::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& exception) 47 { 48 } 44 } // namespace WebKit 49 45 50 } // namespace WebCore 51 52 #endif // ENABLE(INDEXED_DATABASE) 53 46 #endif // WebIDBDatabase_h -
trunk/WebKit/chromium/public/WebIDBDatabaseError.h
r56712 r56713 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 #ifndef WebIndexedDatabase_h 29 #define WebIndexedDatabase_h 28 29 #ifndef WebIDBDatabaseError_h 30 #define WebIDBDatabaseError_h 30 31 31 32 #include "WebCommon.h" 33 #include "WebPrivatePtr.h" 34 #include "WebString.h" 35 36 namespace WebCore { class IDBDatabaseError; } 32 37 33 38 namespace WebKit { 34 39 35 class WebString; 40 // See comment in WebIndexedDatabase for a high level overview these classes. 41 class WebIDBDatabaseError { 42 public: 43 ~WebIDBDatabaseError(); 36 44 37 // The entry point into the IndexedDatabase API. These classes match their _____Request and 38 // _____Sync counterparts in the spec, but operate only in an async manner. 39 // http://dev.w3.org/2006/webapi/WebSimpleDB/ 40 class WebIndexedDatabase { 41 public: 42 // FIXME: Implement entry back into WebKit for this API. 45 WebIDBDatabaseError(unsigned short code, const WebString& message) { assign(code, message); } 46 WebIDBDatabaseError(const WebIDBDatabaseError& e) { assign(e); } 47 WebIDBDatabaseError& operator=(const WebIDBDatabaseError& e) 48 { 49 assign(e); 50 return *this; 51 } 43 52 44 virtual ~WebIndexedDatabase() { }53 WEBKIT_API void assign(const WebIDBDatabaseError&); 45 54 46 // FIXME: This should return an AsyncReturn<> object. 47 virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode) = 0; 55 WEBKIT_API unsigned short code() const; 56 WEBKIT_API WebString message() const; 57 58 #if WEBKIT_IMPLEMENTATION 59 WebIDBDatabaseError(const WTF::PassRefPtr<WebCore::IDBDatabaseError>&); 60 WebIDBDatabaseError& operator=(const WTF::PassRefPtr<WebCore::IDBDatabaseError>&); 61 operator WTF::PassRefPtr<WebCore::IDBDatabaseError>() const; 62 #endif 63 64 private: 65 WEBKIT_API void assign(unsigned short code, const WebString& message); 66 67 WebPrivatePtr<WebCore::IDBDatabaseError> m_private; 48 68 }; 49 69 50 70 } // namespace WebKit 51 71 52 #endif // Web StorageNamespace_h72 #endif // WebIDBDatabaseError_h -
trunk/WebKit/chromium/public/WebIndexedDatabase.h
r55784 r56713 30 30 31 31 #include "WebCommon.h" 32 #include "WebIDBCallbacks.h" 32 33 33 34 namespace WebKit { 34 35 36 class WebIDBDatabase; 35 37 class WebString; 36 38 … … 44 46 virtual ~WebIndexedDatabase() { } 45 47 46 // FIXME: This should return an AsyncReturn<> object. 47 virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode) = 0; 48 virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode, WebIDBCallbacks<WebIDBDatabase>* callbacks) = 0; 48 49 }; 49 50 50 51 } // namespace WebKit 51 52 52 #endif // Web StorageNamespace_h53 #endif // WebIndexedDatabase_h -
trunk/WebKit/chromium/public/WebKitClient.h
r56381 r56713 155 155 // Indexed Database ---------------------------------------------------- 156 156 157 virtual WebIndexedDatabase* getIndexedDatabase() { return 0; }157 virtual WebIndexedDatabase* indexedDatabase() { return 0; } 158 158 159 159 -
trunk/WebKit/chromium/src/IDBCallbacksProxy.h
r56712 r56713 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 #ifndef IDBDatabaseError_h29 #define IDBDatabaseError_h30 28 31 #include "PlatformString.h" 29 #ifndef IDBCallbacksProxy_h 30 #define IDBCallbacksProxy_h 31 32 #include "IDBCallbacks.h" 33 #include "IDBDatabaseError.h" 34 #include "WebIDBCallbacks.h" 35 #include "WebIDBDatabaseError.h" 32 36 #include <wtf/PassRefPtr.h> 33 #include <wtf/Ref Counted.h>37 #include <wtf/RefPtr.h> 34 38 35 39 #if ENABLE(INDEXED_DATABASE) … … 37 41 namespace WebCore { 38 42 39 class IDBDatabaseError : public RefCounted<IDBDatabaseError> { 43 template <typename WebKitClass, typename WebCoreClass, typename WebCoreProxy> 44 class IDBCallbacksProxy : public WebKit::WebIDBCallbacks<WebKitClass> { 40 45 public: 41 static PassRefPtr<IDBDatabaseError> create() 46 IDBCallbacksProxy(PassRefPtr<IDBCallbacks<WebCoreClass> > callbacks) 47 : m_callbacks(callbacks) { } 48 49 virtual ~IDBCallbacksProxy() { } 50 51 virtual void onSuccess(WebKitClass* webKitInstance) 42 52 { 43 return adoptRef(new IDBDatabaseError()); 53 RefPtr<WebCoreClass> proxy = WebCoreProxy::create(webKitInstance); 54 m_callbacks->onSuccess(proxy); 55 m_callbacks.clear(); 44 56 } 45 ~IDBDatabaseError() { }46 57 47 unsigned short code() const { return m_code; } 48 void setCode(unsigned short value) { m_code = value; } 49 String message() const { return m_message; } 50 void setMessage(const String& value) { m_message = value; } 58 virtual void onError(const WebKit::WebIDBDatabaseError& error) 59 { 60 m_callbacks->onError(error); 61 m_callbacks.clear(); 62 } 51 63 52 64 private: 53 IDBDatabaseError() { } 65 PassRefPtr<IDBCallbacks<WebCoreClass> > m_callbacks; 66 }; 54 67 55 unsigned short m_code;56 String m_message;57 };58 68 59 69 } // namespace WebCore … … 61 71 #endif 62 72 63 #endif // IDBDatabaseError_h 64 73 #endif // IDBCallbacksProxy_h -
trunk/WebKit/chromium/src/IDBDatabaseProxy.cpp
r56712 r56713 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 #include "config.h" 29 #include "IndexedDatabaseRequest.h" 30 #include "IDBDatabaseProxy.h" 31 32 #include "IDBDatabaseError.h" 33 #include "WebIDBDatabase.h" 34 #include "WebIDBDatabaseError.h" 30 35 31 36 #if ENABLE(INDEXED_DATABASE) 32 37 33 #include "ExceptionCode.h"34 #include "IDBRequest.h"35 36 38 namespace WebCore { 37 39 38 IndexedDatabaseRequest::IndexedDatabaseRequest() 40 PassRefPtr<IDBDatabase> IDBDatabaseProxy::create(PassOwnPtr<WebKit::WebIDBDatabase> database) 41 { 42 return adoptRef(new IDBDatabaseProxy(database)); 43 } 44 45 IDBDatabaseProxy::IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase> database) 46 : m_webIDBDatabase(database) 39 47 { 40 48 } 41 49 42 IndexedDatabaseRequest::~IndexedDatabaseRequest() 43 { 44 } 45 46 void IndexedDatabaseRequest::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& exception) 50 IDBDatabaseProxy::~IDBDatabaseProxy() 47 51 { 48 52 } -
trunk/WebKit/chromium/src/IDBDatabaseProxy.h
r56712 r56713 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 #ifndef IndexedDatabaseProxy_h29 #define IndexedDatabaseProxy_h30 28 31 #include "IndexedDatabase.h" 29 #ifndef IDBDatabaseProxy_h 30 #define IDBDatabaseProxy_h 31 32 #include "IDBDatabase.h" 33 #include <wtf/OwnPtr.h> 34 #include <wtf/PassOwnPtr.h> 35 #include <wtf/PassRefPtr.h> 32 36 33 37 #if ENABLE(INDEXED_DATABASE) 34 38 35 namespace WebKit { class WebI ndexedDatabase; }39 namespace WebKit { class WebIDBDatabase; } 36 40 37 41 namespace WebCore { 38 42 39 class I ndexedDatabaseProxy : public IndexedDatabase {43 class IDBDatabaseProxy : public IDBDatabase { 40 44 public: 41 static PassRefPtr<I ndexedDatabase> create();42 virtual ~I ndexedDatabaseProxy();45 static PassRefPtr<IDBDatabase> create(PassOwnPtr<WebKit::WebIDBDatabase>); 46 virtual ~IDBDatabaseProxy(); 43 47 44 virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&);48 // FIXME: Add other methods. 45 49 46 50 private: 47 I ndexedDatabaseProxy();51 IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase>); 48 52 49 // We don't own this pointer. 50 WebKit::WebIndexedDatabase* m_webIndexedDatabase; 53 OwnPtr<WebKit::WebIDBDatabase> m_webIDBDatabase; 51 54 }; 52 55 … … 55 58 #endif 56 59 57 #endif // I ndexedDatabaseProxy_h60 #endif // IDBDatabaseProxy_h 58 61 -
trunk/WebKit/chromium/src/IndexedDatabaseProxy.cpp
r55784 r56713 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 #include "config.h" 29 30 #include "IndexedDatabaseProxy.h" 30 31 32 #include "IDBCallbacksProxy.h" 33 #include "IDBDatabaseError.h" 34 #include "IDBDatabaseProxy.h" 35 #include "WebIDBDatabase.h" 36 #include "WebIDBDatabaseError.h" 31 37 #include "WebIndexedDatabase.h" 32 38 #include "WebKit.h" … … 43 49 44 50 IndexedDatabaseProxy::IndexedDatabaseProxy() 45 : m_webIndexedDatabase(WebKit::webKitClient()-> getIndexedDatabase())51 : m_webIndexedDatabase(WebKit::webKitClient()->indexedDatabase()) 46 52 { 47 53 } … … 51 57 } 52 58 53 void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& ec )59 void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& ec, PassRefPtr<IDBDatabaseCallbacks> callbacks) 54 60 { 55 m_webIndexedDatabase->open(name, description, modifyDatabase, ec); 61 m_webIndexedDatabase->open(name, description, modifyDatabase, ec, 62 new IDBCallbacksProxy<WebKit::WebIDBDatabase, IDBDatabase, IDBDatabaseProxy>(callbacks)); 56 63 } 57 64 -
trunk/WebKit/chromium/src/IndexedDatabaseProxy.h
r55784 r56713 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 #ifndef IndexedDatabaseProxy_h 29 30 #define IndexedDatabaseProxy_h … … 42 43 virtual ~IndexedDatabaseProxy(); 43 44 44 virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& );45 virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks>); 45 46 46 47 private: 47 48 IndexedDatabaseProxy(); 48 49 49 // We don't own this pointer .50 // We don't own this pointer (unlike all the other proxy classes which do). 50 51 WebKit::WebIndexedDatabase* m_webIndexedDatabase; 51 52 };
Note: See TracChangeset
for help on using the changeset viewer.