| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 v8::V8::AddGCEpilogueCallback(V8GCController::gcEpilogue); | 360 v8::V8::AddGCEpilogueCallback(V8GCController::gcEpilogue); |
| 361 | 361 |
| 362 v8::Debug::SetLiveEditEnabled(isolate, false); | 362 v8::Debug::SetLiveEditEnabled(isolate, false); |
| 363 | 363 |
| 364 isolate->SetAutorunMicrotasks(false); | 364 isolate->SetAutorunMicrotasks(false); |
| 365 } | 365 } |
| 366 | 366 |
| 367 namespace { | 367 namespace { |
| 368 | 368 |
| 369 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | 369 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
| 370 virtual void* Allocate(size_t size) override | 370 void* Allocate(size_t size) override |
| 371 { | 371 { |
| 372 void* data; | 372 void* data; |
| 373 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:ZeroInitialize, data); | 373 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:ZeroInitialize, data); |
| 374 return data; | 374 return data; |
| 375 } | 375 } |
| 376 | 376 |
| 377 virtual void* AllocateUninitialized(size_t size) override | 377 void* AllocateUninitialized(size_t size) override |
| 378 { | 378 { |
| 379 void* data; | 379 void* data; |
| 380 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:DontInitialize, data); | 380 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:DontInitialize, data); |
| 381 return data; | 381 return data; |
| 382 } | 382 } |
| 383 | 383 |
| 384 virtual void Free(void* data, size_t size) override | 384 void Free(void* data, size_t size) override |
| 385 { | 385 { |
| 386 WTF::ArrayBufferContents::freeMemory(data, size); | 386 WTF::ArrayBufferContents::freeMemory(data, size); |
| 387 } | 387 } |
| 388 }; | 388 }; |
| 389 | 389 |
| 390 } // namespace | 390 } // namespace |
| 391 | 391 |
| 392 void V8Initializer::initializeMainThreadIfNeeded() | 392 void V8Initializer::initializeMainThreadIfNeeded() |
| 393 { | 393 { |
| 394 ASSERT(isMainThread()); | 394 ASSERT(isMainThread()); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 | 474 |
| 475 v8::V8::AddMessageListener(messageHandlerInWorker); | 475 v8::V8::AddMessageListener(messageHandlerInWorker); |
| 476 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); | 476 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); |
| 477 | 477 |
| 478 uint32_t here; | 478 uint32_t here; |
| 479 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 479 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
| 480 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 480 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 481 } | 481 } |
| 482 | 482 |
| 483 } // namespace blink | 483 } // namespace blink |
| OLD | NEW |