| 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 29 matching lines...) Expand all Loading... |
| 40 #include "bindings/v8/V8GCController.h" | 40 #include "bindings/v8/V8GCController.h" |
| 41 #include "bindings/v8/V8HiddenPropertyName.h" | 41 #include "bindings/v8/V8HiddenPropertyName.h" |
| 42 #include "bindings/v8/V8PerContextData.h" | 42 #include "bindings/v8/V8PerContextData.h" |
| 43 #include "core/dom/Document.h" | 43 #include "core/dom/Document.h" |
| 44 #include "core/dom/ExceptionCode.h" | 44 #include "core/dom/ExceptionCode.h" |
| 45 #include "core/inspector/ScriptCallStack.h" | 45 #include "core/inspector/ScriptCallStack.h" |
| 46 #include "core/frame/ConsoleTypes.h" | 46 #include "core/frame/ConsoleTypes.h" |
| 47 #include "core/frame/ContentSecurityPolicy.h" | 47 #include "core/frame/ContentSecurityPolicy.h" |
| 48 #include "core/frame/DOMWindow.h" | 48 #include "core/frame/DOMWindow.h" |
| 49 #include "core/frame/Frame.h" | 49 #include "core/frame/Frame.h" |
| 50 #include "core/platform/MemoryUsageSupport.h" | 50 #include "public/platform/Platform.h" |
| 51 #include "wtf/RefPtr.h" | 51 #include "wtf/RefPtr.h" |
| 52 #include "wtf/text/WTFString.h" | 52 #include "wtf/text/WTFString.h" |
| 53 #include <v8-debug.h> | 53 #include <v8-debug.h> |
| 54 #include <v8-defaults.h> | 54 #include <v8-defaults.h> |
| 55 | 55 |
| 56 namespace WebCore { | 56 namespace WebCore { |
| 57 | 57 |
| 58 static Frame* findFrame(v8::Local<v8::Object> host, v8::Local<v8::Value> data, v
8::Isolate* isolate) | 58 static Frame* findFrame(v8::Local<v8::Object> host, v8::Local<v8::Value> data, v
8::Isolate* isolate) |
| 59 { | 59 { |
| 60 const WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data); | 60 const WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 72 if (V8Location::wrapperTypeInfo.equals(type)) | 72 if (V8Location::wrapperTypeInfo.equals(type)) |
| 73 return V8Location::toNative(host)->frame(); | 73 return V8Location::toNative(host)->frame(); |
| 74 | 74 |
| 75 // This function can handle only those types listed above. | 75 // This function can handle only those types listed above. |
| 76 ASSERT_NOT_REACHED(); | 76 ASSERT_NOT_REACHED(); |
| 77 return 0; | 77 return 0; |
| 78 } | 78 } |
| 79 | 79 |
| 80 static void reportFatalErrorInMainThread(const char* location, const char* messa
ge) | 80 static void reportFatalErrorInMainThread(const char* location, const char* messa
ge) |
| 81 { | 81 { |
| 82 int memoryUsageMB = MemoryUsageSupport::actualMemoryUsageMB(); | 82 int memoryUsageMB = WebKit::Platform::current()->actualMemoryUsageMB(); |
| 83 printf("V8 error: %s (%s). Current memory usage: %d MB\n", message, locatio
n, memoryUsageMB); | 83 printf("V8 error: %s (%s). Current memory usage: %d MB\n", message, locatio
n, memoryUsageMB); |
| 84 CRASH(); | 84 CRASH(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Hand
le<v8::Value> data) | 87 static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Hand
le<v8::Value> data) |
| 88 { | 88 { |
| 89 // If called during context initialization, there will be no entered context
. | 89 // If called during context initialization, there will be no entered context
. |
| 90 v8::Handle<v8::Context> enteredContext = v8::Context::GetEntered(); | 90 v8::Handle<v8::Context> enteredContext = v8::Context::GetEntered(); |
| 91 if (enteredContext.IsEmpty()) | 91 if (enteredContext.IsEmpty()) |
| 92 return; | 92 return; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 v8::ResourceConstraints resourceConstraints; | 220 v8::ResourceConstraints resourceConstraints; |
| 221 v8::ConfigureResourceConstraintsForCurrentPlatform(&resourceConstraints); | 221 v8::ConfigureResourceConstraintsForCurrentPlatform(&resourceConstraints); |
| 222 uint32_t here; | 222 uint32_t here; |
| 223 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); | 223 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); |
| 224 v8::SetResourceConstraints(&resourceConstraints); | 224 v8::SetResourceConstraints(&resourceConstraints); |
| 225 | 225 |
| 226 V8PerIsolateData::ensureInitialized(isolate); | 226 V8PerIsolateData::ensureInitialized(isolate); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace WebCore | 229 } // namespace WebCore |
| OLD | NEW |