| 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 "url_request_adapter.h" | 5 #include "url_request_adapter.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "components/cronet/android/url_request_context_adapter.h" | 13 #include "components/cronet/android/url_request_context_adapter.h" |
| 14 #include "components/cronet/android/wrapped_channel_upload_element_reader.h" | 14 #include "components/cronet/android/wrapped_channel_upload_element_reader.h" |
| 15 #include "net/base/element_upload_data_stream.h" | 15 #include "net/base/elements_upload_data_stream.h" |
| 16 #include "net/base/load_flags.h" | 16 #include "net/base/load_flags.h" |
| 17 #include "net/base/upload_bytes_element_reader.h" | 17 #include "net/base/upload_bytes_element_reader.h" |
| 18 #include "net/http/http_status_code.h" | 18 #include "net/http/http_status_code.h" |
| 19 | 19 |
| 20 namespace cronet { | 20 namespace cronet { |
| 21 | 21 |
| 22 static const size_t kBufferSizeIncrement = 8192; | 22 static const size_t kBufferSizeIncrement = 8192; |
| 23 | 23 |
| 24 URLRequestAdapter::URLRequestAdapter(URLRequestContextAdapter* context, | 24 URLRequestAdapter::URLRequestAdapter(URLRequestContextAdapter* context, |
| 25 URLRequestAdapterDelegate* delegate, | 25 URLRequestAdapterDelegate* delegate, |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 292 |
| 293 delegate_->OnBytesRead(this); | 293 delegate_->OnBytesRead(this); |
| 294 delegate_->OnRequestFinished(this); | 294 delegate_->OnRequestFinished(this); |
| 295 } | 295 } |
| 296 | 296 |
| 297 unsigned char* URLRequestAdapter::Data() const { | 297 unsigned char* URLRequestAdapter::Data() const { |
| 298 return reinterpret_cast<unsigned char*>(read_buffer_->StartOfBuffer()); | 298 return reinterpret_cast<unsigned char*>(read_buffer_->StartOfBuffer()); |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace cronet | 301 } // namespace cronet |
| OLD | NEW |