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

Side by Side Diff: content/child/blink_platform_impl.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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 "content/child/blink_platform_impl.h" 5 #include "content/child/blink_platform_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 } // namespace 1019 } // namespace
1020 1020
1021 WebData BlinkPlatformImpl::loadResource(const char* name) { 1021 WebData BlinkPlatformImpl::loadResource(const char* name) {
1022 // Some clients will call into this method with an empty |name| when they have 1022 // Some clients will call into this method with an empty |name| when they have
1023 // optional resources. For example, the PopupMenuChromium code can have icons 1023 // optional resources. For example, the PopupMenuChromium code can have icons
1024 // for some Autofill items but not for others. 1024 // for some Autofill items but not for others.
1025 if (!strlen(name)) 1025 if (!strlen(name))
1026 return WebData(); 1026 return WebData();
1027 1027
1028 // Check the name prefix to see if it's an audio resource. 1028 // Check the name prefix to see if it's an audio resource.
1029 if (StartsWithASCII(name, "IRC_Composite", true) || 1029 if (base::StartsWithASCII(name, "IRC_Composite", true) ||
1030 StartsWithASCII(name, "Composite", true)) 1030 base::StartsWithASCII(name, "Composite", true))
1031 return loadAudioSpatializationResource(name); 1031 return loadAudioSpatializationResource(name);
1032 1032
1033 // TODO(flackr): We should use a better than linear search here, a trie would 1033 // TODO(flackr): We should use a better than linear search here, a trie would
1034 // be ideal. 1034 // be ideal.
1035 for (size_t i = 0; i < arraysize(kDataResources); ++i) { 1035 for (size_t i = 0; i < arraysize(kDataResources); ++i) {
1036 if (!strcmp(name, kDataResources[i].name)) { 1036 if (!strcmp(name, kDataResources[i].name)) {
1037 base::StringPiece resource = GetContentClient()->GetDataResource( 1037 base::StringPiece resource = GetContentClient()->GetDataResource(
1038 kDataResources[i].id, kDataResources[i].scale_factor); 1038 kDataResources[i].id, kDataResources[i].scale_factor);
1039 return WebData(resource.data(), resource.size()); 1039 return WebData(resource.data(), resource.size());
1040 } 1040 }
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( 1386 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString(
1387 static_cast<ui::DomCode>(dom_code))); 1387 static_cast<ui::DomCode>(dom_code)));
1388 } 1388 }
1389 1389
1390 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { 1390 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) {
1391 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( 1391 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode(
1392 code.utf8().data())); 1392 code.utf8().data()));
1393 } 1393 }
1394 1394
1395 } // namespace content 1395 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/webui/shared_resources_data_source.cc ('k') | content/child/multipart_response_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698