| 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 "components/html_viewer/web_url_loader_impl.h" | 5 #include "components/html_viewer/web_url_loader_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/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 WebURLRequestExtraData::~WebURLRequestExtraData() { | 74 WebURLRequestExtraData::~WebURLRequestExtraData() { |
| 75 } | 75 } |
| 76 | 76 |
| 77 WebURLLoaderImpl::WebURLLoaderImpl(mojo::URLLoaderFactory* url_loader_factory, | 77 WebURLLoaderImpl::WebURLLoaderImpl(mojo::URLLoaderFactory* url_loader_factory, |
| 78 MockWebBlobRegistryImpl* web_blob_registry) | 78 MockWebBlobRegistryImpl* web_blob_registry) |
| 79 : client_(NULL), | 79 : client_(NULL), |
| 80 web_blob_registry_(web_blob_registry), | 80 web_blob_registry_(web_blob_registry), |
| 81 referrer_policy_(blink::WebReferrerPolicyDefault), | 81 referrer_policy_(blink::WebReferrerPolicyDefault), |
| 82 handle_watcher_(15), |
| 82 weak_factory_(this) { | 83 weak_factory_(this) { |
| 83 url_loader_factory->CreateURLLoader(GetProxy(&url_loader_)); | 84 url_loader_factory->CreateURLLoader(GetProxy(&url_loader_)); |
| 84 } | 85 } |
| 85 | 86 |
| 86 WebURLLoaderImpl::~WebURLLoaderImpl() { | 87 WebURLLoaderImpl::~WebURLLoaderImpl() { |
| 87 } | 88 } |
| 88 | 89 |
| 89 void WebURLLoaderImpl::loadSynchronously( | 90 void WebURLLoaderImpl::loadSynchronously( |
| 90 const blink::WebURLRequest& request, | 91 const blink::WebURLRequest& request, |
| 91 blink::WebURLResponse& response, | 92 blink::WebURLResponse& response, |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 MOJO_DEADLINE_INDEFINITE, | 306 MOJO_DEADLINE_INDEFINITE, |
| 306 base::Bind(&WebURLLoaderImpl::OnResponseBodyStreamReady, | 307 base::Bind(&WebURLLoaderImpl::OnResponseBodyStreamReady, |
| 307 weak_factory_.GetWeakPtr())); | 308 weak_factory_.GetWeakPtr())); |
| 308 } | 309 } |
| 309 | 310 |
| 310 void WebURLLoaderImpl::OnResponseBodyStreamReady(MojoResult result) { | 311 void WebURLLoaderImpl::OnResponseBodyStreamReady(MojoResult result) { |
| 311 ReadMore(); | 312 ReadMore(); |
| 312 } | 313 } |
| 313 | 314 |
| 314 } // namespace html_viewer | 315 } // namespace html_viewer |
| OLD | NEW |