Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: Source/core/platform/chromium/support/WebCrypto.cpp

Issue 23164012: WebCrypto: Remove support for multi-part operations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include <string.h> // for memcpy()
abarth-chromium 2013/08/16 04:53:07 Please alphabetize this include with the rest of t
eroman 2013/08/16 22:59:41 Done.
32
31 #include "config.h" 33 #include "config.h"
32 #include "public/platform/WebCrypto.h" 34 #include "public/platform/WebCrypto.h"
35 #include "public/platform/WebArrayBuffer.h"
33 36
34 namespace WebKit { 37 namespace WebKit {
35 38
36 // FIXME: Assert that these methods are called from the right thread. 39 void WebCryptoOperationResult::completeWithBuffer(const void* bytes, size_t byte sSize)
37
38 void WebCryptoOperationResult::initializationFailed()
39 { 40 {
40 m_impl->initializationFailed(); 41 WebArrayBuffer buffer = WebKit::WebArrayBuffer::create(bytesSize, 1);
41 reset(); 42 memcpy(buffer.data(), bytes, bytesSize);
42 } 43 completeWithBuffer(buffer);
43
44 void WebCryptoOperationResult::initializationSucceeded(WebCryptoOperation* op)
45 {
46 m_impl->initializationSucceeded(op);
47 reset();
48 }
49
50 void WebCryptoOperationResult::completeWithError()
51 {
52 m_impl->completeWithError();
53 reset();
54 }
55
56 void WebCryptoOperationResult::completeWithArrayBuffer(const WebArrayBuffer& buf fer)
57 {
58 m_impl->completeWithArrayBuffer(buffer);
59 reset();
60 }
61
62 void WebCryptoOperationResult::completeWithBoolean(bool b)
63 {
64 m_impl->completeWithBoolean(b);
65 reset();
66 }
67
68 void WebCryptoOperationResult::reset()
69 {
70 m_impl.reset();
71 }
72
73 void WebCryptoOperationResult::assign(const WebCryptoOperationResult& o)
74 {
75 m_impl = o.m_impl;
76 }
77
78 void WebCryptoOperationResult::assign(WebCryptoOperationResultPrivate* impl)
79 {
80 m_impl = impl;
81 }
82
83 void WebCryptoKeyOperationResult::initializationFailed()
84 {
85 m_impl->initializationFailed();
86 reset();
87 }
88
89 void WebCryptoKeyOperationResult::initializationSucceeded(WebCryptoKeyOperation* op)
90 {
91 m_impl->initializationSucceeded(op);
92 reset();
93 }
94
95 void WebCryptoKeyOperationResult::completeWithError()
96 {
97 m_impl->completeWithError();
98 reset();
99 }
100
101 void WebCryptoKeyOperationResult::completeWithKey(const WebCryptoKey& key)
102 {
103 m_impl->completeWithKey(key);
104 reset();
105 }
106
107 void WebCryptoKeyOperationResult::reset()
108 {
109 m_impl.reset();
110 }
111
112 void WebCryptoKeyOperationResult::assign(const WebCryptoKeyOperationResult& o)
113 {
114 m_impl = o.m_impl;
115 }
116
117 void WebCryptoKeyOperationResult::assign(WebCryptoKeyOperationResultPrivate* imp l)
118 {
119 m_impl = impl;
120 } 44 }
121 45
122 } // namespace WebKit 46 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698