| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 m_pendingTasks.append(task); | 85 m_pendingTasks.append(task); |
| 86 return; | 86 return; |
| 87 } | 87 } |
| 88 | 88 |
| 89 InspectorInstrumentation::AsyncTask asyncTask(m_context, task.get(), !isInsp
ectorTask); | 89 InspectorInstrumentation::AsyncTask asyncTask(m_context, task.get(), !isInsp
ectorTask); |
| 90 task->performTask(m_context); | 90 task->performTask(m_context); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void MainThreadTaskRunner::suspend() | 93 void MainThreadTaskRunner::suspend() |
| 94 { | 94 { |
| 95 ASSERT(!m_suspended); | 95 DCHECK(!m_suspended); |
| 96 m_pendingTasksTimer.stop(); | 96 m_pendingTasksTimer.stop(); |
| 97 m_suspended = true; | 97 m_suspended = true; |
| 98 } | 98 } |
| 99 | 99 |
| 100 void MainThreadTaskRunner::resume() | 100 void MainThreadTaskRunner::resume() |
| 101 { | 101 { |
| 102 ASSERT(m_suspended); | 102 DCHECK(m_suspended); |
| 103 if (!m_pendingTasks.isEmpty()) | 103 if (!m_pendingTasks.isEmpty()) |
| 104 m_pendingTasksTimer.startOneShot(0, BLINK_FROM_HERE); | 104 m_pendingTasksTimer.startOneShot(0, BLINK_FROM_HERE); |
| 105 | 105 |
| 106 m_suspended = false; | 106 m_suspended = false; |
| 107 } | 107 } |
| 108 | 108 |
| 109 void MainThreadTaskRunner::pendingTasksTimerFired(Timer<MainThreadTaskRunner>*) | 109 void MainThreadTaskRunner::pendingTasksTimerFired(Timer<MainThreadTaskRunner>*) |
| 110 { | 110 { |
| 111 while (!m_pendingTasks.isEmpty()) { | 111 while (!m_pendingTasks.isEmpty()) { |
| 112 OwnPtr<ExecutionContextTask> task = m_pendingTasks[0].release(); | 112 OwnPtr<ExecutionContextTask> task = m_pendingTasks[0].release(); |
| 113 m_pendingTasks.remove(0); | 113 m_pendingTasks.remove(0); |
| 114 const bool instrumenting = !task->taskNameForInstrumentation().isEmpty()
; | 114 const bool instrumenting = !task->taskNameForInstrumentation().isEmpty()
; |
| 115 InspectorInstrumentation::AsyncTask asyncTask(m_context, task.get(), ins
trumenting); | 115 InspectorInstrumentation::AsyncTask asyncTask(m_context, task.get(), ins
trumenting); |
| 116 task->performTask(m_context); | 116 task->performTask(m_context); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace blink | 120 } // namespace blink |
| OLD | NEW |