Chromium Code Reviews| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 | 396 |
| 397 WTF::ArrayBufferContents::initialize(adjustAmountOfExternalAllocatedMemory); | 397 WTF::ArrayBufferContents::initialize(adjustAmountOfExternalAllocatedMemory); |
| 398 | 398 |
| 399 DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ()); | 399 DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ()); |
| 400 auto v8ExtrasMode = RuntimeEnabledFeatures::experimentalV8ExtrasEnabled() | 400 auto v8ExtrasMode = RuntimeEnabledFeatures::experimentalV8ExtrasEnabled() |
| 401 ? gin::IsolateHolder::kStableAndExperimentalV8Extras | 401 ? gin::IsolateHolder::kStableAndExperimentalV8Extras |
| 402 : gin::IsolateHolder::kStableV8Extras; | 402 : gin::IsolateHolder::kStableV8Extras; |
| 403 gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, | 403 gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, |
| 404 v8ExtrasMode, &arrayBufferAllocator); | 404 v8ExtrasMode, &arrayBufferAllocator); |
| 405 | 405 |
| 406 v8::Isolate* isolate = V8PerIsolateData::initialize(); | 406 WebScheduler* scheduler = Platform::current()->currentThread()->scheduler(); |
| 407 v8::Isolate* isolate = | |
| 408 V8PerIsolateData::initialize(scheduler->timerTaskRunner()); | |
|
Ken Rockot(use gerrit already)
2017/01/10 22:20:23
I would be surprised if we aren't seeing crashes i
| |
| 407 | 409 |
| 408 initializeV8Common(isolate); | 410 initializeV8Common(isolate); |
| 409 | 411 |
| 410 isolate->SetOOMErrorHandler(reportOOMErrorInMainThread); | 412 isolate->SetOOMErrorHandler(reportOOMErrorInMainThread); |
| 411 isolate->SetFatalErrorHandler(reportFatalErrorInMainThread); | 413 isolate->SetFatalErrorHandler(reportFatalErrorInMainThread); |
| 412 isolate->AddMessageListenerWithErrorLevel( | 414 isolate->AddMessageListenerWithErrorLevel( |
| 413 messageHandlerInMainThread, | 415 messageHandlerInMainThread, |
| 414 v8::Isolate::kMessageError | v8::Isolate::kMessageWarning | | 416 v8::Isolate::kMessageError | v8::Isolate::kMessageWarning | |
| 415 v8::Isolate::kMessageInfo | v8::Isolate::kMessageDebug | | 417 v8::Isolate::kMessageInfo | v8::Isolate::kMessageDebug | |
| 416 v8::Isolate::kMessageLog); | 418 v8::Isolate::kMessageLog); |
| 417 isolate->SetFailedAccessCheckCallbackFunction( | 419 isolate->SetFailedAccessCheckCallbackFunction( |
| 418 failedAccessCheckCallbackInMainThread); | 420 failedAccessCheckCallbackInMainThread); |
| 419 isolate->SetAllowCodeGenerationFromStringsCallback( | 421 isolate->SetAllowCodeGenerationFromStringsCallback( |
| 420 codeGenerationCheckCallbackInMainThread); | 422 codeGenerationCheckCallbackInMainThread); |
| 421 | 423 |
| 422 if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) { | 424 if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) { |
| 423 WebScheduler* scheduler = Platform::current()->currentThread()->scheduler(); | |
| 424 V8PerIsolateData::enableIdleTasks( | 425 V8PerIsolateData::enableIdleTasks( |
| 425 isolate, WTF::makeUnique<V8IdleTaskRunner>(scheduler)); | 426 isolate, WTF::makeUnique<V8IdleTaskRunner>(scheduler)); |
| 426 } | 427 } |
| 427 | 428 |
| 428 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); | 429 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); |
| 429 | 430 |
| 430 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) | 431 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) |
| 431 profiler->SetWrapperClassInfoProvider( | 432 profiler->SetWrapperClassInfoProvider( |
| 432 WrapperTypeInfo::NodeClassId, &RetainedDOMInfo::createRetainedDOMInfo); | 433 WrapperTypeInfo::NodeClassId, &RetainedDOMInfo::createRetainedDOMInfo); |
| 433 | 434 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 531 v8::Isolate::kMessageLog); | 532 v8::Isolate::kMessageLog); |
| 532 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 533 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
| 533 | 534 |
| 534 uint32_t here; | 535 uint32_t here; |
| 535 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - | 536 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - |
| 536 kWorkerMaxStackSize); | 537 kWorkerMaxStackSize); |
| 537 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 538 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 538 } | 539 } |
| 539 | 540 |
| 540 } // namespace blink | 541 } // namespace blink |
| OLD | NEW |