Changeset 65893 in webkit
- Timestamp:
- Aug 24, 2010 6:25:39 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65891 r65893 1 2010-08-24 Marcus Bulach <bulach@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 Hooks IDBKeyPath with IDBObjectStorage::put. 6 https://bugs.webkit.org/show_bug.cgi?id=44275 7 8 Adds a mechanism to extract an IDBKey from SerializedScriptValue using IDBKeyPath 9 during IDBObjectStorage::put. 10 11 * WebCore.gyp/WebCore.gyp: 12 * WebCore.gypi: 13 * platform/chromium/ChromiumBridge.h: 14 * storage/IDBKeyPathBackendImpl.cpp: Added. 15 (IDBKeyPathBackendImpl::createIDBKeysFromSerializedValuesAndKeyPath): 16 * storage/IDBKeyPathBackendImpl.h: Added. 17 * storage/IDBObjectStoreBackendImpl.cpp: 18 (WebCore::IDBObjectStoreBackendImpl::put): 19 * storage/chromium/IDBKeyPathBackendImpl.cpp: Added. 20 (WebCore::IDBKeyPathBackendImpl::createIDBKeysFromSerializedValuesAndKeyPath): 21 1 22 2010-08-24 Ilya Tikhonovsky <loislo@chromium.org> 2 23 -
trunk/WebCore/WebCore.gyp/WebCore.gyp
r65891 r65893 886 886 '../storage/IDBFactoryBackendInterface.cpp', 887 887 888 # Don't build IDBKeyPathBackendImpl. We have our own implementation. 889 '../storage/IDBKeyPathBackendImpl.cpp', 890 888 891 # Use history/BackForwardListChromium.cpp instead. 889 892 '../history/BackForwardListImpl.cpp', -
trunk/WebCore/WebCore.gypi
r65821 r65893 3535 3535 'storage/chromium/DatabaseObserver.h', 3536 3536 'storage/chromium/IDBFactoryBackendInterface.cpp', 3537 'storage/chromium/IDBKeyPathBackendImpl.cpp', 3537 3538 'storage/chromium/DatabaseTrackerChromium.cpp', 3538 3539 'storage/chromium/QuotaTracker.cpp', … … 3596 3597 'storage/IDBFactory.cpp', 3597 3598 'storage/IDBFactory.h', 3599 'storage/IDBKeyPathBackendImpl.cpp', 3600 'storage/IDBKeyPathBackendImpl.h', 3598 3601 'storage/IDBFactoryBackendInterface.cpp', 3599 3602 'storage/IDBFactoryBackendInterface.h', -
trunk/WebCore/platform/chromium/ChromiumBridge.h
r65021 r65893 73 73 class Image; 74 74 class IDBFactoryBackendInterface; 75 class IDBKey; 75 76 class IntRect; 76 77 class KURL; 78 class SerializedScriptValue; 77 79 class Widget; 78 80 … … 168 170 // IndexedDB ---------------------------------------------------------- 169 171 static PassRefPtr<IDBFactoryBackendInterface> idbFactory(); 172 // Extracts keyPath from values and returns the corresponding keys. 173 static void createIDBKeysFromSerializedValuesAndKeyPath(const Vector<RefPtr<SerializedScriptValue> >& values, const String& keyPath, Vector<RefPtr<IDBKey> >& keys); 170 174 171 175 // JavaScript --------------------------------------------------------- -
trunk/WebCore/storage/IDBObjectStoreBackendImpl.cpp
r65673 r65893 34 34 #include "IDBDatabaseException.h" 35 35 #include "IDBIndexBackendImpl.h" 36 #include "IDBKeyPath.h" 37 #include "IDBKeyPathBackendImpl.h" 36 38 #include "IDBKeyRange.h" 37 39 #include "SQLiteDatabase.h" … … 125 127 } 126 128 127 void IDBObjectStoreBackendImpl::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> prpKey, bool addOnly, PassRefPtr<IDBCallbacks> callbacks) 128 { 129 void IDBObjectStoreBackendImpl::put(PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, bool addOnly, PassRefPtr<IDBCallbacks> callbacks) 130 { 131 RefPtr<SerializedScriptValue> value = prpValue; 129 132 RefPtr<IDBKey> key = prpKey; 130 133 131 134 if (!m_keyPath.isNull()) { 132 135 if (key) { 133 callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "A key was supplied for an objectStore that has a keyPath.")); 136 callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "A key was supplied for an objectStore that has a keyPath.")); 134 137 return; 135 138 } 136 ASSERT_NOT_REACHED(); 137 callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "FIXME: keyPath not yet supported.")); 138 return; 139 Vector<RefPtr<SerializedScriptValue> > values; 140 values.append(value); 141 Vector<RefPtr<IDBKey> > idbKeys; 142 IDBKeyPathBackendImpl::createIDBKeysFromSerializedValuesAndKeyPath(values, m_keyPath, idbKeys); 143 if (idbKeys.isEmpty()) { 144 callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "An invalid keyPath was supplied for an objectStore.")); 145 return; 146 } 147 key = idbKeys[0]; 139 148 } 140 149 -
trunk/WebKit/chromium/ChangeLog
r65881 r65893 1 2010-08-24 Marcus Bulach <bulach@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 Hooks IDBKeyPath with IDBObjectStorage::put. 6 https://bugs.webkit.org/show_bug.cgi?id=44275 7 8 Adds a mechanism to extract an IDBKey from SerializedScriptValue using IDBKeyPath 9 during IDBObjectStorage::put. 10 11 * public/WebIDBKey.h: 12 (WebKit::WebIDBKey::WebIDBKey): 13 * public/WebKitClient.h: 14 (WebKit::WebKitClient::createIDBKeysFromSerializedValuesAndKeyPath): 15 * src/ChromiumBridge.cpp: 16 (WebCore::ChromiumBridge::createIDBKeysFromSerializedValuesAndKeyPath): 17 1 18 2010-08-24 Kent Tamura <tkent@chromium.org> 2 19 -
trunk/WebKit/chromium/public/WebIDBKey.h
r65439 r65893 40 40 class WebIDBKey { 41 41 public: 42 // Please use one of the factory methods. This is public only to allow WebVector. 43 WebIDBKey() { } 42 44 ~WebIDBKey() { reset(); } 43 45 … … 81 83 82 84 private: 83 WebIDBKey() { }84 85 85 86 WebPrivatePtr<WebCore::IDBKey> m_private; -
trunk/WebKit/chromium/public/WebKitClient.h
r65718 r65893 36 36 #include "WebLocalizedString.h" 37 37 #include "WebString.h" 38 #include "WebVector.h" 38 39 #include "WebURL.h" 39 40 … … 56 57 class WebGraphicsContext3D; 57 58 class WebIDBFactory; 59 class WebIDBKey; 58 60 class WebMessagePortChannel; 59 61 class WebMimeRegistry; 60 62 class WebPluginListBuilder; 61 63 class WebSandboxSupport; 64 class WebSerializedScriptValue; 62 65 class WebSharedWorkerRepository; 63 66 class WebSocketStreamHandle; … … 140 143 141 144 virtual WebIDBFactory* idbFactory() { return 0; } 145 virtual void createIDBKeysFromSerializedValuesAndKeyPath(const WebVector<WebSerializedScriptValue>& values, const WebString& keyPath, WebVector<WebIDBKey>& keys) { } 142 146 143 147 -
trunk/WebKit/chromium/src/ChromiumBridge.cpp
r65482 r65893 45 45 #include "WebFrameClient.h" 46 46 #include "WebFrameImpl.h" 47 #include "WebIDBKey.h" 47 48 #include "WebImage.h" 48 49 #include "WebKit.h" … … 52 53 #include "WebPluginListBuilderImpl.h" 53 54 #include "WebSandboxSupport.h" 55 #include "WebSerializedScriptValue.h" 54 56 #include "WebScreenInfo.h" 55 57 #include "WebString.h" … … 501 503 } 502 504 505 void ChromiumBridge::createIDBKeysFromSerializedValuesAndKeyPath(const Vector<RefPtr<SerializedScriptValue> >& values, const String& keyPath, Vector<RefPtr<IDBKey> >& keys) 506 { 507 WebVector<WebSerializedScriptValue> webValues = values; 508 WebVector<WebIDBKey> webKeys; 509 webKitClient()->createIDBKeysFromSerializedValuesAndKeyPath(webValues, WebString(keyPath), webKeys); 510 511 size_t webKeysSize = webKeys.size(); 512 keys.reserveCapacity(webKeysSize); 513 for (size_t i = 0; i < webKeysSize; ++i) 514 keys.append(PassRefPtr<IDBKey>(webKeys[i])); 515 } 516 503 517 // Keygen --------------------------------------------------------------------- 504 518
Note: See TracChangeset
for help on using the changeset viewer.