| OLD | NEW | 
|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/network/url_loader_impl.h" | 5 #include "content/network/url_loader_impl.h" | 
| 6 | 6 | 
| 7 #include "base/task_scheduler/post_task.h" | 7 #include "base/task_scheduler/post_task.h" | 
| 8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" | 
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" | 
| 10 #include "content/common/net_adapters.h" | 10 #include "content/common/net_adapters.h" | 
| 11 #include "content/common/url_loader_factory.mojom.h" |  | 
| 12 #include "content/network/network_context.h" | 11 #include "content/network/network_context.h" | 
| 13 #include "content/public/common/referrer.h" | 12 #include "content/public/common/referrer.h" | 
| 14 #include "content/public/common/resource_response.h" | 13 #include "content/public/common/resource_response.h" | 
|  | 14 #include "content/public/common/url_loader_factory.mojom.h" | 
| 15 #include "net/base/elements_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/base/upload_file_element_reader.h" | 18 #include "net/base/upload_file_element_reader.h" | 
| 19 #include "net/url_request/url_request_context.h" | 19 #include "net/url_request/url_request_context.h" | 
| 20 | 20 | 
| 21 namespace content { | 21 namespace content { | 
| 22 | 22 | 
| 23 namespace { | 23 namespace { | 
| 24 constexpr size_t kDefaultAllocationSize = 512 * 1024; | 24 constexpr size_t kDefaultAllocationSize = 512 * 1024; | 
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 393   ReadMore(); | 393   ReadMore(); | 
| 394 } | 394 } | 
| 395 | 395 | 
| 396 void URLLoaderImpl::DeleteIfNeeded() { | 396 void URLLoaderImpl::DeleteIfNeeded() { | 
| 397   bool has_data_pipe = pending_write_.get() || response_body_stream_.is_valid(); | 397   bool has_data_pipe = pending_write_.get() || response_body_stream_.is_valid(); | 
| 398   if (!connected_ && !has_data_pipe) | 398   if (!connected_ && !has_data_pipe) | 
| 399     delete this; | 399     delete this; | 
| 400 } | 400 } | 
| 401 | 401 | 
| 402 }  // namespace content | 402 }  // namespace content | 
| OLD | NEW | 
|---|