Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: Source/bindings/v8/V8Initializer.cpp

Issue 37503004: Remove MemoryUsageSupport (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove layer instead Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698