Bug 142634 - Sink the Vector<uint8_t> buffer into the SerializedScriptValue constructor
Summary: Sink the Vector<uint8_t> buffer into the SerializedScriptValue constructor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-12 12:56 PDT by Zan Dobersek
Modified: 2016-01-18 12:27 PST (History)
3 users (show)

See Also:


Attachments
Patch (15.29 KB, patch)
2015-03-12 13:29 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (15.51 KB, patch)
2015-03-17 03:22 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (17.72 KB, patch)
2015-03-17 13:37 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (19.10 KB, patch)
2016-01-03 03:36 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch for landing (19.17 KB, patch)
2016-01-18 10:40 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2015-03-12 12:56:12 PDT
Sink the Vector<uint8_t> buffer into the SerializedScriptValue constructor
Comment 1 Zan Dobersek 2015-03-12 13:29:29 PDT
Created attachment 248537 [details]
Patch
Comment 2 Darin Adler 2015-03-12 18:18:06 PDT
Comment on attachment 248537 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=248537&action=review

> Source/WebCore/bindings/js/IDBBindingUtilities.cpp:322
> +Deprecated::ScriptValue deserializeIDBValueBuffer(JSC::ExecState* exec, Vector<uint8_t>&& buffer, bool keyIsDefined)

Need to update the declaration in the IDBBindingUtilities.h header file too. Or delete that declaration entirely and mark this static so it has internal linkage.
Comment 3 Zan Dobersek 2015-03-17 03:22:23 PDT
Created attachment 248840 [details]
Patch
Comment 4 Zan Dobersek 2015-03-17 13:37:40 PDT
Created attachment 248865 [details]
Patch
Comment 5 Zan Dobersek 2016-01-03 03:36:23 PST
Created attachment 268135 [details]
Patch
Comment 6 Michael Catanzaro 2016-01-03 18:03:08 PST
Comment on attachment 268135 [details]
Patch

Looks like a nice cleanup. This needs approved by an owner, though.
Comment 7 Darin Adler 2016-01-15 16:47:04 PST
Comment on attachment 268135 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=268135&action=review

> Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp:182
> +    RefPtr<WebCore::SerializedScriptValue> value = WebCore::SerializedScriptValue::adopt(dataReference.vector());
>  
>      handler->client().didPostMessage(*page, *frame, securityOrigin, *value);

I think this reads better without a local variable:

    handler->client().didPostMessage(*page, *frame, securityOrigin, *WebCore::SerializedScriptValue::adopt(dataReference.vector()));

> Source/WebKit2/UIProcess/WebPageProxy.cpp:4701
> +    RefPtr<API::SerializedScriptValue> returnValue = API::SerializedScriptValue::adopt(WTFMove(data));
> +    callback->performCallbackWithReturnValue(returnValue.get(), hadException, details);

i think this still reads better without a local variable:

    callback->performCallbackWithReturnValue(API::SerializedScriptValue::adopt(WTFMove(data)).get(), hadException, details);
Comment 8 Zan Dobersek 2016-01-18 10:40:15 PST
Created attachment 269231 [details]
Patch for landing

Addressed the recommendations in comment #7.
Comment 9 WebKit Commit Bot 2016-01-18 12:26:56 PST
Comment on attachment 269231 [details]
Patch for landing

Clearing flags on attachment: 269231

Committed r195235: <http://trac.webkit.org/changeset/195235>
Comment 10 WebKit Commit Bot 2016-01-18 12:27:00 PST
All reviewed patches have been landed.  Closing bug.