OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/child/shared_memory_data_consumer_handle.h" | 5 #include "content/child/shared_memory_data_consumer_handle.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 on_reader_detached_.Reset(); | 156 on_reader_detached_.Reset(); |
157 } else { | 157 } else { |
158 // We need to reset |on_reader_detached_| on the right thread because it | 158 // We need to reset |on_reader_detached_| on the right thread because it |
159 // might lead to the object destruction. | 159 // might lead to the object destruction. |
160 writer_task_runner_->PostTask( | 160 writer_task_runner_->PostTask( |
161 FROM_HERE, base::Bind(&Context::ResetOnReaderDetachedWithLock, this)); | 161 FROM_HERE, base::Bind(&Context::ResetOnReaderDetachedWithLock, this)); |
162 } | 162 } |
163 } | 163 } |
164 bool is_handle_locked() const { | 164 bool is_handle_locked() const { |
165 lock_.AssertAcquired(); | 165 lock_.AssertAcquired(); |
166 return notification_task_runner_; | 166 return static_cast<bool>(notification_task_runner_); |
167 } | 167 } |
168 bool IsReaderBoundToCurrentThread() const { | 168 bool IsReaderBoundToCurrentThread() const { |
169 lock_.AssertAcquired(); | 169 lock_.AssertAcquired(); |
170 return notification_task_runner_ && | 170 return notification_task_runner_ && |
171 notification_task_runner_->BelongsToCurrentThread(); | 171 notification_task_runner_->BelongsToCurrentThread(); |
172 } | 172 } |
173 bool is_handle_active() const { | 173 bool is_handle_active() const { |
174 lock_.AssertAcquired(); | 174 lock_.AssertAcquired(); |
175 return is_handle_active_; | 175 return is_handle_active_; |
176 } | 176 } |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 SharedMemoryDataConsumerHandle::ReaderImpl* | 475 SharedMemoryDataConsumerHandle::ReaderImpl* |
476 SharedMemoryDataConsumerHandle::obtainReaderInternal(Client* client) { | 476 SharedMemoryDataConsumerHandle::obtainReaderInternal(Client* client) { |
477 return new ReaderImpl(context_, client); | 477 return new ReaderImpl(context_, client); |
478 } | 478 } |
479 | 479 |
480 const char* SharedMemoryDataConsumerHandle::debugName() const { | 480 const char* SharedMemoryDataConsumerHandle::debugName() const { |
481 return "SharedMemoryDataConsumerHandle"; | 481 return "SharedMemoryDataConsumerHandle"; |
482 } | 482 } |
483 | 483 |
484 } // namespace content | 484 } // namespace content |
OLD | NEW |