| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 class CryptoResultImpl::Resolver final : public ScriptPromiseResolver { | 64 class CryptoResultImpl::Resolver final : public ScriptPromiseResolver { |
| 65 public: | 65 public: |
| 66 static PassRefPtrWillBeRawPtr<ScriptPromiseResolver> create(ScriptState* scr
iptState, CryptoResultImpl* result) | 66 static PassRefPtrWillBeRawPtr<ScriptPromiseResolver> create(ScriptState* scr
iptState, CryptoResultImpl* result) |
| 67 { | 67 { |
| 68 RefPtrWillBeRawPtr<Resolver> resolver = adoptRefWillBeNoop(new Resolver(
scriptState, result)); | 68 RefPtrWillBeRawPtr<Resolver> resolver = adoptRefWillBeNoop(new Resolver(
scriptState, result)); |
| 69 resolver->suspendIfNeeded(); | 69 resolver->suspendIfNeeded(); |
| 70 resolver->keepAliveWhilePending(); | 70 resolver->keepAliveWhilePending(); |
| 71 return resolver.release(); | 71 return resolver.release(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 virtual void stop() override | 74 void stop() override |
| 75 { | 75 { |
| 76 m_result->cancel(); | 76 m_result->cancel(); |
| 77 m_result->clearResolver(); | 77 m_result->clearResolver(); |
| 78 m_result = nullptr; | 78 m_result = nullptr; |
| 79 ScriptPromiseResolver::stop(); | 79 ScriptPromiseResolver::stop(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 Resolver(ScriptState* scriptState, CryptoResultImpl* result) | 83 Resolver(ScriptState* scriptState, CryptoResultImpl* result) |
| 84 : ScriptPromiseResolver(scriptState) | 84 : ScriptPromiseResolver(scriptState) |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 m_resolver = Resolver::create(scriptState, this).get(); | 215 m_resolver = Resolver::create(scriptState, this).get(); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 ScriptPromise CryptoResultImpl::promise() | 219 ScriptPromise CryptoResultImpl::promise() |
| 220 { | 220 { |
| 221 return m_resolver ? m_resolver->promise() : ScriptPromise(); | 221 return m_resolver ? m_resolver->promise() : ScriptPromise(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace blink | 224 } // namespace blink |
| OLD | NEW |