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

Side by Side Diff: chrome/browser/extensions/url_request_util.cc

Issue 270183002: Move IsStringUTF8/ASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more minor nit Created 6 years, 7 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 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 "chrome/browser/extensions/url_request_util.h" 5 #include "chrome/browser/extensions/url_request_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void OnMimeTypeRead(std::string* out_mime_type, 100 void OnMimeTypeRead(std::string* out_mime_type,
101 std::string* charset, 101 std::string* charset,
102 std::string* data, 102 std::string* data,
103 std::string* read_mime_type, 103 std::string* read_mime_type,
104 const net::CompletionCallback& callback, 104 const net::CompletionCallback& callback,
105 bool read_result) { 105 bool read_result) {
106 *out_mime_type = *read_mime_type; 106 *out_mime_type = *read_mime_type;
107 if (StartsWithASCII(*read_mime_type, "text/", false)) { 107 if (StartsWithASCII(*read_mime_type, "text/", false)) {
108 // All of our HTML files should be UTF-8 and for other resource types 108 // All of our HTML files should be UTF-8 and for other resource types
109 // (like images), charset doesn't matter. 109 // (like images), charset doesn't matter.
110 DCHECK(IsStringUTF8(*data)); 110 DCHECK(base::IsStringUTF8(*data));
111 *charset = "utf-8"; 111 *charset = "utf-8";
112 } 112 }
113 int result = read_result ? net::OK : net::ERR_INVALID_URL; 113 int result = read_result ? net::OK : net::ERR_INVALID_URL;
114 callback.Run(result); 114 callback.Run(result);
115 } 115 }
116 116
117 // We need the filename of the resource to determine the mime type. 117 // We need the filename of the resource to determine the mime type.
118 base::FilePath filename_; 118 base::FilePath filename_;
119 119
120 // The resource bundle id to load. 120 // The resource bundle id to load.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 content::ResourceRequestInfo::ForRequest(request); 244 content::ResourceRequestInfo::ForRequest(request);
245 ExtensionRendererState* renderer_state = 245 ExtensionRendererState* renderer_state =
246 ExtensionRendererState::GetInstance(); 246 ExtensionRendererState::GetInstance();
247 ExtensionRendererState::WebViewInfo webview_info; 247 ExtensionRendererState::WebViewInfo webview_info;
248 return renderer_state->GetWebViewInfo( 248 return renderer_state->GetWebViewInfo(
249 info->GetChildID(), info->GetRouteID(), &webview_info); 249 info->GetChildID(), info->GetRouteID(), &webview_info);
250 } 250 }
251 251
252 } // namespace url_request_util 252 } // namespace url_request_util
253 } // namespace extensions 253 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_garbage_collector.cc ('k') | chrome/browser/internal_auth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698