OLD | NEW |
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 return SyntaxError; | 58 return SyntaxError; |
59 case blink::WebCryptoErrorTypeInvalidState: | 59 case blink::WebCryptoErrorTypeInvalidState: |
60 return InvalidStateError; | 60 return InvalidStateError; |
61 case blink::WebCryptoErrorTypeInvalidAccess: | 61 case blink::WebCryptoErrorTypeInvalidAccess: |
62 return InvalidAccessError; | 62 return InvalidAccessError; |
63 case blink::WebCryptoErrorTypeUnknown: | 63 case blink::WebCryptoErrorTypeUnknown: |
64 return UnknownError; | 64 return UnknownError; |
65 case blink::WebCryptoErrorTypeData: | 65 case blink::WebCryptoErrorTypeData: |
66 return DataError; | 66 return DataError; |
67 case blink::WebCryptoErrorTypeOperation: | 67 case blink::WebCryptoErrorTypeOperation: |
68 // FIXME: This exception type is new to WebCrypto and not yet defined. | 68 return OperationError; |
69 // Use a placeholder for now. | |
70 return InvalidStateError; | |
71 case blink::WebCryptoErrorTypeType: | 69 case blink::WebCryptoErrorTypeType: |
72 // FIXME: This should construct a TypeError instead. For now do | 70 // FIXME: This should construct a TypeError instead. For now do |
73 // something to facilitate refactor, but this will need to be | 71 // something to facilitate refactor, but this will need to be |
74 // revisited. | 72 // revisited. |
75 return DataError; | 73 return DataError; |
76 } | 74 } |
77 | 75 |
78 ASSERT_NOT_REACHED(); | 76 ASSERT_NOT_REACHED(); |
79 return 0; | 77 return 0; |
80 } | 78 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 : m_promiseState(PromiseState::create(context)) | 194 : m_promiseState(PromiseState::create(context)) |
197 { | 195 { |
198 } | 196 } |
199 | 197 |
200 ScriptPromise CryptoResultImpl::promise() | 198 ScriptPromise CryptoResultImpl::promise() |
201 { | 199 { |
202 return m_promiseState->promise(); | 200 return m_promiseState->promise(); |
203 } | 201 } |
204 | 202 |
205 } // namespace WebCore | 203 } // namespace WebCore |
OLD | NEW |