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

Side by Side Diff: Source/modules/crypto/CryptoResultImpl.h

Issue 243853004: [webcrypto] Reject failed operations with a DOMException rather than null. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix compile warning Created 6 years, 7 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « LayoutTests/crypto/wrapKey-unextractable-expected.txt ('k') | Source/modules/crypto/CryptoResultImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698