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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <utility> | 10 #include <utility> |
(...skipping 19 matching lines...) Expand all Loading... |
30 friend class base::RefCountedThreadSafe<Context>; | 30 friend class base::RefCountedThreadSafe<Context>; |
31 ~Context() {} | 31 ~Context() {} |
32 Handle handle_; | 32 Handle handle_; |
33 | 33 |
34 DISALLOW_COPY_AND_ASSIGN(Context); | 34 DISALLOW_COPY_AND_ASSIGN(Context); |
35 }; | 35 }; |
36 | 36 |
37 WebDataConsumerHandleImpl::ReaderImpl::ReaderImpl( | 37 WebDataConsumerHandleImpl::ReaderImpl::ReaderImpl( |
38 scoped_refptr<Context> context, | 38 scoped_refptr<Context> context, |
39 Client* client) | 39 Client* client) |
40 : context_(context), handle_watcher_(FROM_HERE), client_(client) { | 40 : context_(context), |
| 41 handle_watcher_(FROM_HERE, mojo::Watcher::ArmingPolicy::AUTOMATIC), |
| 42 client_(client) { |
41 if (client_) | 43 if (client_) |
42 StartWatching(); | 44 StartWatching(); |
43 } | 45 } |
44 | 46 |
45 WebDataConsumerHandleImpl::ReaderImpl::~ReaderImpl() { | 47 WebDataConsumerHandleImpl::ReaderImpl::~ReaderImpl() { |
46 } | 48 } |
47 | 49 |
48 Result WebDataConsumerHandleImpl::ReaderImpl::read(void* data, | 50 Result WebDataConsumerHandleImpl::ReaderImpl::read(void* data, |
49 size_t size, | 51 size_t size, |
50 Flags flags, | 52 Flags flags, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 std::unique_ptr<blink::WebDataConsumerHandle::Reader> | 151 std::unique_ptr<blink::WebDataConsumerHandle::Reader> |
150 WebDataConsumerHandleImpl::obtainReader(Client* client) { | 152 WebDataConsumerHandleImpl::obtainReader(Client* client) { |
151 return base::WrapUnique(new ReaderImpl(context_, client)); | 153 return base::WrapUnique(new ReaderImpl(context_, client)); |
152 } | 154 } |
153 | 155 |
154 const char* WebDataConsumerHandleImpl::debugName() const { | 156 const char* WebDataConsumerHandleImpl::debugName() const { |
155 return "WebDataConsumerHandleImpl"; | 157 return "WebDataConsumerHandleImpl"; |
156 } | 158 } |
157 | 159 |
158 } // namespace content | 160 } // namespace content |
OLD | NEW |