| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 const WrapperTypeInfo* type = toWrapperTypeInfo(obj); | 115 const WrapperTypeInfo* type = toWrapperTypeInfo(obj); |
| 116 if (V8DOMException::wrapperTypeInfo.isSubclass(type)) { | 116 if (V8DOMException::wrapperTypeInfo.isSubclass(type)) { |
| 117 DOMException* exception = V8DOMException::toImpl(obj); | 117 DOMException* exception = V8DOMException::toImpl(obj); |
| 118 if (exception && !exception->messageForConsole().isEmpty()) | 118 if (exception && !exception->messageForConsole().isEmpty()) |
| 119 return exception->toStringForConsole(); | 119 return exception->toStringForConsole(); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 return emptyString(); | 122 return emptyString(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 static void messageHandlerInMainThread(v8::Local<v8::Message> message, | 125 void V8Initializer::messageHandlerInMainThread(v8::Local<v8::Message> message, |
| 126 v8::Local<v8::Value> data) { | 126 v8::Local<v8::Value> data) { |
| 127 ASSERT(isMainThread()); | 127 ASSERT(isMainThread()); |
| 128 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 128 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 129 | 129 |
| 130 if (isolate->GetEnteredContext().IsEmpty()) | 130 if (isolate->GetEnteredContext().IsEmpty()) |
| 131 return; | 131 return; |
| 132 | 132 |
| 133 // If called during context initialization, there will be no entered context. | 133 // If called during context initialization, there will be no entered context. |
| 134 ScriptState* scriptState = ScriptState::current(isolate); | 134 ScriptState* scriptState = ScriptState::current(isolate); |
| 135 if (!scriptState->contextIsValid()) | 135 if (!scriptState->contextIsValid()) |
| 136 return; | 136 return; |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 isolate->AddMessageListener(messageHandlerInWorker); | 501 isolate->AddMessageListener(messageHandlerInWorker); |
| 502 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 502 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
| 503 | 503 |
| 504 uint32_t here; | 504 uint32_t here; |
| 505 isolate->SetStackLimit(reinterpret_cast<uintptr_t>( | 505 isolate->SetStackLimit(reinterpret_cast<uintptr_t>( |
| 506 &here - kWorkerMaxStackSize / sizeof(uint32_t*))); | 506 &here - kWorkerMaxStackSize / sizeof(uint32_t*))); |
| 507 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 507 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 508 } | 508 } |
| 509 | 509 |
| 510 } // namespace blink | 510 } // namespace blink |
| OLD | NEW |