| 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 20 matching lines...) Expand all Loading... |
| 31 ~DelegateThreadSafeReceivedData() override { | 31 ~DelegateThreadSafeReceivedData() override { |
| 32 if (!task_runner_->BelongsToCurrentThread()) { | 32 if (!task_runner_->BelongsToCurrentThread()) { |
| 33 // Delete the data on the original thread. | 33 // Delete the data on the original thread. |
| 34 task_runner_->DeleteSoon(FROM_HERE, data_.release()); | 34 task_runner_->DeleteSoon(FROM_HERE, data_.release()); |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 const char* payload() const override { return data_->payload(); } | 38 const char* payload() const override { return data_->payload(); } |
| 39 int length() const override { return data_->length(); } | 39 int length() const override { return data_->length(); } |
| 40 int encoded_length() const override { return data_->encoded_length(); } | 40 int encoded_length() const override { return data_->encoded_length(); } |
| 41 int encoded_body_length() const override { |
| 42 return data_->encoded_body_length(); |
| 43 } |
| 41 | 44 |
| 42 private: | 45 private: |
| 43 std::unique_ptr<RequestPeer::ReceivedData> data_; | 46 std::unique_ptr<RequestPeer::ReceivedData> data_; |
| 44 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 47 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 45 | 48 |
| 46 DISALLOW_COPY_AND_ASSIGN(DelegateThreadSafeReceivedData); | 49 DISALLOW_COPY_AND_ASSIGN(DelegateThreadSafeReceivedData); |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 } // namespace | 52 } // namespace |
| 50 | 53 |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 SharedMemoryDataConsumerHandle::ReaderImpl* | 478 SharedMemoryDataConsumerHandle::ReaderImpl* |
| 476 SharedMemoryDataConsumerHandle::obtainReaderInternal(Client* client) { | 479 SharedMemoryDataConsumerHandle::obtainReaderInternal(Client* client) { |
| 477 return new ReaderImpl(context_, client); | 480 return new ReaderImpl(context_, client); |
| 478 } | 481 } |
| 479 | 482 |
| 480 const char* SharedMemoryDataConsumerHandle::debugName() const { | 483 const char* SharedMemoryDataConsumerHandle::debugName() const { |
| 481 return "SharedMemoryDataConsumerHandle"; | 484 return "SharedMemoryDataConsumerHandle"; |
| 482 } | 485 } |
| 483 | 486 |
| 484 } // namespace content | 487 } // namespace content |
| OLD | NEW |