OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_widget_resize_helper.h" | 5 #include "content/browser/renderer_host/render_widget_resize_helper.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 9 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
10 #include "content/browser/renderer_host/render_process_host_impl.h" | 10 #include "content/browser/renderer_host/render_process_host_impl.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 pumpable_task_runner_ = pumpable_task_runner; | 166 pumpable_task_runner_ = pumpable_task_runner; |
167 base::AutoLock lock(pumpable_task_runner_->task_queue_lock_); | 167 base::AutoLock lock(pumpable_task_runner_->task_queue_lock_); |
168 static uint64 last_sequence_number = 0; | 168 static uint64 last_sequence_number = 0; |
169 last_sequence_number += 1; | 169 last_sequence_number += 1; |
170 sequence_number_ = last_sequence_number; | 170 sequence_number_ = last_sequence_number; |
171 iterator_ = pumpable_task_runner_->task_queue_.insert( | 171 iterator_ = pumpable_task_runner_->task_queue_.insert( |
172 pumpable_task_runner_->task_queue_.end(), this); | 172 pumpable_task_runner_->task_queue_.end(), this); |
173 } | 173 } |
174 | 174 |
175 void WrappedTask::RemoveFromTaskRunnerQueue() { | 175 void WrappedTask::RemoveFromTaskRunnerQueue() { |
176 if (!pumpable_task_runner_) | 176 if (!pumpable_task_runner_.get()) |
177 return; | 177 return; |
178 // The scope of the task runner's lock must be limited because removing | 178 // The scope of the task runner's lock must be limited because removing |
179 // this reference to the task runner may destroy it. | 179 // this reference to the task runner may destroy it. |
180 { | 180 { |
181 base::AutoLock lock(pumpable_task_runner_->task_queue_lock_); | 181 base::AutoLock lock(pumpable_task_runner_->task_queue_lock_); |
182 pumpable_task_runner_->task_queue_.erase(iterator_); | 182 pumpable_task_runner_->task_queue_.erase(iterator_); |
183 iterator_ = pumpable_task_runner_->task_queue_.end(); | 183 iterator_ = pumpable_task_runner_->task_queue_.end(); |
184 } | 184 } |
185 pumpable_task_runner_ = NULL; | 185 pumpable_task_runner_ = NULL; |
186 } | 186 } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 348 |
349 // static | 349 // static |
350 void RenderWidgetResizeHelper::EventTimedWait( | 350 void RenderWidgetResizeHelper::EventTimedWait( |
351 base::WaitableEvent* event, base::TimeDelta delay) { | 351 base::WaitableEvent* event, base::TimeDelta delay) { |
352 base::ThreadRestrictions::ScopedAllowWait allow_wait; | 352 base::ThreadRestrictions::ScopedAllowWait allow_wait; |
353 event->TimedWait(delay); | 353 event->TimedWait(delay); |
354 } | 354 } |
355 | 355 |
356 } // namespace content | 356 } // namespace content |
357 | 357 |
OLD | NEW |