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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 writer->reset(new Writer(context_, mode)); | 466 writer->reset(new Writer(context_, mode)); |
467 } | 467 } |
468 | 468 |
469 SharedMemoryDataConsumerHandle::~SharedMemoryDataConsumerHandle() { | 469 SharedMemoryDataConsumerHandle::~SharedMemoryDataConsumerHandle() { |
470 base::AutoLock lock(context_->lock()); | 470 base::AutoLock lock(context_->lock()); |
471 context_->set_is_handle_active(false); | 471 context_->set_is_handle_active(false); |
472 context_->ClearIfNecessary(); | 472 context_->ClearIfNecessary(); |
473 } | 473 } |
474 | 474 |
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(obtainReaderInternal(client)); | 477 return base::WrapUnique(new ReaderImpl(context_, client)); |
478 } | |
479 | |
480 SharedMemoryDataConsumerHandle::ReaderImpl* | |
481 SharedMemoryDataConsumerHandle::obtainReaderInternal(Client* client) { | |
482 return new ReaderImpl(context_, client); | |
483 } | 478 } |
484 | 479 |
485 const char* SharedMemoryDataConsumerHandle::debugName() const { | 480 const char* SharedMemoryDataConsumerHandle::debugName() const { |
486 return "SharedMemoryDataConsumerHandle"; | 481 return "SharedMemoryDataConsumerHandle"; |
487 } | 482 } |
488 | 483 |
489 } // namespace content | 484 } // namespace content |
OLD | NEW |