| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 return emptyString(); | 132 return emptyString(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 static void messageHandlerInMainThread(v8::Local<v8::Message> message, v8::Local
<v8::Value> data) | 135 static void messageHandlerInMainThread(v8::Local<v8::Message> message, v8::Local
<v8::Value> data) |
| 136 { | 136 { |
| 137 ASSERT(isMainThread()); | 137 ASSERT(isMainThread()); |
| 138 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 138 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 139 // If called during context initialization, there will be no entered window. | 139 // If called during context initialization, there will be no entered window. |
| 140 LocalDOMWindow* enteredWindow = enteredDOMWindow(isolate); | 140 // TODO(haraken): Add a helper method to get an entered window that may be n
ull. |
| 141 LocalDOMWindow* enteredWindow = toLocalDOMWindow(toDOMWindow(isolate->GetEnt
eredContext())); |
| 141 if (!enteredWindow || !enteredWindow->isCurrentlyDisplayedInFrame()) | 142 if (!enteredWindow || !enteredWindow->isCurrentlyDisplayedInFrame()) |
| 142 return; | 143 return; |
| 143 | 144 |
| 144 int scriptId = 0; | 145 int scriptId = 0; |
| 145 RefPtr<ScriptCallStack> callStack = extractCallStack(isolate, message, &scri
ptId); | 146 RefPtr<ScriptCallStack> callStack = extractCallStack(isolate, message, &scri
ptId); |
| 146 String resourceName = extractResourceName(message, enteredWindow->document()
); | 147 String resourceName = extractResourceName(message, enteredWindow->document()
); |
| 147 AccessControlStatus accessControlStatus = NotSharableCrossOrigin; | 148 AccessControlStatus accessControlStatus = NotSharableCrossOrigin; |
| 148 if (message->IsOpaque()) | 149 if (message->IsOpaque()) |
| 149 accessControlStatus = OpaqueResource; | 150 accessControlStatus = OpaqueResource; |
| 150 else if (message->IsSharedCrossOrigin()) | 151 else if (message->IsSharedCrossOrigin()) |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 457 |
| 457 isolate->AddMessageListener(messageHandlerInWorker); | 458 isolate->AddMessageListener(messageHandlerInWorker); |
| 458 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 459 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
| 459 | 460 |
| 460 uint32_t here; | 461 uint32_t here; |
| 461 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 462 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
| 462 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 463 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 463 } | 464 } |
| 464 | 465 |
| 465 } // namespace blink | 466 } // namespace blink |
| OLD | NEW |