| 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 13 matching lines...) Expand all Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |