Skip to content

Commit

Permalink
Cherry-pick 76dc1d4. rdar://125785355
Browse files Browse the repository at this point in the history
    Make WebCore::IDBSerializationContext testable
    https://bugs.webkit.org/show_bug.cgi?id=272032
    <rdar://125785355>

    Reviewed by Sihui Liu.

    Original patch by Jesse Hertz.

    * Source/WebCore/Modules/indexeddb/IDBValue.h:
    (WebCore::IDBValue::IDBValue):
    * Source/WebCore/bindings/js/IDBBindingUtilities.h:
    (WebCore::deserializeIDBValueToJSValue):
    (WebCore::callOnIDBSerializationThreadAndWait):
    - Export methods to make the code testable.

    Canonical link: https://commits.webkit.org/277032@main

Canonical link: https://commits.webkit.org/272448.900@safari-7618-branch
  • Loading branch information
David Kilzer authored and Dan Robson committed Apr 10, 2024
1 parent 48d5c62 commit 8678ac1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/WebCore/Modules/indexeddb/IDBValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class IDBValue {
public:
WEBCORE_EXPORT IDBValue();
IDBValue(const SerializedScriptValue&);
IDBValue(const ThreadSafeDataBuffer&);
WEBCORE_EXPORT IDBValue(const ThreadSafeDataBuffer&);
IDBValue(const SerializedScriptValue&, const Vector<String>& blobURLs, const Vector<String>& blobFilePaths);
WEBCORE_EXPORT IDBValue(const ThreadSafeDataBuffer&, Vector<String>&& blobURLs, Vector<String>&& blobFilePaths);
IDBValue(const ThreadSafeDataBuffer&, const Vector<String>& blobURLs, const Vector<String>& blobFilePaths);
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/bindings/js/IDBBindingUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ IndexIDToIndexKeyMap generateIndexKeyMapForValueIsolatedCopy(JSC::JSGlobalObject
Ref<IDBKey> scriptValueToIDBKey(JSC::JSGlobalObject&, JSC::JSValue);

JSC::JSValue deserializeIDBValueToJSValue(JSC::JSGlobalObject&, const IDBValue&, Vector<std::pair<String, String>>&);
JSC::JSValue deserializeIDBValueToJSValue(JSC::JSGlobalObject&, const IDBValue&);
WEBCORE_EXPORT JSC::JSValue deserializeIDBValueToJSValue(JSC::JSGlobalObject&, const IDBValue&);
JSC::JSValue toJS(JSC::JSGlobalObject*, JSDOMGlobalObject*, const IDBValue&);
JSC::JSValue toJS(JSC::JSGlobalObject&, JSC::JSGlobalObject&, IDBKey*);
JSC::JSValue toJS(JSC::JSGlobalObject*, JSDOMGlobalObject*, const IDBKeyData&);

std::optional<JSC::JSValue> deserializeIDBValueWithKeyInjection(JSC::JSGlobalObject&, const IDBValue&, const IDBKeyData&, const std::optional<IDBKeyPath>&);

void callOnIDBSerializationThreadAndWait(Function<void(JSC::JSGlobalObject&)>&&);
WEBCORE_EXPORT void callOnIDBSerializationThreadAndWait(Function<void(JSC::JSGlobalObject&)>&&);

}

0 comments on commit 8678ac1

Please sign in to comment.