| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 base::AutoLock lock(context_->lock()); | 304 base::AutoLock lock(context_->lock()); |
| 305 if (!context_->is_handle_active() && !context_->is_handle_locked()) { | 305 if (!context_->is_handle_active() && !context_->is_handle_locked()) { |
| 306 // No one is interested in the data. | 306 // No one is interested in the data. |
| 307 return; | 307 return; |
| 308 } | 308 } |
| 309 | 309 |
| 310 needs_notification = context_->IsEmpty(); | 310 needs_notification = context_->IsEmpty(); |
| 311 std::unique_ptr<RequestPeer::ThreadSafeReceivedData> data_to_pass; | 311 std::unique_ptr<RequestPeer::ThreadSafeReceivedData> data_to_pass; |
| 312 if (mode_ == kApplyBackpressure) { | 312 if (mode_ == kApplyBackpressure) { |
| 313 data_to_pass = | 313 data_to_pass = |
| 314 base::WrapUnique(new DelegateThreadSafeReceivedData(std::move(data))); | 314 base::MakeUnique<DelegateThreadSafeReceivedData>(std::move(data)); |
| 315 } else { | 315 } else { |
| 316 data_to_pass = base::WrapUnique(new FixedReceivedData(data.get())); | 316 data_to_pass = base::MakeUnique<FixedReceivedData>(data.get()); |
| 317 } | 317 } |
| 318 context_->Push(std::move(data_to_pass)); | 318 context_->Push(std::move(data_to_pass)); |
| 319 } | 319 } |
| 320 | 320 |
| 321 if (needs_notification) { | 321 if (needs_notification) { |
| 322 // We CAN issue the notification synchronously if the associated reader | 322 // We CAN issue the notification synchronously if the associated reader |
| 323 // lives in this thread, because this function cannot be called in the | 323 // lives in this thread, because this function cannot be called in the |
| 324 // client's callback. | 324 // client's callback. |
| 325 context_->Notify(); | 325 context_->Notify(); |
| 326 } | 326 } |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 std::unique_ptr<blink::WebDataConsumerHandle::Reader> | 475 std::unique_ptr<blink::WebDataConsumerHandle::Reader> |
| 476 SharedMemoryDataConsumerHandle::obtainReader(Client* client) { | 476 SharedMemoryDataConsumerHandle::obtainReader(Client* client) { |
| 477 return base::WrapUnique(new ReaderImpl(context_, client)); | 477 return base::WrapUnique(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 |