Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp |
| index 35d5d5ee5cd59a950e9271c596e920f3a4513bbb..4a8adac5dc5288c29404a4f8add7cd74233ff13b 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp |
| @@ -95,7 +95,14 @@ static void reportFatalErrorInMainThread(const char* location, const char* messa |
| printf("V8 error: %s (%s). Current memory usage: %d MB\n", message, location, memoryUsageMB); |
| CRASH(); |
| } |
| - |
| +/* |
|
haraken
2016/07/11 23:06:35
Should this code be commented out?
Will Harris
2016/07/11 23:11:20
yeah I can't call this until the API exists in V8
|
| +static void reportOOMErrorInMainThread(const char* location, bool isJsHeap) |
| +{ |
| + int memoryUsageMB = Platform::current()->actualMemoryUsageMB(); |
| + printf("V8 %s OOM: (%s). Current memory usage: %d MB\n", isJsHeap ? "javascript" : "process", location, memoryUsageMB); |
| + OOM_CRASH(); |
| +} |
| +*/ |
| static String extractMessageForConsole(v8::Isolate* isolate, v8::Local<v8::Value> data) |
| { |
| if (V8DOMWrapper::isWrapper(isolate, data)) { |
| @@ -356,6 +363,7 @@ void V8Initializer::initializeMainThread() |
| initializeV8Common(isolate); |
| +// isolate->SetOOMErrorHandler(reportOOMErrorInMainThread); |
| isolate->SetFatalErrorHandler(reportFatalErrorInMainThread); |
| isolate->AddMessageListener(messageHandlerInMainThread); |
| isolate->SetFailedAccessCheckCallbackFunction(failedAccessCheckCallbackInMainThread); |