| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 && v8Call(message->GetStartColumn(scriptState->context()), columnNumber)
) | 138 && v8Call(message->GetStartColumn(scriptState->context()), columnNumber)
) |
| 139 ++columnNumber; | 139 ++columnNumber; |
| 140 return ErrorEvent::create(errorMessage, resourceName, lineNumber, columnNumb
er, &scriptState->world()); | 140 return ErrorEvent::create(errorMessage, resourceName, lineNumber, columnNumb
er, &scriptState->world()); |
| 141 } | 141 } |
| 142 | 142 |
| 143 static void messageHandlerInMainThread(v8::Local<v8::Message> message, v8::Local
<v8::Value> data) | 143 static void messageHandlerInMainThread(v8::Local<v8::Message> message, v8::Local
<v8::Value> data) |
| 144 { | 144 { |
| 145 ASSERT(isMainThread()); | 145 ASSERT(isMainThread()); |
| 146 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 146 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 147 | 147 |
| 148 if (isolate->GetEnteredContext().IsEmpty()) |
| 149 return; |
| 150 |
| 148 // If called during context initialization, there will be no entered context
. | 151 // If called during context initialization, there will be no entered context
. |
| 149 ScriptState* scriptState = ScriptState::current(isolate); | 152 ScriptState* scriptState = ScriptState::current(isolate); |
| 150 if (!scriptState->contextIsValid()) | 153 if (!scriptState->contextIsValid()) |
| 151 return; | 154 return; |
| 152 | 155 |
| 153 int scriptId = 0; | 156 int scriptId = 0; |
| 154 RefPtr<ScriptCallStack> callStack = extractCallStack(isolate, message, &scri
ptId); | 157 RefPtr<ScriptCallStack> callStack = extractCallStack(isolate, message, &scri
ptId); |
| 155 | 158 |
| 156 AccessControlStatus accessControlStatus = NotSharableCrossOrigin; | 159 AccessControlStatus accessControlStatus = NotSharableCrossOrigin; |
| 157 if (message->IsOpaque()) | 160 if (message->IsOpaque()) |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 473 |
| 471 isolate->AddMessageListener(messageHandlerInWorker); | 474 isolate->AddMessageListener(messageHandlerInWorker); |
| 472 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 475 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
| 473 | 476 |
| 474 uint32_t here; | 477 uint32_t here; |
| 475 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 478 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
| 476 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 479 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 477 } | 480 } |
| 478 | 481 |
| 479 } // namespace blink | 482 } // namespace blink |
| OLD | NEW |