| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 { | 145 { |
| 146 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size); | 146 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void initializeWithoutV8(Platform* platform) | 149 void initializeWithoutV8(Platform* platform) |
| 150 { | 150 { |
| 151 ASSERT(!s_webKitInitialized); | 151 ASSERT(!s_webKitInitialized); |
| 152 s_webKitInitialized = true; | 152 s_webKitInitialized = true; |
| 153 | 153 |
| 154 WTF::Partitions::initialize(maxObservedSizeFunction); | 154 WTF::Partitions::initialize(maxObservedSizeFunction); |
| 155 WTF::initialize(adjustAmountOfExternalAllocatedMemory); |
| 156 WTF::initializeMainThread(callOnMainThreadFunction); |
| 157 |
| 155 ASSERT(platform); | 158 ASSERT(platform); |
| 156 Platform::initialize(platform); | 159 Platform::initialize(platform); |
| 157 | |
| 158 WTF::initialize(adjustAmountOfExternalAllocatedMemory); | |
| 159 WTF::initializeMainThread(callOnMainThreadFunction); | |
| 160 Heap::init(); | 160 Heap::init(); |
| 161 | 161 |
| 162 ThreadState::attachMainThread(); | 162 ThreadState::attachMainThread(); |
| 163 // currentThread() is null if we are running on a thread without a message l
oop. | 163 // currentThread() is null if we are running on a thread without a message l
oop. |
| 164 if (WebThread* currentThread = platform->currentThread()) { | 164 if (WebThread* currentThread = platform->currentThread()) { |
| 165 ASSERT(!s_gcTaskRunner); | 165 ASSERT(!s_gcTaskRunner); |
| 166 s_gcTaskRunner = new GCTaskRunner(currentThread); | 166 s_gcTaskRunner = new GCTaskRunner(currentThread); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 delete s_gcTaskRunner; | 216 delete s_gcTaskRunner; |
| 217 s_gcTaskRunner = nullptr; | 217 s_gcTaskRunner = nullptr; |
| 218 } | 218 } |
| 219 | 219 |
| 220 // Detach the main thread before starting the shutdown sequence | 220 // Detach the main thread before starting the shutdown sequence |
| 221 // so that the main thread won't get involved in a GC during the shutdown. | 221 // so that the main thread won't get involved in a GC during the shutdown. |
| 222 ThreadState::detachMainThread(); | 222 ThreadState::detachMainThread(); |
| 223 | 223 |
| 224 ASSERT(!s_endOfTaskRunner); | 224 ASSERT(!s_endOfTaskRunner); |
| 225 Heap::shutdown(); | 225 Heap::shutdown(); |
| 226 Platform::shutdown(); |
| 227 |
| 226 WTF::shutdown(); | 228 WTF::shutdown(); |
| 227 Platform::shutdown(); | |
| 228 WebPrerenderingSupport::shutdown(); | 229 WebPrerenderingSupport::shutdown(); |
| 229 WTF::Partitions::shutdown(); | 230 WTF::Partitions::shutdown(); |
| 230 } | 231 } |
| 231 | 232 |
| 232 // TODO(tkent): The following functions to wrap LayoutTestSupport should be | 233 // TODO(tkent): The following functions to wrap LayoutTestSupport should be |
| 233 // moved to public/platform/. | 234 // moved to public/platform/. |
| 234 | 235 |
| 235 void setLayoutTestMode(bool value) | 236 void setLayoutTestMode(bool value) |
| 236 { | 237 { |
| 237 LayoutTestSupport::setIsRunningLayoutTest(value); | 238 LayoutTestSupport::setIsRunningLayoutTest(value); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 ASSERT(!reloadPages); | 282 ASSERT(!reloadPages); |
| 282 Page::refreshPlugins(); | 283 Page::refreshPlugins(); |
| 283 } | 284 } |
| 284 | 285 |
| 285 void decommitFreeableMemory() | 286 void decommitFreeableMemory() |
| 286 { | 287 { |
| 287 WTF::Partitions::decommitFreeableMemory(); | 288 WTF::Partitions::decommitFreeableMemory(); |
| 288 } | 289 } |
| 289 | 290 |
| 290 } // namespace blink | 291 } // namespace blink |
| OLD | NEW |