| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "core/dom/ExceptionCode.h" | 46 #include "core/dom/ExceptionCode.h" |
| 47 #include "core/fetch/AccessControlStatus.h" | 47 #include "core/fetch/AccessControlStatus.h" |
| 48 #include "core/frame/ConsoleTypes.h" | 48 #include "core/frame/ConsoleTypes.h" |
| 49 #include "core/frame/LocalDOMWindow.h" | 49 #include "core/frame/LocalDOMWindow.h" |
| 50 #include "core/frame/LocalFrame.h" | 50 #include "core/frame/LocalFrame.h" |
| 51 #include "core/frame/csp/ContentSecurityPolicy.h" | 51 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 52 #include "core/inspector/ScriptArguments.h" | 52 #include "core/inspector/ScriptArguments.h" |
| 53 #include "core/inspector/ScriptCallStack.h" | 53 #include "core/inspector/ScriptCallStack.h" |
| 54 #include "core/workers/WorkerGlobalScope.h" | 54 #include "core/workers/WorkerGlobalScope.h" |
| 55 #include "platform/EventDispatchForbiddenScope.h" | 55 #include "platform/EventDispatchForbiddenScope.h" |
| 56 #include "platform/MemoryUsageProvider.h" |
| 56 #include "platform/RuntimeEnabledFeatures.h" | 57 #include "platform/RuntimeEnabledFeatures.h" |
| 57 #include "platform/TraceEvent.h" | 58 #include "platform/TraceEvent.h" |
| 58 #include "public/platform/Platform.h" | 59 #include "public/platform/Platform.h" |
| 59 #include "public/platform/WebScheduler.h" | 60 #include "public/platform/WebScheduler.h" |
| 60 #include "public/platform/WebThread.h" | 61 #include "public/platform/WebThread.h" |
| 61 #include "wtf/AddressSanitizer.h" | 62 #include "wtf/AddressSanitizer.h" |
| 62 #include "wtf/ArrayBufferContents.h" | 63 #include "wtf/ArrayBufferContents.h" |
| 63 #include "wtf/RefPtr.h" | 64 #include "wtf/RefPtr.h" |
| 64 #include "wtf/text/WTFString.h" | 65 #include "wtf/text/WTFString.h" |
| 65 #include <v8-debug.h> | 66 #include <v8-debug.h> |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 323 | 324 |
| 324 v8::Debug::SetLiveEditEnabled(isolate, false); | 325 v8::Debug::SetLiveEditEnabled(isolate, false); |
| 326 MemoryUsageProvider::instance()->setIsolate(isolate); |
| 325 | 327 |
| 326 isolate->SetAutorunMicrotasks(false); | 328 isolate->SetAutorunMicrotasks(false); |
| 327 } | 329 } |
| 328 | 330 |
| 329 namespace { | 331 namespace { |
| 330 | 332 |
| 331 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | 333 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
| 332 // Allocate() methods return null to signal allocation failure to V8, which
should respond by throwing | 334 // Allocate() methods return null to signal allocation failure to V8, which
should respond by throwing |
| 333 // a RangeError, per http://www.ecma-international.org/ecma-262/6.0/#sec-cre
atebytedatablock. | 335 // a RangeError, per http://www.ecma-international.org/ecma-262/6.0/#sec-cre
atebytedatablock. |
| 334 void* Allocate(size_t size) override | 336 void* Allocate(size_t size) override |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 | 443 |
| 442 isolate->AddMessageListener(messageHandlerInWorker); | 444 isolate->AddMessageListener(messageHandlerInWorker); |
| 443 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 445 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
| 444 | 446 |
| 445 uint32_t here; | 447 uint32_t here; |
| 446 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 448 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
| 447 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 449 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 448 } | 450 } |
| 449 | 451 |
| 450 } // namespace blink | 452 } // namespace blink |
| OLD | NEW |