| 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) { | 371 if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) { |
| 372 WebScheduler* scheduler = Platform::current()->currentThread()->schedule
r(); | 372 WebScheduler* scheduler = Platform::current()->currentThread()->schedule
r(); |
| 373 V8PerIsolateData::enableIdleTasks(isolate, adoptPtr(new V8IdleTaskRunner
(scheduler))); | 373 V8PerIsolateData::enableIdleTasks(isolate, adoptPtr(new V8IdleTaskRunner
(scheduler))); |
| 374 } | 374 } |
| 375 | 375 |
| 376 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); | 376 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); |
| 377 | 377 |
| 378 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) | 378 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) |
| 379 profiler->SetWrapperClassInfoProvider(WrapperTypeInfo::NodeClassId, &Ret
ainedDOMInfo::createRetainedDOMInfo); | 379 profiler->SetWrapperClassInfoProvider(WrapperTypeInfo::NodeClassId, &Ret
ainedDOMInfo::createRetainedDOMInfo); |
| 380 |
| 381 ASSERT(ThreadState::current()); |
| 382 ThreadState::current()->addInterruptor(adoptPtr(new V8IsolateInterruptor(iso
late))); |
| 383 ThreadState::current()->registerTraceDOMWrappers(isolate, V8GCController::tr
aceDOMWrappers); |
| 380 } | 384 } |
| 381 | 385 |
| 382 void V8Initializer::shutdownMainThread() | 386 void V8Initializer::shutdownMainThread() |
| 383 { | 387 { |
| 384 ASSERT(isMainThread()); | 388 ASSERT(isMainThread()); |
| 389 ThreadState::current()->unregisterTraceDOMWrappers(); |
| 385 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); | 390 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); |
| 386 V8PerIsolateData::willBeDestroyed(isolate); | 391 V8PerIsolateData::willBeDestroyed(isolate); |
| 387 V8PerIsolateData::destroy(isolate); | 392 V8PerIsolateData::destroy(isolate); |
| 388 } | 393 } |
| 389 | 394 |
| 390 static void reportFatalErrorInWorker(const char* location, const char* message) | 395 static void reportFatalErrorInWorker(const char* location, const char* message) |
| 391 { | 396 { |
| 392 // FIXME: We temporarily deal with V8 internal error situations such as out-
of-memory by crashing the worker. | 397 // FIXME: We temporarily deal with V8 internal error situations such as out-
of-memory by crashing the worker. |
| 393 CRASH(); | 398 CRASH(); |
| 394 } | 399 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 | 447 |
| 443 isolate->AddMessageListener(messageHandlerInWorker); | 448 isolate->AddMessageListener(messageHandlerInWorker); |
| 444 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 449 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
| 445 | 450 |
| 446 uint32_t here; | 451 uint32_t here; |
| 447 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 452 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
| 448 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 453 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 449 } | 454 } |
| 450 | 455 |
| 451 } // namespace blink | 456 } // namespace blink |
| OLD | NEW |