Bug 142634

Summary: Sink the Vector<uint8_t> buffer into the SerializedScriptValue constructor
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, commit-queue, jsbell
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch for landing none

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.