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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // we've ever seen. | 138 // we've ever seen. |
139 DEFINE_STATIC_LOCAL(EnumerationHistogram, committedSizeHistogram, ("Partitio
nAlloc.CommittedSize", supportedMaxSizeInMB)); | 139 DEFINE_STATIC_LOCAL(EnumerationHistogram, committedSizeHistogram, ("Partitio
nAlloc.CommittedSize", supportedMaxSizeInMB)); |
140 committedSizeHistogram.count(sizeInMB); | 140 committedSizeHistogram.count(sizeInMB); |
141 } | 141 } |
142 | 142 |
143 static void callOnMainThreadFunction(WTF::MainThreadFunction function, void* con
text) | 143 static void callOnMainThreadFunction(WTF::MainThreadFunction function, void* con
text) |
144 { | 144 { |
145 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_H
ERE, threadSafeBind(function, AllowCrossThreadAccess(context))); | 145 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_H
ERE, threadSafeBind(function, AllowCrossThreadAccess(context))); |
146 } | 146 } |
147 | 147 |
148 static void adjustAmountOfExternalAllocatedMemory(int size) | |
149 { | |
150 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size); | |
151 } | |
152 | |
153 void initializeWithoutV8(Platform* platform) | 148 void initializeWithoutV8(Platform* platform) |
154 { | 149 { |
155 ASSERT(!s_webKitInitialized); | 150 ASSERT(!s_webKitInitialized); |
156 s_webKitInitialized = true; | 151 s_webKitInitialized = true; |
157 | 152 |
158 WTF::Partitions::initialize(maxObservedSizeFunction); | 153 WTF::Partitions::initialize(maxObservedSizeFunction); |
159 ASSERT(platform); | 154 ASSERT(platform); |
160 Platform::initialize(platform); | 155 Platform::initialize(platform); |
161 | 156 |
162 WTF::initialize(adjustAmountOfExternalAllocatedMemory); | 157 WTF::initialize(); |
163 WTF::initializeMainThread(callOnMainThreadFunction); | 158 WTF::initializeMainThread(callOnMainThreadFunction); |
164 Heap::init(); | 159 Heap::init(); |
165 | 160 |
166 ThreadState::attachMainThread(); | 161 ThreadState::attachMainThread(); |
167 // currentThread() is null if we are running on a thread without a message l
oop. | 162 // currentThread() is null if we are running on a thread without a message l
oop. |
168 if (WebThread* currentThread = platform->currentThread()) { | 163 if (WebThread* currentThread = platform->currentThread()) { |
169 ASSERT(!s_gcTaskRunner); | 164 ASSERT(!s_gcTaskRunner); |
170 s_gcTaskRunner = new GCTaskRunner(currentThread); | 165 s_gcTaskRunner = new GCTaskRunner(currentThread); |
171 } | 166 } |
172 } | 167 } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 ASSERT(!reloadPages); | 282 ASSERT(!reloadPages); |
288 Page::refreshPlugins(); | 283 Page::refreshPlugins(); |
289 } | 284 } |
290 | 285 |
291 void decommitFreeableMemory() | 286 void decommitFreeableMemory() |
292 { | 287 { |
293 WTF::Partitions::decommitFreeableMemory(); | 288 WTF::Partitions::decommitFreeableMemory(); |
294 } | 289 } |
295 | 290 |
296 } // namespace blink | 291 } // namespace blink |
OLD | NEW |