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 27 matching lines...) Expand all Loading... |
38 #include "core/dom/DOMError.h" | 38 #include "core/dom/DOMError.h" |
39 #include "core/dom/DOMException.h" | 39 #include "core/dom/DOMException.h" |
40 #include "core/dom/ExecutionContext.h" | 40 #include "core/dom/ExecutionContext.h" |
41 #include "modules/crypto/CryptoKey.h" | 41 #include "modules/crypto/CryptoKey.h" |
42 #include "modules/crypto/NormalizeAlgorithm.h" | 42 #include "modules/crypto/NormalizeAlgorithm.h" |
43 #include "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
44 #include "public/platform/WebArrayBuffer.h" | 44 #include "public/platform/WebArrayBuffer.h" |
45 #include "public/platform/WebCryptoAlgorithm.h" | 45 #include "public/platform/WebCryptoAlgorithm.h" |
46 #include "wtf/ArrayBufferView.h" | 46 #include "wtf/ArrayBufferView.h" |
47 | 47 |
48 namespace WebCore { | 48 namespace blink { |
49 | 49 |
50 class CryptoResultImpl::WeakResolver : public ScriptPromiseResolver { | 50 class CryptoResultImpl::WeakResolver : public ScriptPromiseResolver { |
51 public: | 51 public: |
52 static WeakPtr<ScriptPromiseResolver> create(ScriptState* scriptState, Crypt
oResultImpl* result) | 52 static WeakPtr<ScriptPromiseResolver> create(ScriptState* scriptState, Crypt
oResultImpl* result) |
53 { | 53 { |
54 RefPtr<WeakResolver> p = adoptRef(new WeakResolver(scriptState, result))
; | 54 RefPtr<WeakResolver> p = adoptRef(new WeakResolver(scriptState, result))
; |
55 p->suspendIfNeeded(); | 55 p->suspendIfNeeded(); |
56 p->keepAliveWhilePending(); | 56 p->keepAliveWhilePending(); |
57 return p->m_weakPtrFactory.createWeakPtr(); | 57 return p->m_weakPtrFactory.createWeakPtr(); |
58 } | 58 } |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // Creating the WeakResolver may return nullptr if active dom objects have | 186 // Creating the WeakResolver may return nullptr if active dom objects have |
187 // been stopped. And in the process set m_cancelled to 1. | 187 // been stopped. And in the process set m_cancelled to 1. |
188 m_resolver = WeakResolver::create(scriptState, this); | 188 m_resolver = WeakResolver::create(scriptState, this); |
189 } | 189 } |
190 | 190 |
191 ScriptPromise CryptoResultImpl::promise() | 191 ScriptPromise CryptoResultImpl::promise() |
192 { | 192 { |
193 return m_resolver ? m_resolver->promise() : ScriptPromise(); | 193 return m_resolver ? m_resolver->promise() : ScriptPromise(); |
194 } | 194 } |
195 | 195 |
196 } // namespace WebCore | 196 } // namespace blink |
OLD | NEW |