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 "mojo/services/html_viewer/weburlloader_impl.h" | 5 #include "mojo/services/html_viewer/weburlloader_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 WebURLRequestExtraData::WebURLRequestExtraData() { | 72 WebURLRequestExtraData::WebURLRequestExtraData() { |
73 } | 73 } |
74 | 74 |
75 WebURLRequestExtraData::~WebURLRequestExtraData() { | 75 WebURLRequestExtraData::~WebURLRequestExtraData() { |
76 } | 76 } |
77 | 77 |
78 WebURLLoaderImpl::WebURLLoaderImpl(NetworkService* network_service) | 78 WebURLLoaderImpl::WebURLLoaderImpl(NetworkService* network_service) |
79 : client_(NULL), | 79 : client_(NULL), |
80 weak_factory_(this) { | 80 weak_factory_(this) { |
81 network_service->CreateURLLoader(Get(&url_loader_)); | 81 network_service->CreateURLLoader(GetProxy(&url_loader_)); |
82 } | 82 } |
83 | 83 |
84 WebURLLoaderImpl::~WebURLLoaderImpl() { | 84 WebURLLoaderImpl::~WebURLLoaderImpl() { |
85 } | 85 } |
86 | 86 |
87 void WebURLLoaderImpl::loadSynchronously( | 87 void WebURLLoaderImpl::loadSynchronously( |
88 const blink::WebURLRequest& request, | 88 const blink::WebURLRequest& request, |
89 blink::WebURLResponse& response, | 89 blink::WebURLResponse& response, |
90 blink::WebURLError& error, | 90 blink::WebURLError& error, |
91 blink::WebData& data) { | 91 blink::WebData& data) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 MOJO_DEADLINE_INDEFINITE, | 215 MOJO_DEADLINE_INDEFINITE, |
216 base::Bind(&WebURLLoaderImpl::OnResponseBodyStreamReady, | 216 base::Bind(&WebURLLoaderImpl::OnResponseBodyStreamReady, |
217 weak_factory_.GetWeakPtr())); | 217 weak_factory_.GetWeakPtr())); |
218 } | 218 } |
219 | 219 |
220 void WebURLLoaderImpl::OnResponseBodyStreamReady(MojoResult result) { | 220 void WebURLLoaderImpl::OnResponseBodyStreamReady(MojoResult result) { |
221 ReadMore(); | 221 ReadMore(); |
222 } | 222 } |
223 | 223 |
224 } // namespace mojo | 224 } // namespace mojo |
OLD | NEW |