| 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 isolate->SetOOMErrorHandler(reportOOMErrorInMainThread); | 400 isolate->SetOOMErrorHandler(reportOOMErrorInMainThread); |
| 401 isolate->SetFatalErrorHandler(reportFatalErrorInMainThread); | 401 isolate->SetFatalErrorHandler(reportFatalErrorInMainThread); |
| 402 isolate->AddMessageListener(messageHandlerInMainThread); | 402 isolate->AddMessageListener(messageHandlerInMainThread); |
| 403 isolate->SetFailedAccessCheckCallbackFunction( | 403 isolate->SetFailedAccessCheckCallbackFunction( |
| 404 failedAccessCheckCallbackInMainThread); | 404 failedAccessCheckCallbackInMainThread); |
| 405 isolate->SetAllowCodeGenerationFromStringsCallback( | 405 isolate->SetAllowCodeGenerationFromStringsCallback( |
| 406 codeGenerationCheckCallbackInMainThread); | 406 codeGenerationCheckCallbackInMainThread); |
| 407 | 407 |
| 408 if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) { | 408 if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) { |
| 409 WebScheduler* scheduler = Platform::current()->currentThread()->scheduler(); | 409 WebScheduler* scheduler = Platform::current()->currentThread()->scheduler(); |
| 410 V8PerIsolateData::enableIdleTasks( | 410 V8PerIsolateData::enableIdleTasks(isolate, |
| 411 isolate, wrapUnique(new V8IdleTaskRunner(scheduler))); | 411 makeUnique<V8IdleTaskRunner>(scheduler)); |
| 412 } | 412 } |
| 413 | 413 |
| 414 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); | 414 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); |
| 415 | 415 |
| 416 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) | 416 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) |
| 417 profiler->SetWrapperClassInfoProvider( | 417 profiler->SetWrapperClassInfoProvider( |
| 418 WrapperTypeInfo::NodeClassId, &RetainedDOMInfo::createRetainedDOMInfo); | 418 WrapperTypeInfo::NodeClassId, &RetainedDOMInfo::createRetainedDOMInfo); |
| 419 | 419 |
| 420 ASSERT(ThreadState::mainThreadState()); | 420 ASSERT(ThreadState::mainThreadState()); |
| 421 ThreadState::mainThreadState()->addInterruptor( | 421 ThreadState::mainThreadState()->addInterruptor( |
| 422 wrapUnique(new V8IsolateInterruptor(isolate))); | 422 makeUnique<V8IsolateInterruptor>(isolate)); |
| 423 if (RuntimeEnabledFeatures::traceWrappablesEnabled()) { | 423 if (RuntimeEnabledFeatures::traceWrappablesEnabled()) { |
| 424 ThreadState::mainThreadState()->registerTraceDOMWrappers( | 424 ThreadState::mainThreadState()->registerTraceDOMWrappers( |
| 425 isolate, V8GCController::traceDOMWrappers, | 425 isolate, V8GCController::traceDOMWrappers, |
| 426 ScriptWrappableVisitor::invalidateDeadObjectsInMarkingDeque, | 426 ScriptWrappableVisitor::invalidateDeadObjectsInMarkingDeque, |
| 427 ScriptWrappableVisitor::performCleanup); | 427 ScriptWrappableVisitor::performCleanup); |
| 428 } else { | 428 } else { |
| 429 ThreadState::mainThreadState()->registerTraceDOMWrappers( | 429 ThreadState::mainThreadState()->registerTraceDOMWrappers( |
| 430 isolate, V8GCController::traceDOMWrappers, nullptr, nullptr); | 430 isolate, V8GCController::traceDOMWrappers, nullptr, nullptr); |
| 431 } | 431 } |
| 432 | 432 |
| 433 V8PerIsolateData::from(isolate)->setThreadDebugger( | 433 V8PerIsolateData::from(isolate)->setThreadDebugger( |
| 434 wrapUnique(new MainThreadDebugger(isolate))); | 434 makeUnique<MainThreadDebugger>(isolate)); |
| 435 } | 435 } |
| 436 | 436 |
| 437 void V8Initializer::shutdownMainThread() { | 437 void V8Initializer::shutdownMainThread() { |
| 438 ASSERT(isMainThread()); | 438 ASSERT(isMainThread()); |
| 439 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); | 439 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); |
| 440 V8PerIsolateData::willBeDestroyed(isolate); | 440 V8PerIsolateData::willBeDestroyed(isolate); |
| 441 V8PerIsolateData::destroy(isolate); | 441 V8PerIsolateData::destroy(isolate); |
| 442 } | 442 } |
| 443 | 443 |
| 444 static void reportFatalErrorInWorker(const char* location, | 444 static void reportFatalErrorInWorker(const char* location, |
| (...skipping 56 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 |