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

Side by Side Diff: content/renderer/fetchers/resource_fetcher_impl.cc

Issue 448143008: Move StringToUpperASCII and LowerCaseEqualsASCII to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/fetchers/resource_fetcher_impl.h" 5 #include "content/renderer/fetchers/resource_fetcher_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "third_party/WebKit/public/platform/Platform.h" 10 #include "third_party/WebKit/public/platform/Platform.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 web_http_body.initialize(); 59 web_http_body.initialize();
60 web_http_body.appendData(blink::WebData(body)); 60 web_http_body.appendData(blink::WebData(body));
61 request_.setHTTPBody(web_http_body); 61 request_.setHTTPBody(web_http_body);
62 } 62 }
63 63
64 void ResourceFetcherImpl::SetHeader(const std::string& header, 64 void ResourceFetcherImpl::SetHeader(const std::string& header,
65 const std::string& value) { 65 const std::string& value) {
66 DCHECK(!request_.isNull()); 66 DCHECK(!request_.isNull());
67 DCHECK(!loader_); 67 DCHECK(!loader_);
68 68
69 if (LowerCaseEqualsASCII(header, "referer")) { 69 if (base::LowerCaseEqualsASCII(header, "referer")) {
70 blink::WebString referrer = WebSecurityPolicy::generateReferrerHeader( 70 blink::WebString referrer = WebSecurityPolicy::generateReferrerHeader(
71 blink::WebReferrerPolicyDefault, 71 blink::WebReferrerPolicyDefault,
72 request_.url(), 72 request_.url(),
73 blink::WebString::fromUTF8(value)); 73 blink::WebString::fromUTF8(value));
74 request_.setHTTPReferrer(referrer, blink::WebReferrerPolicyDefault); 74 request_.setHTTPReferrer(referrer, blink::WebReferrerPolicyDefault);
75 } else { 75 } else {
76 request_.setHTTPHeaderField(blink::WebString::fromUTF8(header), 76 request_.setHTTPHeaderField(blink::WebString::fromUTF8(header),
77 blink::WebString::fromUTF8(value)); 77 blink::WebString::fromUTF8(value));
78 } 78 }
79 } 79 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 void ResourceFetcherImpl::didFail(WebURLLoader* loader, 176 void ResourceFetcherImpl::didFail(WebURLLoader* loader,
177 const WebURLError& error) { 177 const WebURLError& error) {
178 DCHECK(!completed_); 178 DCHECK(!completed_);
179 179
180 // Go ahead and tell our delegate that we're done. 180 // Go ahead and tell our delegate that we're done.
181 RunCallback(WebURLResponse(), std::string()); 181 RunCallback(WebURLResponse(), std::string());
182 } 182 }
183 183
184 } // namespace content 184 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/dom_serializer_browsertest.cc ('k') | content/renderer/media/media_stream_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698