| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 double timestamp = currentTimeMS(); | 76 double timestamp = currentTimeMS(); |
| 77 m_promiseDataMap.set(promise, adoptRef(new PromiseData(promise, ScriptObject
(), ScriptValue(), V8PromiseCustom::Pending, timestamp))); | 77 m_promiseDataMap.set(promise, adoptRef(new PromiseData(promise, ScriptObject
(), ScriptValue(), V8PromiseCustom::Pending, timestamp))); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void PromiseTracker::didUpdatePromiseParent(const ScriptObject& promise, const S
criptObject& parentPromise) | 80 void PromiseTracker::didUpdatePromiseParent(const ScriptObject& promise, const S
criptObject& parentPromise) |
| 81 { | 81 { |
| 82 ASSERT(isEnabled()); | 82 ASSERT(isEnabled()); |
| 83 | 83 |
| 84 RefPtr<PromiseData> data = m_promiseDataMap.get(promise); | 84 RefPtr<PromiseData> data = m_promiseDataMap.get(promise); |
| 85 ASSERT(data != NULL && data->m_promise == promise); | 85 ASSERT(data && data->m_promise == promise); |
| 86 data->m_parentPromise = parentPromise; | 86 data->m_parentPromise = parentPromise; |
| 87 } | 87 } |
| 88 | 88 |
| 89 void PromiseTracker::didUpdatePromiseState(const ScriptObject& promise, V8Promis
eCustom::PromiseState state, const ScriptValue& result) | 89 void PromiseTracker::didUpdatePromiseState(const ScriptObject& promise, V8Promis
eCustom::PromiseState state, const ScriptValue& result) |
| 90 { | 90 { |
| 91 ASSERT(isEnabled()); | 91 ASSERT(isEnabled()); |
| 92 | 92 |
| 93 double timestamp = currentTimeMS(); | 93 double timestamp = currentTimeMS(); |
| 94 RefPtr<PromiseData> data = m_promiseDataMap.get(promise); | 94 RefPtr<PromiseData> data = m_promiseDataMap.get(promise); |
| 95 ASSERT(data != NULL && data->m_promise == promise); | 95 ASSERT(data && data->m_promise == promise); |
| 96 data->m_state = state; | 96 data->m_state = state; |
| 97 data->m_result = result; | 97 data->m_result = result; |
| 98 if (state == V8PromiseCustom::Fulfilled || state == V8PromiseCustom::Rejecte
d) | 98 if (state == V8PromiseCustom::Fulfilled || state == V8PromiseCustom::Rejecte
d) |
| 99 data->didSettlePromise(timestamp); | 99 data->didSettlePromise(timestamp); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace WebCore | 102 } // namespace WebCore |
| OLD | NEW |