Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/gpu/sync_point_manager.h" | 5 #include "content/common/gpu/sync_point_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 base::AutoLock lock(lock_); | 50 base::AutoLock lock(lock_); |
| 51 SyncPointMap::iterator it = sync_point_map_.find(sync_point); | 51 SyncPointMap::iterator it = sync_point_map_.find(sync_point); |
| 52 if (it != sync_point_map_.end()) { | 52 if (it != sync_point_map_.end()) { |
| 53 it->second.push_back(callback); | 53 it->second.push_back(callback); |
| 54 return; | 54 return; |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 callback.Run(); | 57 callback.Run(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool SyncPointManager::IsSyncPointRetired(uint32 sync_point) { | |
| 61 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 62 { | |
| 63 base::AutoLock lock(lock_); | |
| 64 SyncPointMap::iterator it = sync_point_map_.find(sync_point); | |
| 65 if (it != sync_point_map_.end()) | |
|
piman
2014/01/08 21:43:54
nit: just return it == sync_point_map_.end()
| |
| 66 return false; | |
| 67 } | |
| 68 return true; | |
| 69 } | |
| 70 | |
| 60 } // namespace content | 71 } // namespace content |
| OLD | NEW |