| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 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 |