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 25 matching lines...) Expand all Loading... |
36 #include "core/dom/ContextLifecycleObserver.h" | 36 #include "core/dom/ContextLifecycleObserver.h" |
37 #include "core/platform/CryptoResult.h" | 37 #include "core/platform/CryptoResult.h" |
38 #include "public/platform/WebCrypto.h" | 38 #include "public/platform/WebCrypto.h" |
39 #include "wtf/Assertions.h" | 39 #include "wtf/Assertions.h" |
40 #include "wtf/Forward.h" | 40 #include "wtf/Forward.h" |
41 #include "wtf/Threading.h" | 41 #include "wtf/Threading.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 class ScriptPromiseResolver; | 45 class ScriptPromiseResolver; |
| 46 class ScriptState; |
46 | 47 |
47 // Wrapper around a Promise to notify completion of the crypto operation. | 48 // Wrapper around a Promise to notify completion of the crypto operation. |
48 // Platform cannot know about Promises which are declared in bindings. | 49 // Platform cannot know about Promises which are declared in bindings. |
49 class CryptoResultImpl FINAL : public CryptoResult, public ContextLifecycleObser
ver { | 50 class CryptoResultImpl FINAL : public CryptoResult, public ContextLifecycleObser
ver { |
50 public: | 51 public: |
51 ~CryptoResultImpl(); | 52 ~CryptoResultImpl(); |
52 | 53 |
53 static PassRefPtr<CryptoResultImpl> create(ScriptPromise); | 54 static PassRefPtr<CryptoResultImpl> create(ScriptPromise); |
54 | 55 |
55 virtual void completeWithError() OVERRIDE; | 56 virtual void completeWithError() OVERRIDE; |
| 57 virtual void completeWithError(const blink::WebString&) OVERRIDE; |
56 virtual void completeWithBuffer(const blink::WebArrayBuffer&) OVERRIDE; | 58 virtual void completeWithBuffer(const blink::WebArrayBuffer&) OVERRIDE; |
57 virtual void completeWithBoolean(bool) OVERRIDE; | 59 virtual void completeWithBoolean(bool) OVERRIDE; |
58 virtual void completeWithKey(const blink::WebCryptoKey&) OVERRIDE; | 60 virtual void completeWithKey(const blink::WebCryptoKey&) OVERRIDE; |
59 virtual void completeWithKeyPair(const blink::WebCryptoKey& publicKey, const
blink::WebCryptoKey& privateKey) OVERRIDE; | 61 virtual void completeWithKeyPair(const blink::WebCryptoKey& publicKey, const
blink::WebCryptoKey& privateKey) OVERRIDE; |
60 | 62 |
61 private: | 63 private: |
62 CryptoResultImpl(ExecutionContext*, ScriptPromise); | 64 CryptoResultImpl(ExecutionContext*, ScriptPromise); |
63 void finish(); | 65 void finish(); |
64 void CheckValidThread() const; | 66 void CheckValidThread() const; |
65 | 67 |
(...skipping 10 matching lines...) Expand all Loading... |
76 | 78 |
77 #if !ASSERT_DISABLED | 79 #if !ASSERT_DISABLED |
78 ThreadIdentifier m_owningThread; | 80 ThreadIdentifier m_owningThread; |
79 bool m_finished; | 81 bool m_finished; |
80 #endif | 82 #endif |
81 }; | 83 }; |
82 | 84 |
83 } // namespace WebCore | 85 } // namespace WebCore |
84 | 86 |
85 #endif | 87 #endif |
OLD | NEW |