| 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 void V8Initializer::initializeMainThreadIfNeeded() | 378 void V8Initializer::initializeMainThreadIfNeeded() |
| 379 { | 379 { |
| 380 ASSERT(isMainThread()); | 380 ASSERT(isMainThread()); |
| 381 | 381 |
| 382 static bool initialized = false; | 382 static bool initialized = false; |
| 383 if (initialized) | 383 if (initialized) |
| 384 return; | 384 return; |
| 385 initialized = true; | 385 initialized = true; |
| 386 | 386 |
| 387 DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ()); | 387 DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ()); |
| 388 gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, &arrayBuf
ferAllocator); | 388 auto v8ExtrasMode = RuntimeEnabledFeatures::experimentalV8ExtrasEnabled() ?
gin::IsolateHolder::kExperimentalV8Extras : gin::IsolateHolder::kStableV8Extras; |
| 389 gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, v8ExtrasM
ode, &arrayBufferAllocator); |
| 389 | 390 |
| 390 v8::Isolate* isolate = V8PerIsolateData::initialize(); | 391 v8::Isolate* isolate = V8PerIsolateData::initialize(); |
| 391 | 392 |
| 392 initializeV8Common(isolate); | 393 initializeV8Common(isolate); |
| 393 | 394 |
| 394 v8::V8::SetFatalErrorHandler(reportFatalErrorInMainThread); | 395 v8::V8::SetFatalErrorHandler(reportFatalErrorInMainThread); |
| 395 v8::V8::AddMessageListener(messageHandlerInMainThread); | 396 v8::V8::AddMessageListener(messageHandlerInMainThread); |
| 396 v8::V8::SetFailedAccessCheckCallbackFunction(failedAccessCheckCallbackInMain
Thread); | 397 v8::V8::SetFailedAccessCheckCallbackFunction(failedAccessCheckCallbackInMain
Thread); |
| 397 v8::V8::SetAllowCodeGenerationFromStringsCallback(codeGenerationCheckCallbac
kInMainThread); | 398 v8::V8::SetAllowCodeGenerationFromStringsCallback(codeGenerationCheckCallbac
kInMainThread); |
| 398 | 399 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 | 464 |
| 464 v8::V8::AddMessageListener(messageHandlerInWorker); | 465 v8::V8::AddMessageListener(messageHandlerInWorker); |
| 465 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); | 466 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); |
| 466 | 467 |
| 467 uint32_t here; | 468 uint32_t here; |
| 468 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 469 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
| 469 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 470 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 470 } | 471 } |
| 471 | 472 |
| 472 } // namespace blink | 473 } // namespace blink |
| OLD | NEW |