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

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

Issue 2610853002: [wrapper-tracing] Enable cleanup and invalidating on WorkerBackingThread (Closed)
Patch Set: Address comment 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 417
418 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); 418 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread);
419 419
420 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) 420 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler())
421 profiler->SetWrapperClassInfoProvider( 421 profiler->SetWrapperClassInfoProvider(
422 WrapperTypeInfo::NodeClassId, &RetainedDOMInfo::createRetainedDOMInfo); 422 WrapperTypeInfo::NodeClassId, &RetainedDOMInfo::createRetainedDOMInfo);
423 423
424 ASSERT(ThreadState::mainThreadState()); 424 ASSERT(ThreadState::mainThreadState());
425 ThreadState::mainThreadState()->addInterruptor( 425 ThreadState::mainThreadState()->addInterruptor(
426 WTF::makeUnique<V8IsolateInterruptor>(isolate)); 426 WTF::makeUnique<V8IsolateInterruptor>(isolate));
427 if (RuntimeEnabledFeatures::traceWrappablesEnabled()) { 427 ThreadState::mainThreadState()->registerTraceDOMWrappers(
428 ThreadState::mainThreadState()->registerTraceDOMWrappers( 428 isolate, V8GCController::traceDOMWrappers,
429 isolate, V8GCController::traceDOMWrappers, 429 ScriptWrappableVisitor::invalidateDeadObjectsInMarkingDeque,
430 ScriptWrappableVisitor::invalidateDeadObjectsInMarkingDeque, 430 ScriptWrappableVisitor::performCleanup);
431 ScriptWrappableVisitor::performCleanup);
432 } else {
433 ThreadState::mainThreadState()->registerTraceDOMWrappers(
434 isolate, V8GCController::traceDOMWrappers, nullptr, nullptr);
435 }
436 431
437 V8PerIsolateData::from(isolate)->setThreadDebugger( 432 V8PerIsolateData::from(isolate)->setThreadDebugger(
438 WTF::makeUnique<MainThreadDebugger>(isolate)); 433 WTF::makeUnique<MainThreadDebugger>(isolate));
439 } 434 }
440 435
441 void V8Initializer::shutdownMainThread() { 436 void V8Initializer::shutdownMainThread() {
442 ASSERT(isMainThread()); 437 ASSERT(isMainThread());
443 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); 438 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate();
444 V8PerIsolateData::willBeDestroyed(isolate); 439 V8PerIsolateData::willBeDestroyed(isolate);
445 V8PerIsolateData::destroy(isolate); 440 V8PerIsolateData::destroy(isolate);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 v8::Isolate::kMessageLog); 516 v8::Isolate::kMessageLog);
522 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); 517 isolate->SetFatalErrorHandler(reportFatalErrorInWorker);
523 518
524 uint32_t here; 519 uint32_t here;
525 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - 520 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) -
526 kWorkerMaxStackSize); 521 kWorkerMaxStackSize);
527 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); 522 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker);
528 } 523 }
529 524
530 } // namespace blink 525 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698