Bug 158576 - atob() / btoa() API should be exposed to workers
Summary: atob() / btoa() API should be exposed to workers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar, WebExposed
: 55663 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-09 13:11 PDT by Chris Dumez
Modified: 2016-06-09 20:18 PDT (History)
9 users (show)

See Also:


Attachments
Patch (36.66 KB, patch)
2016-06-09 15:33 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-06-09 13:11:19 PDT
atob() / btoa() API should be exposed to workers:
https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
Comment 1 Chris Dumez 2016-06-09 13:18:37 PDT
Test:
http://w3c-test.org/workers/interfaces.worker
Comment 2 Radar WebKit Bug Importer 2016-06-09 15:27:43 PDT
<rdar://problem/26729340>
Comment 3 Chris Dumez 2016-06-09 15:33:05 PDT
Created attachment 280958 [details]
Patch
Comment 4 Chris Dumez 2016-06-09 15:44:09 PDT
*** Bug 55663 has been marked as a duplicate of this bug. ***
Comment 5 WebKit Commit Bot 2016-06-09 18:40:35 PDT
Comment on attachment 280958 [details]
Patch

Clearing flags on attachment: 280958

Committed r201898: <http://trac.webkit.org/changeset/201898>
Comment 6 WebKit Commit Bot 2016-06-09 18:40:40 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Darin Adler 2016-06-09 18:55:32 PDT
Comment on attachment 280958 [details]
Patch

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

> Source/WebCore/page/Base64Utilities.h:36
> +    Base64Utilities() = default;
> +

We should just delete these two lines of code. This is what a class gets if you don’t explicitly define a constructor. We should do this only if we want to make the default constructor private or protected.
Comment 8 Chris Dumez 2016-06-09 18:56:49 PDT
Comment on attachment 280958 [details]
Patch

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

>> Source/WebCore/page/Base64Utilities.h:36
>> +
> 
> We should just delete these two lines of code. This is what a class gets if you don’t explicitly define a constructor. We should do this only if we want to make the default constructor private or protected.

My bad. I'll drop them in a follow up.
Comment 9 Darin Adler 2016-06-09 19:11:46 PDT
Comment on attachment 280958 [details]
Patch

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

> Source/WebCore/page/Base64Utilities.h:38
> +    String btoa(const String& stringToEncode, ExceptionCode&);
> +    String atob(const String& encodedString, ExceptionCode&);

Another thing: These should both be static member functions. More efficient that way. Neither makes any use of "this", directly or indirectly.
Comment 10 Chris Dumez 2016-06-09 20:18:33 PDT
Committed r201903: <http://trac.webkit.org/changeset/201903>