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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 } | 344 } |
345 | 345 |
346 void Free(void* data, size_t size) override | 346 void Free(void* data, size_t size) override |
347 { | 347 { |
348 WTF::ArrayBufferContents::freeMemory(data, size); | 348 WTF::ArrayBufferContents::freeMemory(data, size); |
349 } | 349 } |
350 }; | 350 }; |
351 | 351 |
352 } // namespace | 352 } // namespace |
353 | 353 |
354 static void adjustAmountOfExternalAllocatedMemory(int size) | |
355 { | |
356 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size); | |
357 } | |
358 | |
354 void V8Initializer::initializeMainThread() | 359 void V8Initializer::initializeMainThread() |
355 { | 360 { |
356 ASSERT(isMainThread()); | 361 ASSERT(isMainThread()); |
357 | 362 |
363 WTF::ArrayBufferContents::setAdjustAmoutOfExternalAllocatedMemoryFunction(ad justAmountOfExternalAllocatedMemory); | |
sof
2016/03/09 13:08:38
Not a big deal, but worth bringing up -- would it
sof
2016/03/09 13:08:38
Not introduced here, but s/Amout/Amount/
haraken
2016/03/10 00:04:35
Done.
haraken
2016/03/10 00:04:35
Done.
| |
364 | |
358 DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ()); | 365 DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ()); |
359 auto v8ExtrasMode = RuntimeEnabledFeatures::experimentalV8ExtrasEnabled() ? gin::IsolateHolder::kStableAndExperimentalV8Extras : gin::IsolateHolder::kStable V8Extras; | 366 auto v8ExtrasMode = RuntimeEnabledFeatures::experimentalV8ExtrasEnabled() ? gin::IsolateHolder::kStableAndExperimentalV8Extras : gin::IsolateHolder::kStable V8Extras; |
360 gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, v8ExtrasM ode, &arrayBufferAllocator); | 367 gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, v8ExtrasM ode, &arrayBufferAllocator); |
361 | 368 |
362 v8::Isolate* isolate = V8PerIsolateData::initialize(); | 369 v8::Isolate* isolate = V8PerIsolateData::initialize(); |
363 | 370 |
364 initializeV8Common(isolate); | 371 initializeV8Common(isolate); |
365 | 372 |
366 isolate->SetFatalErrorHandler(reportFatalErrorInMainThread); | 373 isolate->SetFatalErrorHandler(reportFatalErrorInMainThread); |
367 isolate->AddMessageListener(messageHandlerInMainThread); | 374 isolate->AddMessageListener(messageHandlerInMainThread); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
442 | 449 |
443 isolate->AddMessageListener(messageHandlerInWorker); | 450 isolate->AddMessageListener(messageHandlerInWorker); |
444 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 451 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
445 | 452 |
446 uint32_t here; | 453 uint32_t here; |
447 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi ze / sizeof(uint32_t*))); | 454 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi ze / sizeof(uint32_t*))); |
448 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 455 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
449 } | 456 } |
450 | 457 |
451 } // namespace blink | 458 } // namespace blink |
OLD | NEW |