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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 String errorMessage = toWebCoreString(message->Get()); | 92 String errorMessage = toWebCoreString(message->Get()); |
93 | 93 |
94 v8::Handle<v8::StackTrace> stackTrace = message->GetStackTrace(); | 94 v8::Handle<v8::StackTrace> stackTrace = message->GetStackTrace(); |
95 RefPtr<ScriptCallStack> callStack; | 95 RefPtr<ScriptCallStack> callStack; |
96 // Currently stack trace is only collected when inspector is open. | 96 // Currently stack trace is only collected when inspector is open. |
97 if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0) | 97 if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0) |
98 callStack = createScriptCallStack(stackTrace, ScriptCallStack::maxCallSt
ackSizeToCapture, v8::Isolate::GetCurrent()); | 98 callStack = createScriptCallStack(stackTrace, ScriptCallStack::maxCallSt
ackSizeToCapture, v8::Isolate::GetCurrent()); |
99 | 99 |
100 v8::Handle<v8::Value> resourceName = message->GetScriptResourceName(); | 100 v8::Handle<v8::Value> resourceName = message->GetScriptResourceName(); |
101 bool shouldUseDocumentURL = resourceName.IsEmpty() || !resourceName->IsStrin
g(); | 101 bool shouldUseDocumentURL = resourceName.IsEmpty() || !resourceName->IsStrin
g(); |
102 String resource = shouldUseDocumentURL ? firstWindow->document()->url() : to
WebCoreString(resourceName); | 102 String resource = shouldUseDocumentURL ? firstWindow->document()->url() : to
WebCoreString(resourceName.As<v8::String>()); |
103 AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCr
ossOrigin : NotSharableCrossOrigin; | 103 AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCr
ossOrigin : NotSharableCrossOrigin; |
104 | 104 |
105 RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, resource, messag
e->GetLineNumber(), message->GetStartColumn(), DOMWrapperWorld::current()); | 105 RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, resource, messag
e->GetLineNumber(), message->GetStartColumn(), DOMWrapperWorld::current()); |
106 if (V8DOMWrapper::isDOMWrapper(data)) { | 106 if (V8DOMWrapper::isDOMWrapper(data)) { |
107 v8::Handle<v8::Object> obj = v8::Handle<v8::Object>::Cast(data); | 107 v8::Handle<v8::Object> obj = v8::Handle<v8::Object>::Cast(data); |
108 WrapperTypeInfo* type = toWrapperTypeInfo(obj); | 108 WrapperTypeInfo* type = toWrapperTypeInfo(obj); |
109 if (V8DOMException::info.isSubclass(type)) { | 109 if (V8DOMException::info.isSubclass(type)) { |
110 DOMException* exception = V8DOMException::toNative(obj); | 110 DOMException* exception = V8DOMException::toNative(obj); |
111 if (exception && !exception->messageForConsole().isEmpty()) | 111 if (exception && !exception->messageForConsole().isEmpty()) |
112 event->setUnsanitizedMessage("Uncaught " + exception->toStringFo
rConsole()); | 112 event->setUnsanitizedMessage("Uncaught " + exception->toStringFo
rConsole()); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 v8::ResourceConstraints resourceConstraints; | 212 v8::ResourceConstraints resourceConstraints; |
213 uint32_t here; | 213 uint32_t here; |
214 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); | 214 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); |
215 v8::SetResourceConstraints(&resourceConstraints); | 215 v8::SetResourceConstraints(&resourceConstraints); |
216 | 216 |
217 V8PerIsolateData::ensureInitialized(isolate); | 217 V8PerIsolateData::ensureInitialized(isolate); |
218 } | 218 } |
219 | 219 |
220 } // namespace WebCore | 220 } // namespace WebCore |
OLD | NEW |