OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 WTF::ArrayBufferContents::freeMemory(data, size); | 235 WTF::ArrayBufferContents::freeMemory(data, size); |
236 } | 236 } |
237 }; | 237 }; |
238 | 238 |
239 } // namespace | 239 } // namespace |
240 | 240 |
241 typedef Deque<PromiseRejectMessage> PromiseRejectMessageQueue; | 241 typedef Deque<PromiseRejectMessage> PromiseRejectMessageQueue; |
242 | 242 |
243 static PromiseRejectMessageQueue& promiseRejectMessageQueue() | 243 static PromiseRejectMessageQueue& promiseRejectMessageQueue() |
244 { | 244 { |
245 AtomicallyInitializedStatic(ThreadSpecific<PromiseRejectMessageQueue>*, queu
e = new ThreadSpecific<PromiseRejectMessageQueue>); | 245 AtomicallyInitializedStaticReference(ThreadSpecific<PromiseRejectMessageQueu
e>, queue, new ThreadSpecific<PromiseRejectMessageQueue>); |
246 return **queue; | 246 return *queue; |
247 } | 247 } |
248 | 248 |
249 void V8Initializer::reportRejectedPromises() | 249 void V8Initializer::reportRejectedPromises() |
250 { | 250 { |
251 PromiseRejectMessageQueue& queue = promiseRejectMessageQueue(); | 251 PromiseRejectMessageQueue& queue = promiseRejectMessageQueue(); |
252 while (!queue.isEmpty()) { | 252 while (!queue.isEmpty()) { |
253 PromiseRejectMessage message = queue.takeFirst(); | 253 PromiseRejectMessage message = queue.takeFirst(); |
254 ScriptState* scriptState = message.m_promise.scriptState(); | 254 ScriptState* scriptState = message.m_promise.scriptState(); |
255 if (!scriptState->contextIsValid()) | 255 if (!scriptState->contextIsValid()) |
256 continue; | 256 continue; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 | 536 |
537 v8::V8::AddMessageListener(messageHandlerInWorker); | 537 v8::V8::AddMessageListener(messageHandlerInWorker); |
538 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); | 538 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); |
539 | 539 |
540 uint32_t here; | 540 uint32_t here; |
541 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 541 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
542 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 542 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
543 } | 543 } |
544 | 544 |
545 } // namespace blink | 545 } // namespace blink |
OLD | NEW |