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 #ifndef COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ | 5 #ifndef COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ |
6 #define COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ | 6 #define COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 void set_method(const std::string& method) { | 76 void set_method(const std::string& method) { |
77 initial_method_ = method; | 77 initial_method_ = method; |
78 } | 78 } |
79 | 79 |
80 // Adds a header to the request before it starts. | 80 // Adds a header to the request before it starts. |
81 void AddRequestHeader(const std::string& name, const std::string& value); | 81 void AddRequestHeader(const std::string& name, const std::string& value); |
82 | 82 |
83 // Methods called on any thread. | 83 // Methods called on any thread. |
84 | 84 |
85 // Posts tasks to network thread. | 85 // Posts tasks to network thread. |
86 bool PostTaskToNetworkThread(const tracked_objects::Location& from_here, | 86 void PostTaskToNetworkThread(const tracked_objects::Location& from_here, |
87 const base::Closure& task); | 87 const base::Closure& task); |
88 | 88 |
89 // Returns true if called on network thread. | 89 // Returns true if called on network thread. |
90 bool IsOnNetworkThread() const; | 90 bool IsOnNetworkThread() const; |
91 | 91 |
92 // Methods called only on network thread. | 92 // Methods called only on network thread. |
93 | 93 |
94 // Starts the request. | 94 // Starts the request. |
95 void Start(); | 95 void Start(); |
96 | 96 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 scoped_refptr<net::IOBufferWithSize> read_buffer_; | 144 scoped_refptr<net::IOBufferWithSize> read_buffer_; |
145 scoped_ptr<net::URLRequest> url_request_; | 145 scoped_ptr<net::URLRequest> url_request_; |
146 | 146 |
147 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestAdapter); | 147 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestAdapter); |
148 }; | 148 }; |
149 | 149 |
150 } // namespace cronet | 150 } // namespace cronet |
151 | 151 |
152 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ | 152 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ |
OLD | NEW |