| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 return emptyString(); | 109 return emptyString(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 static void messageHandlerInMainThread(v8::Local<v8::Message> message, v8::Local
<v8::Value> data) | 112 static void messageHandlerInMainThread(v8::Local<v8::Message> message, v8::Local
<v8::Value> data) |
| 113 { | 113 { |
| 114 ASSERT(isMainThread()); | 114 ASSERT(isMainThread()); |
| 115 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 115 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 116 | 116 |
| 117 if (isolate->GetEnteredContext().IsEmpty()) |
| 118 return; |
| 119 |
| 117 // If called during context initialization, there will be no entered context
. | 120 // If called during context initialization, there will be no entered context
. |
| 118 ScriptState* scriptState = ScriptState::current(isolate); | 121 ScriptState* scriptState = ScriptState::current(isolate); |
| 119 if (!scriptState->contextIsValid()) | 122 if (!scriptState->contextIsValid()) |
| 120 return; | 123 return; |
| 121 | 124 |
| 122 ExecutionContext* context = scriptState->getExecutionContext(); | 125 ExecutionContext* context = scriptState->getExecutionContext(); |
| 123 OwnPtr<SourceLocation> location = SourceLocation::fromMessage(isolate, messa
ge, context); | 126 OwnPtr<SourceLocation> location = SourceLocation::fromMessage(isolate, messa
ge, context); |
| 124 | 127 |
| 125 AccessControlStatus accessControlStatus = NotSharableCrossOrigin; | 128 AccessControlStatus accessControlStatus = NotSharableCrossOrigin; |
| 126 if (message->IsOpaque()) | 129 if (message->IsOpaque()) |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 430 |
| 428 isolate->AddMessageListener(messageHandlerInWorker); | 431 isolate->AddMessageListener(messageHandlerInWorker); |
| 429 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 432 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
| 430 | 433 |
| 431 uint32_t here; | 434 uint32_t here; |
| 432 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 435 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
| 433 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 436 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 434 } | 437 } |
| 435 | 438 |
| 436 } // namespace blink | 439 } // namespace blink |
| OLD | NEW |