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

Side by Side Diff: Source/modules/crypto/CryptoResult.cpp

Issue 23479016: Introduce Promise mapping to the IDL generator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add hasNoValue Created 7 years, 3 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
« no previous file with comments | « Source/modules/crypto/CryptoResult.h ('k') | Source/modules/crypto/SubtleCrypto.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 m_promiseResolver->fulfill(Key::create(key)); 78 m_promiseResolver->fulfill(Key::create(key));
79 finish(); 79 finish();
80 } 80 }
81 81
82 void CryptoResult::completeWithKeyPair(const WebKit::WebCryptoKey& publicKey, co nst WebKit::WebCryptoKey& privateKey) 82 void CryptoResult::completeWithKeyPair(const WebKit::WebCryptoKey& publicKey, co nst WebKit::WebCryptoKey& privateKey)
83 { 83 {
84 m_promiseResolver->fulfill(KeyPair::create(publicKey, privateKey)); 84 m_promiseResolver->fulfill(KeyPair::create(publicKey, privateKey));
85 finish(); 85 finish();
86 } 86 }
87 87
88 ScriptObject CryptoResult::promise() 88 ScriptPromise CryptoResult::promise()
89 { 89 {
90 return m_promiseResolver->promise(); 90 return m_promiseResolver->promise();
91 } 91 }
92 92
93 CryptoResult::CryptoResult() 93 CryptoResult::CryptoResult()
94 : m_promiseResolver(ScriptPromiseResolver::create()) 94 : m_promiseResolver(ScriptPromiseResolver::create())
95 , m_finished(false) { } 95 , m_finished(false) { }
96 96
97 void CryptoResult::finish() 97 void CryptoResult::finish()
98 { 98 {
99 ASSERT(!m_finished); 99 ASSERT(!m_finished);
100 m_finished = true; 100 m_finished = true;
101 } 101 }
102 102
103 } // namespace WebCore 103 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/crypto/CryptoResult.h ('k') | Source/modules/crypto/SubtleCrypto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698