| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // * The CryptoResult interface must only be called from the origin thread. | 48 // * The CryptoResult interface must only be called from the origin thread. |
| 49 // * addref() and deref() can be called from any thread. | 49 // * addref() and deref() can be called from any thread. |
| 50 // * One of the completeWith***() functions must be called, or the | 50 // * One of the completeWith***() functions must be called, or the |
| 51 // PromiseState will be leaked until the ExecutionContext is destroyed. | 51 // PromiseState will be leaked until the ExecutionContext is destroyed. |
| 52 class CryptoResultImpl FINAL : public CryptoResult { | 52 class CryptoResultImpl FINAL : public CryptoResult { |
| 53 public: | 53 public: |
| 54 ~CryptoResultImpl(); | 54 ~CryptoResultImpl(); |
| 55 | 55 |
| 56 static PassRefPtr<CryptoResultImpl> create(); | 56 static PassRefPtr<CryptoResultImpl> create(); |
| 57 | 57 |
| 58 virtual void completeWithError() OVERRIDE; | 58 virtual void completeWithError(blink::WebCryptoErrorType, const blink::WebSt
ring&) OVERRIDE; |
| 59 virtual void completeWithError(const blink::WebString&) OVERRIDE; | |
| 60 virtual void completeWithBuffer(const blink::WebArrayBuffer&) OVERRIDE; | 59 virtual void completeWithBuffer(const blink::WebArrayBuffer&) OVERRIDE; |
| 61 virtual void completeWithBoolean(bool) OVERRIDE; | 60 virtual void completeWithBoolean(bool) OVERRIDE; |
| 62 virtual void completeWithKey(const blink::WebCryptoKey&) OVERRIDE; | 61 virtual void completeWithKey(const blink::WebCryptoKey&) OVERRIDE; |
| 63 virtual void completeWithKeyPair(const blink::WebCryptoKey& publicKey, const
blink::WebCryptoKey& privateKey) OVERRIDE; | 62 virtual void completeWithKeyPair(const blink::WebCryptoKey& publicKey, const
blink::WebCryptoKey& privateKey) OVERRIDE; |
| 64 | 63 |
| 65 // It is only valid to call this before completion. | 64 // It is only valid to call this before completion. |
| 66 ScriptPromise promise(); | 65 ScriptPromise promise(); |
| 67 | 66 |
| 68 private: | 67 private: |
| 69 explicit CryptoResultImpl(ExecutionContext*); | 68 explicit CryptoResultImpl(ExecutionContext*); |
| 70 | 69 |
| 71 class PromiseState; | 70 class PromiseState; |
| 72 WeakPtr<PromiseState> m_promiseState; | 71 WeakPtr<PromiseState> m_promiseState; |
| 73 }; | 72 }; |
| 74 | 73 |
| 75 } // namespace WebCore | 74 } // namespace WebCore |
| 76 | 75 |
| 77 #endif | 76 #endif |
| OLD | NEW |