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

Side by Side Diff: trunk/src/chrome/browser/extensions/extension_protocols.cc

Issue 198163004: Revert 257524 "Move IsStringASCII/UTF8 to base namespace." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 | 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 "chrome/browser/extensions/extension_protocols.h" 5 #include "chrome/browser/extensions/extension_protocols.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 void OnMimeTypeRead(std::string* out_mime_type, 157 void OnMimeTypeRead(std::string* out_mime_type,
158 std::string* charset, 158 std::string* charset,
159 std::string* data, 159 std::string* data,
160 std::string* read_mime_type, 160 std::string* read_mime_type,
161 const net::CompletionCallback& callback, 161 const net::CompletionCallback& callback,
162 bool read_result) { 162 bool read_result) {
163 *out_mime_type = *read_mime_type; 163 *out_mime_type = *read_mime_type;
164 if (StartsWithASCII(*read_mime_type, "text/", false)) { 164 if (StartsWithASCII(*read_mime_type, "text/", false)) {
165 // All of our HTML files should be UTF-8 and for other resource types 165 // All of our HTML files should be UTF-8 and for other resource types
166 // (like images), charset doesn't matter. 166 // (like images), charset doesn't matter.
167 DCHECK(base::IsStringUTF8(*data)); 167 DCHECK(IsStringUTF8(*data));
168 *charset = "utf-8"; 168 *charset = "utf-8";
169 } 169 }
170 int result = read_result ? net::OK : net::ERR_INVALID_URL; 170 int result = read_result ? net::OK : net::ERR_INVALID_URL;
171 callback.Run(result); 171 callback.Run(result);
172 } 172 }
173 173
174 // We need the filename of the resource to determine the mime type. 174 // We need the filename of the resource to determine the mime type.
175 base::FilePath filename_; 175 base::FilePath filename_;
176 176
177 // The resource bundle id to load. 177 // The resource bundle id to load.
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 follow_symlinks_anywhere); 636 follow_symlinks_anywhere);
637 } 637 }
638 638
639 } // namespace 639 } // namespace
640 640
641 net::URLRequestJobFactory::ProtocolHandler* CreateExtensionProtocolHandler( 641 net::URLRequestJobFactory::ProtocolHandler* CreateExtensionProtocolHandler(
642 Profile::ProfileType profile_type, 642 Profile::ProfileType profile_type,
643 extensions::InfoMap* extension_info_map) { 643 extensions::InfoMap* extension_info_map) {
644 return new ExtensionProtocolHandler(profile_type, extension_info_map); 644 return new ExtensionProtocolHandler(profile_type, extension_info_map);
645 } 645 }
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/extensions/convert_user_script.cc ('k') | trunk/src/chrome/browser/internal_auth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698