OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/byte_stream.h" | 5 #include "content/browser/byte_stream.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/task/sequenced_task_runner.h" | 11 #include "base/sequenced_task_runner.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 namespace { | 14 namespace { |
15 | 15 |
16 typedef std::deque<std::pair<scoped_refptr<net::IOBuffer>, size_t> > | 16 typedef std::deque<std::pair<scoped_refptr<net::IOBuffer>, size_t> > |
17 ContentVector; | 17 ContentVector; |
18 | 18 |
19 class ByteStreamReaderImpl; | 19 class ByteStreamReaderImpl; |
20 | 20 |
21 // A poor man's weak pointer; a RefCountedThreadSafe boolean that can be | 21 // A poor man's weak pointer; a RefCountedThreadSafe boolean that can be |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 ByteStreamReaderImpl* out = new ByteStreamReaderImpl( | 425 ByteStreamReaderImpl* out = new ByteStreamReaderImpl( |
426 output_task_runner, output_flag, buffer_size); | 426 output_task_runner, output_flag, buffer_size); |
427 | 427 |
428 in->SetPeer(out, output_task_runner, output_flag); | 428 in->SetPeer(out, output_task_runner, output_flag); |
429 out->SetPeer(in, input_task_runner, input_flag); | 429 out->SetPeer(in, input_task_runner, input_flag); |
430 input->reset(in); | 430 input->reset(in); |
431 output->reset(out); | 431 output->reset(out); |
432 } | 432 } |
433 | 433 |
434 } // namespace content | 434 } // namespace content |
OLD | NEW |