| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/web_data_consumer_handle_impl.h" | 5 #include "content/child/web_data_consumer_handle_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 class ClientImpl final : public WebDataConsumerHandle::Client { | 46 class ClientImpl final : public WebDataConsumerHandle::Client { |
| 47 public: | 47 public: |
| 48 explicit ClientImpl(ReadDataOperationBase* operation) | 48 explicit ClientImpl(ReadDataOperationBase* operation) |
| 49 : operation_(operation) {} | 49 : operation_(operation) {} |
| 50 | 50 |
| 51 void didGetReadable() override { | 51 void didGetReadable() override { |
| 52 base::ThreadTaskRunnerHandle::Get()->PostTask( | 52 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 53 FROM_HERE, base::Bind(&ReadDataOperationBase::ReadMore, | 53 FROM_HERE, base::Bind(&ReadDataOperationBase::ReadMore, |
| 54 base::Unretained(operation_))); | 54 base::Unretained(operation_))); |
| 55 } | 55 } |
| 56 blink::WebTaskRunner* getTaskRunner() override { |
| 57 return nullptr; |
| 58 } |
| 56 | 59 |
| 57 private: | 60 private: |
| 58 ReadDataOperationBase* operation_; | 61 ReadDataOperationBase* operation_; |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 class ReadDataOperation : public ReadDataOperationBase { | 64 class ReadDataOperation : public ReadDataOperationBase { |
| 62 public: | 65 public: |
| 63 typedef WebDataConsumerHandle::Result Result; | 66 typedef WebDataConsumerHandle::Result Result; |
| 64 ReadDataOperation(mojo::ScopedDataPipeConsumerHandle handle, | 67 ReadDataOperation(mojo::ScopedDataPipeConsumerHandle handle, |
| 65 base::MessageLoop* main_message_loop, | 68 base::MessageLoop* main_message_loop, |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 275 |
| 273 run_loop.Run(); | 276 run_loop.Run(); |
| 274 t.Stop(); | 277 t.Stop(); |
| 275 | 278 |
| 276 EXPECT_EQ(expected, operation->result()); | 279 EXPECT_EQ(expected, operation->result()); |
| 277 } | 280 } |
| 278 | 281 |
| 279 } // namespace | 282 } // namespace |
| 280 | 283 |
| 281 } // namespace content | 284 } // namespace content |
| OLD | NEW |