Changeset 157430 in webkit


Ignore:
Timestamp:
Oct 14, 2013 4:36:32 PM (11 years ago)
Author:
ap@apple.com
Message:

Add an empty window.crypto.webkitSubtle
https://bugs.webkit.org/show_bug.cgi?id=122778

Reviewed by Mark Hahnenberg.

Source/WebCore:

Tests: security/crypto-subtle-gc-2.html

security/crypto-subtle-gc-3.html
security/crypto-subtle-gc.html

  • DerivedSources.make: Process SubtleCrypto.idl.
  • crypto: Added.
  • WebCore.xcodeproj/project.pbxproj:
  • CMakeLists.txt:
  • DerivedSources.make:
  • GNUmakefile.am:
  • GNUmakefile.list.am:
  • WebCore.vcxproj/WebCore.vcxproj.filters:
  • bindings/js/JSSubtleCryptoCustom.cpp: Added. Empty for now, but we'll certainly

need custom bindings code here.

  • crypto/SubtleCrypto.cpp: Added.

(WebCore::SubtleCrypto::SubtleCrypto):
(WebCore::SubtleCrypto::document):

  • crypto/SubtleCrypto.h: Added.
  • crypto/SubtleCrypto.idl: Added.
  • page/Crypto.cpp:

(WebCore::Crypto::subtle):

  • page/Crypto.h:
  • page/Crypto.idl:

LayoutTests:

  • TestExpectations: The feature isn't enabled anywhere yet, so skipping the new tests.
  • security/crypto-subtle-gc-2-expected.txt: Added.
  • security/crypto-subtle-gc-2.html: Added.
  • security/crypto-subtle-gc-3-expected.txt: Added.
  • security/crypto-subtle-gc-3.html: Added.
  • security/crypto-subtle-gc-expected.txt: Added.
  • security/crypto-subtle-gc.html: Added.
Location:
trunk
Files:
11 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r157425 r157430  
     12013-10-14  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Add an empty window.crypto.webkitSubtle
     4        https://bugs.webkit.org/show_bug.cgi?id=122778
     5
     6        Reviewed by Mark Hahnenberg.
     7
     8        * TestExpectations: The feature isn't enabled anywhere yet, so skipping the new tests.
     9
     10        * security/crypto-subtle-gc-2-expected.txt: Added.
     11        * security/crypto-subtle-gc-2.html: Added.
     12        * security/crypto-subtle-gc-3-expected.txt: Added.
     13        * security/crypto-subtle-gc-3.html: Added.
     14        * security/crypto-subtle-gc-expected.txt: Added.
     15        * security/crypto-subtle-gc.html: Added.
     16
    1172013-10-14  Alexandru Chiculita  <achicu@adobe.com>
    218
  • trunk/LayoutTests/TestExpectations

    r157299 r157430  
    6666fast/mediastream/MediaStream-onended.html [ Skip ]
    6767
     68# crypto.subtle is not yet enabled on any ports
     69webkit.org/b/122679 security/crypto-subtle-gc.html [ Skip ]
     70webkit.org/b/122679 security/crypto-subtle-gc-2.html [ Skip ]
     71webkit.org/b/122679 security/crypto-subtle-gc-3.html [ Skip ]
  • trunk/Source/WebCore/CMakeLists.txt

    r157418 r157430  
    2323    "${WEBCORE_DIR}/bridge"
    2424    "${WEBCORE_DIR}/bridge/c"
     25    "${WEBCORE_DIR}/crypto"
    2526    "${WEBCORE_DIR}/css"
    2627    "${WEBCORE_DIR}/dom"
     
    282283    Modules/websockets/CloseEvent.idl
    283284    Modules/websockets/WebSocket.idl
     285
     286    crypto/SubtleCrypto.idl
    284287
    285288    css/CSSCharsetRule.idl
  • trunk/Source/WebCore/ChangeLog

    r157428 r157430  
     12013-10-14  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Add an empty window.crypto.webkitSubtle
     4        https://bugs.webkit.org/show_bug.cgi?id=122778
     5
     6        Reviewed by Mark Hahnenberg.
     7
     8        Tests: security/crypto-subtle-gc-2.html
     9               security/crypto-subtle-gc-3.html
     10               security/crypto-subtle-gc.html
     11
     12        * DerivedSources.make: Process SubtleCrypto.idl.
     13
     14        * crypto: Added.
     15        * WebCore.xcodeproj/project.pbxproj:
     16        * CMakeLists.txt:
     17        * DerivedSources.make:
     18        * GNUmakefile.am:
     19        * GNUmakefile.list.am:
     20        * WebCore.vcxproj/WebCore.vcxproj.filters:
     21
     22        * bindings/js/JSSubtleCryptoCustom.cpp: Added. Empty for now, but we'll certainly
     23        need custom bindings code here.
     24
     25        * crypto/SubtleCrypto.cpp: Added.
     26        (WebCore::SubtleCrypto::SubtleCrypto):
     27        (WebCore::SubtleCrypto::document):
     28        * crypto/SubtleCrypto.h: Added.       
     29        * crypto/SubtleCrypto.idl: Added.
     30        * page/Crypto.cpp:
     31        (WebCore::Crypto::subtle):
     32        * page/Crypto.h:
     33        * page/Crypto.idl:
     34
    1352013-10-14  Nick Diego Yamane  <nick.yamane@openbossa.org>
    236
  • trunk/Source/WebCore/DerivedSources.make

    r157363 r157430  
    4545    $(WebCore)/bindings/js \
    4646    $(WebCore)/bindings/objc \
     47    $(WebCore)/crypto \
    4748    $(WebCore)/css \
    4849    $(WebCore)/dom \
     
    198199    $(WebCore)/Modules/websockets/CloseEvent.idl \
    199200    $(WebCore)/Modules/websockets/WebSocket.idl \
     201    $(WebCore)/crypto/SubtleCrypto.idl \
    200202    $(WebCore)/css/CSSCharsetRule.idl \
    201203    $(WebCore)/css/CSSFontFaceLoadEvent.idl \
  • trunk/Source/WebCore/GNUmakefile.am

    r156768 r157430  
    3232        -I$(srcdir)/Source/WebCore/bridge/c \
    3333        -I$(srcdir)/Source/WebCore/bridge/jsc \
     34        -I$(srcdir)/Source/WebCore/crypto \
    3435        -I$(srcdir)/Source/WebCore/css \
    3536        -I$(srcdir)/Source/WebCore/dom \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r157393 r157430  
    12961296        $(WebCore)/Modules/websockets/CloseEvent.idl \
    12971297        $(WebCore)/Modules/websockets/WebSocket.idl \
     1298        $(WebCore)/crypto/SubtleCrypto.idl \
    12981299        $(WebCore)/css/CSSCharsetRule.idl \
    12991300        $(WebCore)/css/CSSFontFaceLoadEvent.idl \
     
    24772478        Source/WebCore/bridge/runtime_root.h \
    24782479        Source/WebCore/config.h \
     2480        Source/WebCore/crypto/SubtleCrypto.h \
    24792481        Source/WebCore/css/BasicShapeFunctions.cpp \
    24802482        Source/WebCore/css/BasicShapeFunctions.h \
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r157419 r157430  
    173173      <UniqueIdentifier>{35a67667-1c77-4199-bdd3-a0627946846a}</UniqueIdentifier>
    174174    </Filter>
     175    <Filter Include="crypto">
     176      <UniqueIdentifier>{02334427-19d6-44c8-a5d1-e1a67a9c4997}</UniqueIdentifier>
     177    </Filter>
    175178    <Filter Include="css">
    176179      <UniqueIdentifier>{353b76ca-c49a-41da-88da-33dc422325ef}</UniqueIdentifier>
     
    88068809      <Filter>platform\mock</Filter>
    88078810    </ClInclude>
     8811    <ClInclude Include="..\crypto\SubtleCrypto.h">
     8812      <Filter>crypto</Filter>
     8813    </ClInclude>
    88088814    <ClInclude Include="..\css\BasicShapeFunctions.h">
    88098815      <Filter>css</Filter>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r157419 r157430  
    55945594                E1FF57A30F01255B00891EBB /* ThreadGlobalData.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */; settings = {ATTRIBUTES = (Private, ); }; };
    55955595                E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */; };
     5596                E1FF8F5F1807442100132674 /* SubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F5D1807442100132674 /* SubtleCrypto.cpp */; };
     5597                E1FF8F601807442100132674 /* SubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F5E1807442100132674 /* SubtleCrypto.h */; };
     5598                E1FF8F64180745D800132674 /* JSSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F62180745D800132674 /* JSSubtleCrypto.cpp */; };
     5599                E1FF8F65180745D800132674 /* JSSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F63180745D800132674 /* JSSubtleCrypto.h */; };
     5600                E1FF8F681807460800132674 /* JSSubtleCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F661807460800132674 /* JSSubtleCryptoCustom.cpp */; };
    55965601                E401C27517CE53EC00C41A35 /* ElementIteratorAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */; };
    55975602                E4295FA412B0614E00D1ACE0 /* ResourceLoadPriority.h in Headers */ = {isa = PBXBuildFile; fileRef = E4295FA312B0614E00D1ACE0 /* ResourceLoadPriority.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1255812563                E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadGlobalData.h; sourceTree = "<group>"; };
    1255912564                E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadGlobalData.cpp; sourceTree = "<group>"; };
     12565                E1FF8F5C1807364B00132674 /* SubtleCrypto.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SubtleCrypto.idl; sourceTree = "<group>"; };
     12566                E1FF8F5D1807442100132674 /* SubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtleCrypto.cpp; sourceTree = "<group>"; };
     12567                E1FF8F5E1807442100132674 /* SubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtleCrypto.h; sourceTree = "<group>"; };
     12568                E1FF8F62180745D800132674 /* JSSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCrypto.cpp; sourceTree = "<group>"; };
     12569                E1FF8F63180745D800132674 /* JSSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSubtleCrypto.h; sourceTree = "<group>"; };
     12570                E1FF8F661807460800132674 /* JSSubtleCryptoCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCryptoCustom.cpp; sourceTree = "<group>"; };
    1256012571                E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementIteratorAssertions.h; sourceTree = "<group>"; };
    1256112572                E406F3FB1198307D009D59D6 /* ColorData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorData.cpp; sourceTree = "<group>"; };
     
    1356013571                                BC1A3790097C6F970019F3D8 /* bindings */,
    1356113572                                1A569CC40D7E2B60007C3983 /* bridge */,
     13573                                E1FF8F5B1807362B00132674 /* crypto */,
    1356213574                                F523D18402DE42E8018635CA /* css */,
    1356313575                                F523D32402DE4478018635CA /* dom */,
     
    1377913791                        children = (
    1378013792                                A83B79100CCB001B000B0825 /* Core */,
     13793                                E1FF8F61180745C600132674 /* Crypto */,
    1378113794                                A83B790E0CCAFF97000B0825 /* CSS */,
    1378213795                                CDA98DCD1601515C00FEA3B1 /* EncryptedMedia */,
     
    1937119384                                08E4FE450E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp */,
    1937219385                                B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */,
     19386                                E1FF8F661807460800132674 /* JSSubtleCryptoCustom.cpp */,
    1937319387                                1A2C40AA0DEB55AA005AF19E /* JSTextCustom.cpp */,
    1937419388                                07E117061489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp */,
     
    2010120115                        tabWidth = 4;
    2010220116                        usesTabs = 0;
     20117                };
     20118                E1FF8F5B1807362B00132674 /* crypto */ = {
     20119                        isa = PBXGroup;
     20120                        children = (
     20121                                E1FF8F5C1807364B00132674 /* SubtleCrypto.idl */,
     20122                                E1FF8F5D1807442100132674 /* SubtleCrypto.cpp */,
     20123                                E1FF8F5E1807442100132674 /* SubtleCrypto.h */,
     20124                        );
     20125                        path = crypto;
     20126                        sourceTree = "<group>";
     20127                };
     20128                E1FF8F61180745C600132674 /* Crypto */ = {
     20129                        isa = PBXGroup;
     20130                        children = (
     20131                                E1FF8F62180745D800132674 /* JSSubtleCrypto.cpp */,
     20132                                E1FF8F63180745D800132674 /* JSSubtleCrypto.h */,
     20133                        );
     20134                        name = Crypto;
     20135                        sourceTree = "<group>";
    2010320136                };
    2010420137                E46E97860DAAD61B0071E894 /* animation */ = {
     
    2150021533                                7C5343FD17B74B63004232F0 /* JSMediaQueryListListener.h in Headers */,
    2150121534                                37C61F0112095C87007A3C67 /* AtomicStringKeyedMRUCache.h in Headers */,
     21535                                E1FF8F601807442100132674 /* SubtleCrypto.h in Headers */,
    2150221536                                A8C4A80D09D563270003AC8D /* Attr.h in Headers */,
    2150321537                                A8C4A80B09D563270003AC8D /* Attribute.h in Headers */,
     
    2247022504                                A12A1050166444FD008FA311 /* GridTrackSize.h in Headers */,
    2247122505                                C50B561712119D23008B46E0 /* GroupSettings.h in Headers */,
     22506                                E1FF8F65180745D800132674 /* JSSubtleCrypto.h in Headers */,
    2247222507                                078E094017D16E1C00420AA1 /* RTCIceCandidateDescriptor.h in Headers */,
    2247322508                                8482B7461198C35400BFB005 /* HashChangeEvent.h in Headers */,
     
    2507725112                                FB91392716AE4C34001FE682 /* CanvasPathMethods.cpp in Sources */,
    2507825113                                49484FC4102CF23C00187DD3 /* CanvasPattern.cpp in Sources */,
     25114                                E1FF8F681807460800132674 /* JSSubtleCryptoCustom.cpp in Sources */,
    2507925115                                49C7B9DC1042D32F0009D447 /* CanvasRenderingContext.cpp in Sources */,
    2508025116                                49484FCA102CF23C00187DD3 /* CanvasRenderingContext2D.cpp in Sources */,
     
    2589925935                                7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */,
    2590025936                                4F6FDD641341DEDD001F8EE3 /* InspectorPageAgent.cpp in Sources */,
     25937                                E1FF8F5F1807442100132674 /* SubtleCrypto.cpp in Sources */,
    2590125938                                9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */,
    2590225939                                82AB1775125C826700C5069D /* InspectorResourceAgent.cpp in Sources */,
     
    2741327450                                51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,
    2741427451                                E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */,
     27452                                E1FF8F64180745D800132674 /* JSSubtleCrypto.cpp in Sources */,
    2741527453                                185BCF280F3279CE000EA262 /* ThreadTimers.cpp in Sources */,
    2741627454                                1AA7160A149BC4DB0016EC19 /* TileController.mm in Sources */,
  • trunk/Source/WebCore/page/Crypto.cpp

    r157417 r157430  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3334#include "Document.h"
    3435#include "ExceptionCode.h"
     36#include "SubtleCrypto.h"
    3537#include <runtime/ArrayBufferView.h>
    3638#include <wtf/CryptographicallyRandomNumber.h>
     
    7476}
    7577
     78#if ENABLE(SUBTLE_CRYPTO)
     79SubtleCrypto* Crypto::subtle()
     80{
     81    ASSERT(isMainThread());
     82    if (!m_subtle)
     83        m_subtle = SubtleCrypto::create(*document());
     84
     85    return m_subtle.get();
    7686}
     87#endif
     88
     89}
  • trunk/Source/WebCore/page/Crypto.h

    r157417 r157430  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3435#include <wtf/PassRefPtr.h>
    3536#include <wtf/RefCounted.h>
     37#include <wtf/RefPtr.h>
    3638
    3739namespace JSC {
     
    4446
    4547class Document;
     48class SubtleCrypto;
    4649
    4750class Crypto : public ContextDestructionObserver, public RefCounted<Crypto> {
     
    5457    void getRandomValues(JSC::ArrayBufferView*, ExceptionCode&);
    5558
     59#if ENABLE(SUBTLE_CRYPTO)
     60    SubtleCrypto* subtle();
     61#endif
     62
    5663private:
    5764    Crypto(Document&);
     65
     66#if ENABLE(SUBTLE_CRYPTO)
     67    RefPtr<SubtleCrypto> m_subtle;
     68#endif
    5869};
    5970
  • trunk/Source/WebCore/page/Crypto.idl

    r157417 r157430  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3334] interface Crypto {
    3435    [Custom, RaisesException] ArrayBufferView getRandomValues(ArrayBufferView array);
     36
     37    [Conditional=SUBTLE_CRYPTO, ImplementedAs=subtle] readonly attribute SubtleCrypto webkitSubtle;
    3538};
    36 
Note: See TracChangeset for help on using the changeset viewer.