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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
6 | 6 |
7 #include "content/child/web_url_loader_impl.h" | 7 #include "content/child/web_url_loader_impl.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <deque> | 10 #include <deque> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/profiler/scoped_tracker.h" |
17 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
18 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
19 #include "base/time/time.h" | 20 #include "base/time/time.h" |
20 #include "content/child/ftp_directory_listing_response_delegate.h" | 21 #include "content/child/ftp_directory_listing_response_delegate.h" |
21 #include "content/child/multipart_response_delegate.h" | 22 #include "content/child/multipart_response_delegate.h" |
22 #include "content/child/request_extra_data.h" | 23 #include "content/child/request_extra_data.h" |
23 #include "content/child/request_info.h" | 24 #include "content/child/request_info.h" |
24 #include "content/child/resource_dispatcher.h" | 25 #include "content/child/resource_dispatcher.h" |
25 #include "content/child/resource_loader_bridge.h" | 26 #include "content/child/resource_loader_bridge.h" |
26 #include "content/child/sync_load_response.h" | 27 #include "content/child/sync_load_response.h" |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 body_stream_writer_.get(), | 890 body_stream_writer_.get(), |
890 MOJO_HANDLE_SIGNAL_WRITABLE, | 891 MOJO_HANDLE_SIGNAL_WRITABLE, |
891 MOJO_DEADLINE_INDEFINITE, | 892 MOJO_DEADLINE_INDEFINITE, |
892 base::Bind(&WebURLLoaderImpl::Context::OnHandleGotWritable, | 893 base::Bind(&WebURLLoaderImpl::Context::OnHandleGotWritable, |
893 base::Unretained(this))); | 894 base::Unretained(this))); |
894 } | 895 } |
895 return rv; | 896 return rv; |
896 } | 897 } |
897 | 898 |
898 void WebURLLoaderImpl::Context::OnHandleGotWritable(MojoResult result) { | 899 void WebURLLoaderImpl::Context::OnHandleGotWritable(MojoResult result) { |
| 900 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455434 is |
| 901 // fixed. |
| 902 tracked_objects::ScopedTracker tracking_profile( |
| 903 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 904 "455434 WebURLLoaderImpl::Context::OnHandleGotWritable")); |
899 if (result != MOJO_RESULT_OK) { | 905 if (result != MOJO_RESULT_OK) { |
900 if (client_) { | 906 if (client_) { |
901 client_->didFail(loader_, | 907 client_->didFail(loader_, |
902 loader_->CreateError(request_.url(), | 908 loader_->CreateError(request_.url(), |
903 false, | 909 false, |
904 net::ERR_FAILED)); | 910 net::ERR_FAILED)); |
905 // |this| can be deleted here. | 911 // |this| can be deleted here. |
906 } | 912 } |
907 return; | 913 return; |
908 } | 914 } |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 int intra_priority_value) { | 1141 int intra_priority_value) { |
1136 context_->DidChangePriority(new_priority, intra_priority_value); | 1142 context_->DidChangePriority(new_priority, intra_priority_value); |
1137 } | 1143 } |
1138 | 1144 |
1139 bool WebURLLoaderImpl::attachThreadedDataReceiver( | 1145 bool WebURLLoaderImpl::attachThreadedDataReceiver( |
1140 blink::WebThreadedDataReceiver* threaded_data_receiver) { | 1146 blink::WebThreadedDataReceiver* threaded_data_receiver) { |
1141 return context_->AttachThreadedDataReceiver(threaded_data_receiver); | 1147 return context_->AttachThreadedDataReceiver(threaded_data_receiver); |
1142 } | 1148 } |
1143 | 1149 |
1144 } // namespace content | 1150 } // namespace content |
OLD | NEW |