| 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 20 matching lines...) Expand all Loading... |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "public/web/WebKit.h" | 32 #include "public/web/WebKit.h" |
| 33 | 33 |
| 34 #include "bindings/core/v8/ScriptStreamerThread.h" | 34 #include "bindings/core/v8/ScriptStreamerThread.h" |
| 35 #include "bindings/core/v8/V8Binding.h" | 35 #include "bindings/core/v8/V8Binding.h" |
| 36 #include "bindings/core/v8/V8GCController.h" | 36 #include "bindings/core/v8/V8GCController.h" |
| 37 #include "bindings/core/v8/V8Initializer.h" | 37 #include "bindings/core/v8/V8Initializer.h" |
| 38 #include "core/Init.h" | 38 #include "core/Init.h" |
| 39 #include "core/animation/AnimationClock.h" | 39 #include "core/animation/AnimationClock.h" |
| 40 #include "core/dom/Microtask.h" | 40 #include "core/dom/Microtask.h" |
| 41 #include "core/fetch/WebCacheMemoryDumpProvider.h" |
| 41 #include "core/frame/Settings.h" | 42 #include "core/frame/Settings.h" |
| 42 #include "core/page/Page.h" | 43 #include "core/page/Page.h" |
| 43 #include "core/workers/WorkerGlobalScopeProxy.h" | 44 #include "core/workers/WorkerGlobalScopeProxy.h" |
| 44 #include "gin/public/v8_platform.h" | 45 #include "gin/public/v8_platform.h" |
| 45 #include "modules/InitModules.h" | 46 #include "modules/InitModules.h" |
| 46 #include "platform/LayoutTestSupport.h" | 47 #include "platform/LayoutTestSupport.h" |
| 47 #include "platform/Logging.h" | 48 #include "platform/Logging.h" |
| 48 #include "platform/RuntimeEnabledFeatures.h" | 49 #include "platform/RuntimeEnabledFeatures.h" |
| 49 #include "platform/graphics/ImageDecodingStore.h" | 50 #include "platform/graphics/ImageDecodingStore.h" |
| 50 #include "platform/heap/Heap.h" | 51 #include "platform/heap/Heap.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 115 |
| 115 OwnPtr<V8IsolateInterruptor> interruptor = adoptPtr(new V8IsolateInterruptor
(V8PerIsolateData::mainThreadIsolate())); | 116 OwnPtr<V8IsolateInterruptor> interruptor = adoptPtr(new V8IsolateInterruptor
(V8PerIsolateData::mainThreadIsolate())); |
| 116 ThreadState::current()->addInterruptor(interruptor.release()); | 117 ThreadState::current()->addInterruptor(interruptor.release()); |
| 117 ThreadState::current()->registerTraceDOMWrappers(V8PerIsolateData::mainThrea
dIsolate(), V8GCController::traceDOMWrappers); | 118 ThreadState::current()->registerTraceDOMWrappers(V8PerIsolateData::mainThrea
dIsolate(), V8GCController::traceDOMWrappers); |
| 118 | 119 |
| 119 // currentThread is null if we are running on a thread without a message loo
p. | 120 // currentThread is null if we are running on a thread without a message loo
p. |
| 120 if (WebThread* currentThread = platform->currentThread()) { | 121 if (WebThread* currentThread = platform->currentThread()) { |
| 121 ASSERT(!s_endOfTaskRunner); | 122 ASSERT(!s_endOfTaskRunner); |
| 122 s_endOfTaskRunner = new EndOfTaskRunner; | 123 s_endOfTaskRunner = new EndOfTaskRunner; |
| 123 currentThread->addTaskObserver(s_endOfTaskRunner); | 124 currentThread->addTaskObserver(s_endOfTaskRunner); |
| 125 |
| 126 // Register web cache dump provider for tracing. |
| 127 platform->registerMemoryDumpProvider(WebCacheMemoryDumpProvider::instanc
e()); |
| 124 } | 128 } |
| 125 } | 129 } |
| 126 | 130 |
| 127 v8::Isolate* mainThreadIsolate() | 131 v8::Isolate* mainThreadIsolate() |
| 128 { | 132 { |
| 129 return V8PerIsolateData::mainThreadIsolate(); | 133 return V8PerIsolateData::mainThreadIsolate(); |
| 130 } | 134 } |
| 131 | 135 |
| 132 static double currentTimeFunction() | 136 static double currentTimeFunction() |
| 133 { | 137 { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 DEFINE_STATIC_LOCAL(ModulesInitializer, initializer, ()); | 195 DEFINE_STATIC_LOCAL(ModulesInitializer, initializer, ()); |
| 192 initializer.init(); | 196 initializer.init(); |
| 193 | 197 |
| 194 setIndexedDBClientCreateFunction(IndexedDBClientImpl::create); | 198 setIndexedDBClientCreateFunction(IndexedDBClientImpl::create); |
| 195 } | 199 } |
| 196 | 200 |
| 197 void shutdown() | 201 void shutdown() |
| 198 { | 202 { |
| 199 // currentThread() is null if we are running on a thread without a message l
oop. | 203 // currentThread() is null if we are running on a thread without a message l
oop. |
| 200 if (Platform::current()->currentThread()) { | 204 if (Platform::current()->currentThread()) { |
| 205 Platform::current()->unregisterMemoryDumpProvider(WebCacheMemoryDumpProv
ider::instance()); |
| 206 |
| 201 // We don't need to (cannot) remove s_endOfTaskRunner from the current | 207 // We don't need to (cannot) remove s_endOfTaskRunner from the current |
| 202 // message loop, because the message loop is already destructed before | 208 // message loop, because the message loop is already destructed before |
| 203 // the shutdown() is called. | 209 // the shutdown() is called. |
| 204 delete s_endOfTaskRunner; | 210 delete s_endOfTaskRunner; |
| 205 s_endOfTaskRunner = 0; | 211 s_endOfTaskRunner = 0; |
| 206 } | |
| 207 | 212 |
| 208 // currentThread() is null if we are running on a thread without a message l
oop. | |
| 209 if (Platform::current()->currentThread()) { | |
| 210 ASSERT(s_pendingGCRunner); | 213 ASSERT(s_pendingGCRunner); |
| 211 delete s_pendingGCRunner; | 214 delete s_pendingGCRunner; |
| 212 s_pendingGCRunner = 0; | 215 s_pendingGCRunner = 0; |
| 213 } | 216 } |
| 214 | 217 |
| 215 // Shutdown V8-related background threads before V8 is ramped down. Note | 218 // Shutdown V8-related background threads before V8 is ramped down. Note |
| 216 // that this will wait the thread to stop its operations. | 219 // that this will wait the thread to stop its operations. |
| 217 ScriptStreamerThread::shutdown(); | 220 ScriptStreamerThread::shutdown(); |
| 218 | 221 |
| 219 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); | 222 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 ASSERT(!reloadPages); | 292 ASSERT(!reloadPages); |
| 290 Page::refreshPlugins(); | 293 Page::refreshPlugins(); |
| 291 } | 294 } |
| 292 | 295 |
| 293 void decommitFreeableMemory() | 296 void decommitFreeableMemory() |
| 294 { | 297 { |
| 295 WTF::Partitions::decommitFreeableMemory(); | 298 WTF::Partitions::decommitFreeableMemory(); |
| 296 } | 299 } |
| 297 | 300 |
| 298 } // namespace blink | 301 } // namespace blink |
| OLD | NEW |