| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "bindings/core/v8/V8PerContextData.h" | 42 #include "bindings/core/v8/V8PerContextData.h" |
| 43 #include "bindings/core/v8/V8Window.h" | 43 #include "bindings/core/v8/V8Window.h" |
| 44 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" | 44 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
| 45 #include "core/dom/Document.h" | 45 #include "core/dom/Document.h" |
| 46 #include "core/dom/ExceptionCode.h" | 46 #include "core/dom/ExceptionCode.h" |
| 47 #include "core/fetch/AccessControlStatus.h" | 47 #include "core/fetch/AccessControlStatus.h" |
| 48 #include "core/frame/ConsoleTypes.h" | 48 #include "core/frame/ConsoleTypes.h" |
| 49 #include "core/frame/LocalDOMWindow.h" | 49 #include "core/frame/LocalDOMWindow.h" |
| 50 #include "core/frame/LocalFrame.h" | 50 #include "core/frame/LocalFrame.h" |
| 51 #include "core/frame/csp/ContentSecurityPolicy.h" | 51 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 52 #include "core/inspector/MainThreadDebugger.h" |
| 52 #include "core/inspector/ScriptArguments.h" | 53 #include "core/inspector/ScriptArguments.h" |
| 53 #include "core/workers/WorkerGlobalScope.h" | 54 #include "core/workers/WorkerGlobalScope.h" |
| 54 #include "platform/EventDispatchForbiddenScope.h" | 55 #include "platform/EventDispatchForbiddenScope.h" |
| 55 #include "platform/RuntimeEnabledFeatures.h" | 56 #include "platform/RuntimeEnabledFeatures.h" |
| 56 #include "platform/TraceEvent.h" | 57 #include "platform/TraceEvent.h" |
| 57 #include "public/platform/Platform.h" | 58 #include "public/platform/Platform.h" |
| 58 #include "public/platform/WebScheduler.h" | 59 #include "public/platform/WebScheduler.h" |
| 59 #include "public/platform/WebThread.h" | 60 #include "public/platform/WebThread.h" |
| 60 #include "wtf/AddressSanitizer.h" | 61 #include "wtf/AddressSanitizer.h" |
| 61 #include "wtf/ArrayBufferContents.h" | 62 #include "wtf/ArrayBufferContents.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } | 382 } |
| 382 | 383 |
| 383 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); | 384 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); |
| 384 | 385 |
| 385 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) | 386 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) |
| 386 profiler->SetWrapperClassInfoProvider(WrapperTypeInfo::NodeClassId, &Ret
ainedDOMInfo::createRetainedDOMInfo); | 387 profiler->SetWrapperClassInfoProvider(WrapperTypeInfo::NodeClassId, &Ret
ainedDOMInfo::createRetainedDOMInfo); |
| 387 | 388 |
| 388 ASSERT(ThreadState::mainThreadState()); | 389 ASSERT(ThreadState::mainThreadState()); |
| 389 ThreadState::mainThreadState()->addInterruptor(adoptPtr(new V8IsolateInterru
ptor(isolate))); | 390 ThreadState::mainThreadState()->addInterruptor(adoptPtr(new V8IsolateInterru
ptor(isolate))); |
| 390 ThreadState::mainThreadState()->registerTraceDOMWrappers(isolate, V8GCContro
ller::traceDOMWrappers); | 391 ThreadState::mainThreadState()->registerTraceDOMWrappers(isolate, V8GCContro
ller::traceDOMWrappers); |
| 392 |
| 393 V8PerIsolateData::from(isolate)->setThreadDebugger(adoptPtr(new MainThreadDe
bugger(isolate))); |
| 391 } | 394 } |
| 392 | 395 |
| 393 void V8Initializer::shutdownMainThread() | 396 void V8Initializer::shutdownMainThread() |
| 394 { | 397 { |
| 395 ASSERT(isMainThread()); | 398 ASSERT(isMainThread()); |
| 396 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); | 399 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); |
| 397 V8PerIsolateData::willBeDestroyed(isolate); | 400 V8PerIsolateData::willBeDestroyed(isolate); |
| 398 V8PerIsolateData::destroy(isolate); | 401 V8PerIsolateData::destroy(isolate); |
| 399 } | 402 } |
| 400 | 403 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 | 456 |
| 454 isolate->AddMessageListener(messageHandlerInWorker); | 457 isolate->AddMessageListener(messageHandlerInWorker); |
| 455 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 458 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
| 456 | 459 |
| 457 uint32_t here; | 460 uint32_t here; |
| 458 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 461 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
| 459 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 462 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 460 } | 463 } |
| 461 | 464 |
| 462 } // namespace blink | 465 } // namespace blink |
| OLD | NEW |