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

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

Issue 1876383003: Introduce infrastructure for tracing ScriptWrappables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix var used only in assert Created 4 years, 8 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten tSecurityPolicy()) 313 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten tSecurityPolicy())
314 return policy->allowEval(ScriptState::from(context), ContentSecurity Policy::SendReport, ContentSecurityPolicy::WillThrowException); 314 return policy->allowEval(ScriptState::from(context), ContentSecurity Policy::SendReport, ContentSecurityPolicy::WillThrowException);
315 } 315 }
316 return false; 316 return false;
317 } 317 }
318 318
319 static void initializeV8Common(v8::Isolate* isolate) 319 static void initializeV8Common(v8::Isolate* isolate)
320 { 320 {
321 isolate->AddGCPrologueCallback(V8GCController::gcPrologue); 321 isolate->AddGCPrologueCallback(V8GCController::gcPrologue);
322 isolate->AddGCEpilogueCallback(V8GCController::gcEpilogue); 322 isolate->AddGCEpilogueCallback(V8GCController::gcEpilogue);
323 if (RuntimeEnabledFeatures::traceWrappablesEnabled()) {
324 ScriptWrappableVisitor* visitor = new ScriptWrappableVisitor(isolate);
325 isolate->SetEmbedderHeapTracer(visitor);
326 }
323 327
324 v8::Debug::SetLiveEditEnabled(isolate, false); 328 v8::Debug::SetLiveEditEnabled(isolate, false);
325 329
326 isolate->SetMicrotasksPolicy(v8::MicrotasksPolicy::kScoped); 330 isolate->SetMicrotasksPolicy(v8::MicrotasksPolicy::kScoped);
327 } 331 }
328 332
329 namespace { 333 namespace {
330 334
331 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { 335 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
332 // Allocate() methods return null to signal allocation failure to V8, which should respond by throwing 336 // Allocate() methods return null to signal allocation failure to V8, which should respond by throwing
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 461
458 isolate->AddMessageListener(messageHandlerInWorker); 462 isolate->AddMessageListener(messageHandlerInWorker);
459 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); 463 isolate->SetFatalErrorHandler(reportFatalErrorInWorker);
460 464
461 uint32_t here; 465 uint32_t here;
462 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi ze / sizeof(uint32_t*))); 466 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi ze / sizeof(uint32_t*)));
463 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); 467 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker);
464 } 468 }
465 469
466 } // namespace blink 470 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp ('k') | third_party/WebKit/Source/bindings/core/v8/v8.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698