| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 s_endOfTaskRunner = new EndOfTaskRunner; | 93 s_endOfTaskRunner = new EndOfTaskRunner; |
| 94 currentThread->addTaskObserver(s_endOfTaskRunner); | 94 currentThread->addTaskObserver(s_endOfTaskRunner); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 void shutdown() | 98 void shutdown() |
| 99 { | 99 { |
| 100 ThreadState::current()->cleanupMainThread(); | 100 ThreadState::current()->cleanupMainThread(); |
| 101 | 101 |
| 102 // currentThread() is null if we are running on a thread without a message l
oop. | 102 // currentThread() is null if we are running on a thread without a message l
oop. |
| 103 if (Platform::current()->currentThread()) { | 103 if (WebThread* currentThread = Platform::current()->currentThread()) { |
| 104 // We don't need to (cannot) remove s_endOfTaskRunner from the current | 104 currentThread->removeTaskObserver(s_endOfTaskRunner); |
| 105 // message loop, because the message loop is already destructed before | |
| 106 // the shutdown() is called. | |
| 107 delete s_endOfTaskRunner; | |
| 108 s_endOfTaskRunner = nullptr; | 105 s_endOfTaskRunner = nullptr; |
| 109 } | 106 } |
| 110 | 107 |
| 111 modulesInitializer().shutdown(); | 108 modulesInitializer().shutdown(); |
| 112 | 109 |
| 113 V8Initializer::shutdownMainThread(); | 110 V8Initializer::shutdownMainThread(); |
| 114 | 111 |
| 115 Platform::shutdown(); | 112 Platform::shutdown(); |
| 116 } | 113 } |
| 117 | 114 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 WorkerBackingThread:: | 172 WorkerBackingThread:: |
| 176 MemoryPressureNotificationToWorkerThreadIsolates(level); | 173 MemoryPressureNotificationToWorkerThreadIsolates(level); |
| 177 } | 174 } |
| 178 | 175 |
| 179 void setRAILModeOnWorkerThreadIsolates(v8::RAILMode railMode) | 176 void setRAILModeOnWorkerThreadIsolates(v8::RAILMode railMode) |
| 180 { | 177 { |
| 181 WorkerBackingThread::setRAILModeOnWorkerThreadIsolates(railMode); | 178 WorkerBackingThread::setRAILModeOnWorkerThreadIsolates(railMode); |
| 182 } | 179 } |
| 183 | 180 |
| 184 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |