| 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 Resolver* create(ScriptState* scriptState, CryptoResultImpl* result) { | 66 static Resolver* create(ScriptState* scriptState, CryptoResultImpl* result) { |
| 67 ASSERT(scriptState->contextIsValid()); | 67 ASSERT(scriptState->contextIsValid()); |
| 68 Resolver* resolver = new Resolver(scriptState, result); | 68 Resolver* resolver = new Resolver(scriptState, result); |
| 69 resolver->suspendIfNeeded(); | 69 resolver->suspendIfNeeded(); |
| 70 resolver->keepAliveWhilePending(); | 70 resolver->keepAliveWhilePending(); |
| 71 return resolver; | 71 return resolver; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void stop() override { | 74 void contextDestroyed() override { |
| 75 m_result->cancel(); | 75 m_result->cancel(); |
| 76 m_result = nullptr; | 76 m_result = nullptr; |
| 77 ScriptPromiseResolver::stop(); | 77 ScriptPromiseResolver::contextDestroyed(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 DEFINE_INLINE_VIRTUAL_TRACE() { | 80 DEFINE_INLINE_VIRTUAL_TRACE() { |
| 81 visitor->trace(m_result); | 81 visitor->trace(m_result); |
| 82 ScriptPromiseResolver::trace(visitor); | 82 ScriptPromiseResolver::trace(visitor); |
| 83 } | 83 } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 Resolver(ScriptState* scriptState, CryptoResultImpl* result) | 86 Resolver(ScriptState* scriptState, CryptoResultImpl* result) |
| 87 : ScriptPromiseResolver(scriptState), m_result(result) {} | 87 : ScriptPromiseResolver(scriptState), m_result(result) {} |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 m_cancel->cancel(); | 229 m_cancel->cancel(); |
| 230 m_cancel.clear(); | 230 m_cancel.clear(); |
| 231 clearResolver(); | 231 clearResolver(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 ScriptPromise CryptoResultImpl::promise() { | 234 ScriptPromise CryptoResultImpl::promise() { |
| 235 return m_resolver ? m_resolver->promise() : ScriptPromise(); | 235 return m_resolver ? m_resolver->promise() : ScriptPromise(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace blink | 238 } // namespace blink |
| OLD | NEW |