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

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: Use newer v8 api 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 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #include "bindings/core/v8/V8Initializer.h" 26 #include "bindings/core/v8/V8Initializer.h"
27 27
28 #include "bindings/core/v8/DOMWrapperWorld.h" 28 #include "bindings/core/v8/DOMWrapperWorld.h"
29 #include "bindings/core/v8/RejectedPromises.h" 29 #include "bindings/core/v8/RejectedPromises.h"
30 #include "bindings/core/v8/RetainedDOMInfo.h" 30 #include "bindings/core/v8/RetainedDOMInfo.h"
31 #include "bindings/core/v8/ScriptCallStack.h" 31 #include "bindings/core/v8/ScriptCallStack.h"
32 #include "bindings/core/v8/ScriptController.h" 32 #include "bindings/core/v8/ScriptController.h"
33 #include "bindings/core/v8/ScriptValue.h" 33 #include "bindings/core/v8/ScriptValue.h"
34 #include "bindings/core/v8/ScriptWrappableHeapTracer.h"
34 #include "bindings/core/v8/V8Binding.h" 35 #include "bindings/core/v8/V8Binding.h"
35 #include "bindings/core/v8/V8DOMException.h" 36 #include "bindings/core/v8/V8DOMException.h"
36 #include "bindings/core/v8/V8ErrorEvent.h" 37 #include "bindings/core/v8/V8ErrorEvent.h"
37 #include "bindings/core/v8/V8ErrorHandler.h" 38 #include "bindings/core/v8/V8ErrorHandler.h"
38 #include "bindings/core/v8/V8GCController.h" 39 #include "bindings/core/v8/V8GCController.h"
39 #include "bindings/core/v8/V8History.h" 40 #include "bindings/core/v8/V8History.h"
40 #include "bindings/core/v8/V8IdleTaskRunner.h" 41 #include "bindings/core/v8/V8IdleTaskRunner.h"
41 #include "bindings/core/v8/V8Location.h" 42 #include "bindings/core/v8/V8Location.h"
42 #include "bindings/core/v8/V8PerContextData.h" 43 #include "bindings/core/v8/V8PerContextData.h"
43 #include "bindings/core/v8/V8Window.h" 44 #include "bindings/core/v8/V8Window.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten tSecurityPolicy()) 314 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten tSecurityPolicy())
314 return policy->allowEval(ScriptState::from(context), ContentSecurity Policy::SendReport, ContentSecurityPolicy::WillThrowException); 315 return policy->allowEval(ScriptState::from(context), ContentSecurity Policy::SendReport, ContentSecurityPolicy::WillThrowException);
315 } 316 }
316 return false; 317 return false;
317 } 318 }
318 319
319 static void initializeV8Common(v8::Isolate* isolate) 320 static void initializeV8Common(v8::Isolate* isolate)
320 { 321 {
321 isolate->AddGCPrologueCallback(V8GCController::gcPrologue); 322 isolate->AddGCPrologueCallback(V8GCController::gcPrologue);
322 isolate->AddGCEpilogueCallback(V8GCController::gcEpilogue); 323 isolate->AddGCEpilogueCallback(V8GCController::gcEpilogue);
324 if (RuntimeEnabledFeatures::traceWrappablesEnabled()) {
325 isolate->SetEmbedderHeapTracer(new ScriptWrappableHeapTracer());
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

Powered by Google App Engine
This is Rietveld 408576698