| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 { | 112 { |
| 113 ASSERT(!m_suspended); | 113 ASSERT(!m_suspended); |
| 114 m_pendingTasksTimer.stop(); | 114 m_pendingTasksTimer.stop(); |
| 115 m_suspended = true; | 115 m_suspended = true; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void MainThreadTaskRunner::resume() | 118 void MainThreadTaskRunner::resume() |
| 119 { | 119 { |
| 120 ASSERT(m_suspended); | 120 ASSERT(m_suspended); |
| 121 if (!m_pendingTasks.isEmpty()) | 121 if (!m_pendingTasks.isEmpty()) |
| 122 m_pendingTasksTimer.startOneShot(0, FROM_HERE); | 122 m_pendingTasksTimer.startOneShot(0, BLINK_FROM_HERE); |
| 123 | 123 |
| 124 m_suspended = false; | 124 m_suspended = false; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void MainThreadTaskRunner::pendingTasksTimerFired(Timer<MainThreadTaskRunner>*) | 127 void MainThreadTaskRunner::pendingTasksTimerFired(Timer<MainThreadTaskRunner>*) |
| 128 { | 128 { |
| 129 while (!m_pendingTasks.isEmpty()) { | 129 while (!m_pendingTasks.isEmpty()) { |
| 130 OwnPtr<ExecutionContextTask> task = m_pendingTasks[0].release(); | 130 OwnPtr<ExecutionContextTask> task = m_pendingTasks[0].release(); |
| 131 m_pendingTasks.remove(0); | 131 m_pendingTasks.remove(0); |
| 132 const bool instrumenting = !task->taskNameForInstrumentation().isEmpty()
; | 132 const bool instrumenting = !task->taskNameForInstrumentation().isEmpty()
; |
| 133 if (instrumenting) | 133 if (instrumenting) |
| 134 InspectorInstrumentation::willPerformExecutionContextTask(m_context,
task.get()); | 134 InspectorInstrumentation::willPerformExecutionContextTask(m_context,
task.get()); |
| 135 task->performTask(m_context); | 135 task->performTask(m_context); |
| 136 if (instrumenting) | 136 if (instrumenting) |
| 137 InspectorInstrumentation::didPerformExecutionContextTask(m_context); | 137 InspectorInstrumentation::didPerformExecutionContextTask(m_context); |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 WeakPtrWillBeRawPtr<MainThreadTaskRunner> MainThreadTaskRunner::createWeakPointe
rToSelf() | 141 WeakPtrWillBeRawPtr<MainThreadTaskRunner> MainThreadTaskRunner::createWeakPointe
rToSelf() |
| 142 { | 142 { |
| 143 #if ENABLE(OILPAN) | 143 #if ENABLE(OILPAN) |
| 144 return this; | 144 return this; |
| 145 #else | 145 #else |
| 146 return m_weakFactory.createWeakPtr(); | 146 return m_weakFactory.createWeakPtr(); |
| 147 #endif | 147 #endif |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace | 150 } // namespace |
| OLD | NEW |