Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp

Issue 2624033002: Tolerate a null WebScheduler in utility process V8 initialization (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 WTF::ArrayBufferContents::initialize(adjustAmountOfExternalAllocatedMemory); 386 WTF::ArrayBufferContents::initialize(adjustAmountOfExternalAllocatedMemory);
387 387
388 DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ()); 388 DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ());
389 auto v8ExtrasMode = RuntimeEnabledFeatures::experimentalV8ExtrasEnabled() 389 auto v8ExtrasMode = RuntimeEnabledFeatures::experimentalV8ExtrasEnabled()
390 ? gin::IsolateHolder::kStableAndExperimentalV8Extras 390 ? gin::IsolateHolder::kStableAndExperimentalV8Extras
391 : gin::IsolateHolder::kStableV8Extras; 391 : gin::IsolateHolder::kStableV8Extras;
392 gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, 392 gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
393 v8ExtrasMode, &arrayBufferAllocator); 393 v8ExtrasMode, &arrayBufferAllocator);
394 394
395 // NOTE: Some threads don't have a scheduler.
haraken 2017/01/10 23:56:58 Clarify what the threads are.
Ken Rockot(use gerrit already) 2017/01/11 00:22:39 done
395 WebScheduler* scheduler = Platform::current()->currentThread()->scheduler(); 396 WebScheduler* scheduler = Platform::current()->currentThread()->scheduler();
396 v8::Isolate* isolate = 397 v8::Isolate* isolate = V8PerIsolateData::initialize(
397 V8PerIsolateData::initialize(scheduler->timerTaskRunner()); 398 scheduler ? scheduler->timerTaskRunner() : nullptr);
haraken 2017/01/10 23:56:58 I'd prefer passing Platform::current()->currentThr
Ken Rockot(use gerrit already) 2017/01/11 00:22:39 done (getWebTaskRunner)
398 399
399 initializeV8Common(isolate); 400 initializeV8Common(isolate);
400 401
401 isolate->SetOOMErrorHandler(reportOOMErrorInMainThread); 402 isolate->SetOOMErrorHandler(reportOOMErrorInMainThread);
402 isolate->SetFatalErrorHandler(reportFatalErrorInMainThread); 403 isolate->SetFatalErrorHandler(reportFatalErrorInMainThread);
403 isolate->AddMessageListenerWithErrorLevel( 404 isolate->AddMessageListenerWithErrorLevel(
404 messageHandlerInMainThread, 405 messageHandlerInMainThread,
405 v8::Isolate::kMessageError | v8::Isolate::kMessageWarning | 406 v8::Isolate::kMessageError | v8::Isolate::kMessageWarning |
406 v8::Isolate::kMessageInfo | v8::Isolate::kMessageDebug | 407 v8::Isolate::kMessageInfo | v8::Isolate::kMessageDebug |
407 v8::Isolate::kMessageLog); 408 v8::Isolate::kMessageLog);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 v8::Isolate::kMessageLog); 517 v8::Isolate::kMessageLog);
517 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); 518 isolate->SetFatalErrorHandler(reportFatalErrorInWorker);
518 519
519 uint32_t here; 520 uint32_t here;
520 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - 521 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) -
521 kWorkerMaxStackSize); 522 kWorkerMaxStackSize);
522 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); 523 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker);
523 } 524 }
524 525
525 } // namespace blink 526 } // namespace blink
OLDNEW
« no previous file with comments | « gin/per_isolate_data.cc ('k') | third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698