Bug 164742

Summary: Update SubtleCrypto::digest to match the latest spec
Product: WebKit Reporter: Jiewen Tan <jiewen_tan>
Component: WebCore Misc.Assignee: Jiewen Tan <jiewen_tan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, cdumez, commit-queue, esprehn+autocc, jiewen_tan, kondapallykalyan, rob, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 160883    
Attachments:
Description Flags
Patch
darin: review+
Patch for landing commit-queue: commit-queue-

Description Jiewen Tan 2016-11-14 15:55:18 PST
Update SubtleCrypto::digest to match the latest spec.
Comment 1 Radar WebKit Bug Importer 2016-11-14 16:48:10 PST
<rdar://problem/29258037>
Comment 2 Jiewen Tan 2016-11-27 13:26:55 PST
Created attachment 295461 [details]
Patch
Comment 3 Darin Adler 2016-11-28 09:29:30 PST
Comment on attachment 295461 [details]
Patch

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

> Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp:537
> +    JSSubtleCrypto* subtle = jsDynamicDowncast<JSSubtleCrypto*>(state.thisValue());
> +    ASSERT(subtle);

Why can we assert this? Can’t this function be called with an object that is a not a JSSubtleCrypto?
Comment 4 Jiewen Tan 2016-11-28 12:10:16 PST
Comment on attachment 295461 [details]
Patch

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

Thanks Darin for r+ my patch.

>> Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp:537
>> +    ASSERT(subtle);
> 
> Why can we assert this? Can’t this function be called with an object that is a not a JSSubtleCrypto?

I don't think so. This function is sealed inside the JSSubtleCryptoCustom.cpp file, and only JSSubtleCrypto::digest will call it. If no mistakes being made afterwards, this function should not be called with an object that is not a JSSubtleCrypto.
Comment 5 Jiewen Tan 2016-11-30 13:48:14 PST
Created attachment 295759 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2016-11-30 14:26:35 PST
Comment on attachment 295759 [details]
Patch for landing

Rejecting attachment 295759 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 295759, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
    -> origin/master
Partial-rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc ...
Currently at 209152 = ee9c679382b170b20f375d470b55276f20aa526d
r209153 = 81c34d6f608f348ee25f095d35723aa7402ed50d
r209154 = 0bc77effebf4a1d87caf78b287e1348281916fc8
Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/origin/master.

Full output: http://webkit-queues.webkit.org/results/2597344
Comment 7 Jiewen Tan 2016-11-30 16:28:35 PST
Committed r209164: <http://trac.webkit.org/changeset/209164>