| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 DOMException* exception = V8DOMException::toNative(obj); | 121 DOMException* exception = V8DOMException::toNative(obj); |
| 122 if (exception && !exception->messageForConsole().isEmpty()) | 122 if (exception && !exception->messageForConsole().isEmpty()) |
| 123 event->setUnsanitizedMessage("Uncaught " + exception->toStringFo
rConsole()); | 123 event->setUnsanitizedMessage("Uncaught " + exception->toStringFo
rConsole()); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 // This method might be called while we're creating a new context. In this c
ase, we | 127 // This method might be called while we're creating a new context. In this c
ase, we |
| 128 // avoid storing the exception object, as we can't create a wrapper during c
ontext creation. | 128 // avoid storing the exception object, as we can't create a wrapper during c
ontext creation. |
| 129 // FIXME: Can we even get here during initialization now that we bail out wh
en GetEntered returns an empty handle? | 129 // FIXME: Can we even get here during initialization now that we bail out wh
en GetEntered returns an empty handle? |
| 130 LocalFrame* frame = enteredWindow->document()->frame(); | 130 LocalFrame* frame = enteredWindow->document()->frame(); |
| 131 if (frame && frame->script().existingWindowShell(scriptState->world())) { | 131 if (frame && frame->script().existingWindowProxy(scriptState->world())) { |
| 132 V8ErrorHandler::storeExceptionOnErrorEventWrapper(event.get(), data, scr
iptState->context()->Global(), isolate); | 132 V8ErrorHandler::storeExceptionOnErrorEventWrapper(event.get(), data, scr
iptState->context()->Global(), isolate); |
| 133 } | 133 } |
| 134 | 134 |
| 135 if (scriptState->world().isPrivateScriptIsolatedWorld()) { | 135 if (scriptState->world().isPrivateScriptIsolatedWorld()) { |
| 136 // We allow a private script to dispatch error events even in a NoEventD
ispatchAssertion scope. | 136 // We allow a private script to dispatch error events even in a NoEventD
ispatchAssertion scope. |
| 137 // Without having this ability, it's hard to debug the private script be
cause syntax errors | 137 // Without having this ability, it's hard to debug the private script be
cause syntax errors |
| 138 // in the private script are not reported to console (the private script
just crashes silently). | 138 // in the private script are not reported to console (the private script
just crashes silently). |
| 139 // Allowing error events in private scripts is safe because error events
don't propagate to | 139 // Allowing error events in private scripts is safe because error events
don't propagate to |
| 140 // other isolated worlds (which means that the error events won't fire a
ny event listeners | 140 // other isolated worlds (which means that the error events won't fire a
ny event listeners |
| 141 // in user's scripts). | 141 // in user's scripts). |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 v8::V8::AddMessageListener(messageHandlerInWorker); | 259 v8::V8::AddMessageListener(messageHandlerInWorker); |
| 260 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); | 260 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); |
| 261 | 261 |
| 262 v8::ResourceConstraints resourceConstraints; | 262 v8::ResourceConstraints resourceConstraints; |
| 263 uint32_t here; | 263 uint32_t here; |
| 264 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); | 264 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); |
| 265 v8::SetResourceConstraints(isolate, &resourceConstraints); | 265 v8::SetResourceConstraints(isolate, &resourceConstraints); |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace blink | 268 } // namespace blink |
| OLD | NEW |