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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 accessControlStatus = SharableCrossOrigin; | 177 accessControlStatus = SharableCrossOrigin; |
178 | 178 |
179 ErrorEvent* event = | 179 ErrorEvent* event = |
180 ErrorEvent::create(toCoreStringWithNullCheck(message->Get()), | 180 ErrorEvent::create(toCoreStringWithNullCheck(message->Get()), |
181 std::move(location), &scriptState->world()); | 181 std::move(location), &scriptState->world()); |
182 | 182 |
183 String messageForConsole = extractMessageForConsole(isolate, data); | 183 String messageForConsole = extractMessageForConsole(isolate, data); |
184 if (!messageForConsole.isEmpty()) | 184 if (!messageForConsole.isEmpty()) |
185 event->setUnsanitizedMessage("Uncaught " + messageForConsole); | 185 event->setUnsanitizedMessage("Uncaught " + messageForConsole); |
186 | 186 |
187 // This method might be called while we're creating a new context. In this | 187 V8ErrorHandler::storeExceptionOnErrorEventWrapper( |
188 // case, we avoid storing the exception object, as we can't create a wrapper | 188 scriptState, event, data, scriptState->context()->Global()); |
189 // during context creation. | |
190 // FIXME: Can we even get here during initialization now that we bail out when | |
191 // GetEntered returns an empty handle? | |
192 if (context->isDocument()) { | |
193 LocalFrame* frame = toDocument(context)->frame(); | |
194 if (frame && frame->script().existingWindowProxy(scriptState->world())) { | |
195 V8ErrorHandler::storeExceptionOnErrorEventWrapper( | |
196 scriptState, event, data, scriptState->context()->Global()); | |
197 } | |
198 } | |
199 | |
200 context->dispatchErrorEvent(event, accessControlStatus); | 189 context->dispatchErrorEvent(event, accessControlStatus); |
201 } | 190 } |
202 | 191 |
203 namespace { | 192 namespace { |
204 | 193 |
205 static RejectedPromises& rejectedPromisesOnMainThread() { | 194 static RejectedPromises& rejectedPromisesOnMainThread() { |
206 ASSERT(isMainThread()); | 195 ASSERT(isMainThread()); |
207 DEFINE_STATIC_LOCAL(RefPtr<RejectedPromises>, rejectedPromises, | 196 DEFINE_STATIC_LOCAL(RefPtr<RejectedPromises>, rejectedPromises, |
208 (RejectedPromises::create())); | 197 (RejectedPromises::create())); |
209 return *rejectedPromises; | 198 return *rejectedPromises; |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 v8::Isolate::kMessageLog); | 520 v8::Isolate::kMessageLog); |
532 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 521 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
533 | 522 |
534 uint32_t here; | 523 uint32_t here; |
535 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - | 524 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - |
536 kWorkerMaxStackSize); | 525 kWorkerMaxStackSize); |
537 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 526 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
538 } | 527 } |
539 | 528 |
540 } // namespace blink | 529 } // namespace blink |
OLD | NEW |