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

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: Created 6 years, 8 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 namespace WebCore { 43 namespace WebCore {
44 44
45 // Wrapper around a Promise to notify completion of the crypto operation. 45 // Wrapper around a Promise to notify completion of the crypto operation.
46 // Platform cannot know about Promises which are declared in bindings. 46 // Platform cannot know about Promises which are declared in bindings.
47 class CryptoResultImpl FINAL : public CryptoResult, public ContextLifecycleObser ver { 47 class CryptoResultImpl FINAL : public CryptoResult, public ContextLifecycleObser ver {
48 public: 48 public:
49 ~CryptoResultImpl(); 49 ~CryptoResultImpl();
50 50
51 static PassRefPtr<CryptoResultImpl> create(); 51 static PassRefPtr<CryptoResultImpl> create();
52 52
53 virtual void completeWithError() OVERRIDE; 53 virtual void completeWithError(blink::WebCryptoErrorType, const blink::WebSt ring&) OVERRIDE;
54 virtual void completeWithError(const blink::WebString&) OVERRIDE;
55 virtual void completeWithBuffer(const blink::WebArrayBuffer&) OVERRIDE; 54 virtual void completeWithBuffer(const blink::WebArrayBuffer&) OVERRIDE;
56 virtual void completeWithBoolean(bool) OVERRIDE; 55 virtual void completeWithBoolean(bool) OVERRIDE;
57 virtual void completeWithKey(const blink::WebCryptoKey&) OVERRIDE; 56 virtual void completeWithKey(const blink::WebCryptoKey&) OVERRIDE;
58 virtual void completeWithKeyPair(const blink::WebCryptoKey& publicKey, const blink::WebCryptoKey& privateKey) OVERRIDE; 57 virtual void completeWithKeyPair(const blink::WebCryptoKey& publicKey, const blink::WebCryptoKey& privateKey) OVERRIDE;
59 58
60 ScriptPromise promise() { return m_promiseResolver->promise(); } 59 ScriptPromise promise() { return m_promiseResolver->promise(); }
61 60
62 private: 61 private:
63 CryptoResultImpl(ExecutionContext*); 62 CryptoResultImpl(ExecutionContext*);
64 void finish(); 63 void finish();
(...skipping 11 matching lines...) Expand all
76 75
77 #if !ASSERT_DISABLED 76 #if !ASSERT_DISABLED
78 ThreadIdentifier m_owningThread; 77 ThreadIdentifier m_owningThread;
79 bool m_finished; 78 bool m_finished;
80 #endif 79 #endif
81 }; 80 };
82 81
83 } // namespace WebCore 82 } // namespace WebCore
84 83
85 #endif 84 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698