| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 | 117 |
| 118 ASSERT_NOT_REACHED(); | 118 ASSERT_NOT_REACHED(); |
| 119 return 0; | 119 return 0; |
| 120 } | 120 } |
| 121 | 121 |
| 122 CryptoResultImpl::CryptoResultImpl(ScriptState* script_state) | 122 CryptoResultImpl::CryptoResultImpl(ScriptState* script_state) |
| 123 : resolver_(Resolver::Create(script_state, this)), | 123 : resolver_(Resolver::Create(script_state, this)), |
| 124 cancel_(ResultCancel::Create()) { | 124 cancel_(ResultCancel::Create()) { |
| 125 // Sync cancellation state. | 125 // Sync cancellation state. |
| 126 if (script_state->GetExecutionContext()->IsContextDestroyed()) | 126 if (ExecutionContext::From(script_state)->IsContextDestroyed()) |
| 127 cancel_->Cancel(); | 127 cancel_->Cancel(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 CryptoResultImpl::~CryptoResultImpl() { | 130 CryptoResultImpl::~CryptoResultImpl() { |
| 131 ASSERT(!resolver_); | 131 ASSERT(!resolver_); |
| 132 } | 132 } |
| 133 | 133 |
| 134 DEFINE_TRACE(CryptoResultImpl) { | 134 DEFINE_TRACE(CryptoResultImpl) { |
| 135 visitor->Trace(resolver_); | 135 visitor->Trace(resolver_); |
| 136 CryptoResult::Trace(visitor); | 136 CryptoResult::Trace(visitor); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 cancel_->Cancel(); | 230 cancel_->Cancel(); |
| 231 cancel_.Clear(); | 231 cancel_.Clear(); |
| 232 ClearResolver(); | 232 ClearResolver(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 ScriptPromise CryptoResultImpl::Promise() { | 235 ScriptPromise CryptoResultImpl::Promise() { |
| 236 return resolver_ ? resolver_->Promise() : ScriptPromise(); | 236 return resolver_ ? resolver_->Promise() : ScriptPromise(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace blink | 239 } // namespace blink |
| OLD | NEW |