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

Side by Side Diff: components/html_viewer/web_url_loader_impl.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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
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 "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 12 matching lines...) Expand all
23 using mojo::URLResponsePtr; 23 using mojo::URLResponsePtr;
24 24
25 namespace html_viewer { 25 namespace html_viewer {
26 namespace { 26 namespace {
27 27
28 blink::WebURLResponse::HTTPVersion StatusLineToHTTPVersion( 28 blink::WebURLResponse::HTTPVersion StatusLineToHTTPVersion(
29 const mojo::String& status_line) { 29 const mojo::String& status_line) {
30 if (status_line.is_null()) 30 if (status_line.is_null())
31 return blink::WebURLResponse::HTTP_0_9; 31 return blink::WebURLResponse::HTTP_0_9;
32 32
33 if (base::StartsWithASCII(status_line, "HTTP/1.0", true)) 33 if (base::StartsWith(status_line.get(), "HTTP/1.0",
34 base::CompareCase::SENSITIVE))
34 return blink::WebURLResponse::HTTP_1_0; 35 return blink::WebURLResponse::HTTP_1_0;
35 36
36 if (base::StartsWithASCII(status_line, "HTTP/1.1", true)) 37 if (base::StartsWith(status_line.get(), "HTTP/1.1",
38 base::CompareCase::SENSITIVE))
37 return blink::WebURLResponse::HTTP_1_1; 39 return blink::WebURLResponse::HTTP_1_1;
38 40
39 return blink::WebURLResponse::Unknown; 41 return blink::WebURLResponse::Unknown;
40 } 42 }
41 43
42 blink::WebURLResponse ToWebURLResponse(const URLResponsePtr& url_response) { 44 blink::WebURLResponse ToWebURLResponse(const URLResponsePtr& url_response) {
43 blink::WebURLResponse result; 45 blink::WebURLResponse result;
44 result.initialize(); 46 result.initialize();
45 result.setURL(GURL(url_response->url)); 47 result.setURL(GURL(url_response->url));
46 result.setMIMEType(blink::WebString::fromUTF8(url_response->mime_type)); 48 result.setMIMEType(blink::WebString::fromUTF8(url_response->mime_type));
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 MOJO_DEADLINE_INDEFINITE, 286 MOJO_DEADLINE_INDEFINITE,
285 base::Bind(&WebURLLoaderImpl::OnResponseBodyStreamReady, 287 base::Bind(&WebURLLoaderImpl::OnResponseBodyStreamReady,
286 weak_factory_.GetWeakPtr())); 288 weak_factory_.GetWeakPtr()));
287 } 289 }
288 290
289 void WebURLLoaderImpl::OnResponseBodyStreamReady(MojoResult result) { 291 void WebURLLoaderImpl::OnResponseBodyStreamReady(MojoResult result) {
290 ReadMore(); 292 ReadMore();
291 } 293 }
292 294
293 } // namespace html_viewer 295 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/html_viewer/web_mime_registry_impl.cc ('k') | components/invalidation/impl/gcm_network_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698