| 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 22 matching lines...) Expand all Loading... |
| 33 #include "public/platform/Platform.h" | 33 #include "public/platform/Platform.h" |
| 34 #include "wtf/Assertions.h" | 34 #include "wtf/Assertions.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 MainThreadTaskRunner::MainThreadTaskRunner(ExecutionContext* context) | 38 MainThreadTaskRunner::MainThreadTaskRunner(ExecutionContext* context) |
| 39 : m_context(context), | 39 : m_context(context), |
| 40 m_pendingTasksTimer(this, &MainThreadTaskRunner::pendingTasksTimerFired), | 40 m_pendingTasksTimer(this, &MainThreadTaskRunner::pendingTasksTimerFired), |
| 41 m_suspended(false), | 41 m_suspended(false), |
| 42 m_weakFactory(this) | 42 m_weakFactory(this) |
| 43 // Bind a WeakPtr now to avoid data races creating a WeakPtr inside postTa
sk. | 43 // Bind a WeakPtr now to avoid data races creating a WeakPtr inside |
| 44 // postTask. |
| 44 , | 45 , |
| 45 m_weakPtr(m_weakFactory.createWeakPtr()) {} | 46 m_weakPtr(m_weakFactory.createWeakPtr()) {} |
| 46 | 47 |
| 47 MainThreadTaskRunner::~MainThreadTaskRunner() {} | 48 MainThreadTaskRunner::~MainThreadTaskRunner() {} |
| 48 | 49 |
| 49 void MainThreadTaskRunner::postTaskInternal( | 50 void MainThreadTaskRunner::postTaskInternal( |
| 50 const WebTraceLocation& location, | 51 const WebTraceLocation& location, |
| 51 std::unique_ptr<ExecutionContextTask> task, | 52 std::unique_ptr<ExecutionContextTask> task, |
| 52 bool isInspectorTask, | 53 bool isInspectorTask, |
| 53 bool instrumenting) { | 54 bool instrumenting) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 std::move(m_pendingTasks[0].first); | 118 std::move(m_pendingTasks[0].first); |
| 118 const bool instrumenting = m_pendingTasks[0].second; | 119 const bool instrumenting = m_pendingTasks[0].second; |
| 119 m_pendingTasks.remove(0); | 120 m_pendingTasks.remove(0); |
| 120 InspectorInstrumentation::AsyncTask asyncTask(m_context, task.get(), | 121 InspectorInstrumentation::AsyncTask asyncTask(m_context, task.get(), |
| 121 instrumenting); | 122 instrumenting); |
| 122 task->performTask(m_context); | 123 task->performTask(m_context); |
| 123 } | 124 } |
| 124 } | 125 } |
| 125 | 126 |
| 126 } // namespace blink | 127 } // namespace blink |
| OLD | NEW |