Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1464)

Side by Side Diff: mojo/services/html_viewer/weburlloader_impl.cc

Issue 1013413003: html_viewer: Set expected content length to -1 in ToWebURLResponse(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 27 matching lines...) Expand all
38 } 38 }
39 39
40 blink::WebURLResponse ToWebURLResponse(const URLResponsePtr& url_response) { 40 blink::WebURLResponse ToWebURLResponse(const URLResponsePtr& url_response) {
41 blink::WebURLResponse result; 41 blink::WebURLResponse result;
42 result.initialize(); 42 result.initialize();
43 result.setURL(GURL(url_response->url)); 43 result.setURL(GURL(url_response->url));
44 result.setMIMEType(blink::WebString::fromUTF8(url_response->mime_type)); 44 result.setMIMEType(blink::WebString::fromUTF8(url_response->mime_type));
45 result.setTextEncodingName(blink::WebString::fromUTF8(url_response->charset)); 45 result.setTextEncodingName(blink::WebString::fromUTF8(url_response->charset));
46 result.setHTTPVersion(StatusLineToHTTPVersion(url_response->status_line)); 46 result.setHTTPVersion(StatusLineToHTTPVersion(url_response->status_line));
47 result.setHTTPStatusCode(url_response->status_code); 47 result.setHTTPStatusCode(url_response->status_code);
48 result.setExpectedContentLength(-1); // Not available.
48 49
49 // TODO(darin): Initialize timing properly. 50 // TODO(darin): Initialize timing properly.
50 blink::WebURLLoadTiming timing; 51 blink::WebURLLoadTiming timing;
51 timing.initialize(); 52 timing.initialize();
52 result.setLoadTiming(timing); 53 result.setLoadTiming(timing);
53 54
54 for (size_t i = 0; i < url_response->headers.size(); ++i) { 55 for (size_t i = 0; i < url_response->headers.size(); ++i) {
55 const std::string& header_line = url_response->headers[i]; 56 const std::string& header_line = url_response->headers[i];
56 size_t first_colon = header_line.find(":"); 57 size_t first_colon = header_line.find(":");
57 58
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 MOJO_DEADLINE_INDEFINITE, 218 MOJO_DEADLINE_INDEFINITE,
218 base::Bind(&WebURLLoaderImpl::OnResponseBodyStreamReady, 219 base::Bind(&WebURLLoaderImpl::OnResponseBodyStreamReady,
219 weak_factory_.GetWeakPtr())); 220 weak_factory_.GetWeakPtr()));
220 } 221 }
221 222
222 void WebURLLoaderImpl::OnResponseBodyStreamReady(MojoResult result) { 223 void WebURLLoaderImpl::OnResponseBodyStreamReady(MojoResult result) {
223 ReadMore(); 224 ReadMore();
224 } 225 }
225 226
226 } // namespace html_viewer 227 } // namespace html_viewer
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698