diff options
author | brettw <brettw@chromium.org> | 2015-07-15 23:48:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-16 06:48:41 +0000 |
commit | edce9a33027cc5f73c4866d70e34f690f6720a56 (patch) | |
tree | a8dbfae7b9ebf5a5cac2bb8a02f59b1637ddfa9c /content | |
parent | fc4f1d1d95a221319f4c275e870e9b7cf2dc5040 (diff) | |
download | chromium_src-edce9a33027cc5f73c4866d70e34f690f6720a56.zip chromium_src-edce9a33027cc5f73c4866d70e34f690f6720a56.tar.gz chromium_src-edce9a33027cc5f73c4866d70e34f690f6720a56.tar.bz2 |
Remove some legacy versions of StartsWith and EndsWith.
This just replaces
true -> base::CompareCase::SENSITIVE
false -> base::CompareCase::INSENSITIVE_ASCII
I checked the insensitive cases to make sure they're not doing anything suspicious. The old version is a sometimes-correct Unicode comparison so converting to INSENSTITIVE_ASCII isn't a no-op. However, generally the prefix/suffix checking is done against a hardcoded string so there were very few cases to actually look at.
extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc has a not-quite search-and-replace change where I changed the type of a class variable.
BUG=506255
TBR=jam
Review URL: https://codereview.chromium.org/1239493005
Cr-Commit-Position: refs/heads/master@{#338996}
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/accessibility/android_granularity_movement_browsertest.cc | 6 | ||||
-rw-r--r-- | content/browser/plugin_browsertest.cc | 2 | ||||
-rw-r--r-- | content/browser/plugin_service_impl.cc | 3 | ||||
-rw-r--r-- | content/browser/web_contents/web_contents_impl.cc | 3 | ||||
-rw-r--r-- | content/browser/webui/web_ui_data_source_impl.cc | 10 | ||||
-rw-r--r-- | content/common/set_process_title.cc | 2 |
6 files changed, 15 insertions, 11 deletions
diff --git a/content/browser/accessibility/android_granularity_movement_browsertest.cc b/content/browser/accessibility/android_granularity_movement_browsertest.cc index 392c262..6ddf830 100644 --- a/content/browser/accessibility/android_granularity_movement_browsertest.cc +++ b/content/browser/accessibility/android_granularity_movement_browsertest.cc @@ -91,7 +91,8 @@ class AndroidGranularityMovementBrowserTest : public ContentBrowserTest { int len = (granularity == GRANULARITY_CHARACTER) ? 1 : end_index - start_index; base::string16 selection = text.substr(start_index, len); - if (base::EndsWith(selection, base::ASCIIToUTF16("\n"), false)) + if (base::EndsWith(selection, base::ASCIIToUTF16("\n"), + base::CompareCase::INSENSITIVE_ASCII)) selection.erase(selection.size() - 1); if (!selection.empty()) { if (!concatenated.empty()) @@ -116,7 +117,8 @@ class AndroidGranularityMovementBrowserTest : public ContentBrowserTest { int len = (granularity == GRANULARITY_CHARACTER) ? 1 : end_index - start_index; base::string16 selection = text.substr(start_index, len); - if (base::EndsWith(selection, base::ASCIIToUTF16("\n"), false)) + if (base::EndsWith(selection, base::ASCIIToUTF16("\n"), + base::CompareCase::INSENSITIVE_ASCII)) selection = selection.substr(0, selection.size() - 1); if (!reverse.empty()) reverse = base::ASCIIToUTF16(", ") + reverse; diff --git a/content/browser/plugin_browsertest.cc b/content/browser/plugin_browsertest.cc index 12969f5..68ff04d 100644 --- a/content/browser/plugin_browsertest.cc +++ b/content/browser/plugin_browsertest.cc @@ -528,7 +528,7 @@ class TestResourceDispatcherHostDelegate // The URL below comes from plugin_geturl_test.cc. if (!base::EndsWith(request->url().spec(), "npapi/plugin_ref_target_page.html", - true)) { + base::CompareCase::SENSITIVE)) { return; } net::HttpRequestHeaders headers; diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index 93140c2..eadffcc 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -581,7 +581,8 @@ base::string16 PluginServiceImpl::GetPluginDisplayNameByPath( // Many plugins on the Mac have .plugin in the actual name, which looks // terrible, so look for that and strip it off if present. const std::string kPluginExtension = ".plugin"; - if (base::EndsWith(plugin_name, base::ASCIIToUTF16(kPluginExtension), true)) + if (base::EndsWith(plugin_name, base::ASCIIToUTF16(kPluginExtension), + base::CompareCase::SENSITIVE)) plugin_name.erase(plugin_name.length() - kPluginExtension.length()); #endif // OS_MACOSX } diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 38903a01..d753e94 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -2987,7 +2987,8 @@ void WebContentsImpl::OnDidRunInsecureContent( LOG(WARNING) << security_origin << " ran insecure content from " << target_url.possibly_invalid_spec(); RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); - if (base::EndsWith(security_origin, kDotGoogleDotCom, false)) + if (base::EndsWith(security_origin, kDotGoogleDotCom, + base::CompareCase::INSENSITIVE_ASCII)) RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); controller_.ssl_manager()->DidRunInsecureContent(security_origin); displayed_insecure_content_ = true; diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc index b401710..09c5896 100644 --- a/content/browser/webui/web_ui_data_source_impl.cc +++ b/content/browser/webui/web_ui_data_source_impl.cc @@ -190,19 +190,19 @@ std::string WebUIDataSourceImpl::GetSource() const { } std::string WebUIDataSourceImpl::GetMimeType(const std::string& path) const { - if (base::EndsWith(path, ".css", false)) + if (base::EndsWith(path, ".css", base::CompareCase::INSENSITIVE_ASCII)) return "text/css"; - if (base::EndsWith(path, ".js", false)) + if (base::EndsWith(path, ".js", base::CompareCase::INSENSITIVE_ASCII)) return "application/javascript"; - if (base::EndsWith(path, ".json", false)) + if (base::EndsWith(path, ".json", base::CompareCase::INSENSITIVE_ASCII)) return "application/json"; - if (base::EndsWith(path, ".pdf", false)) + if (base::EndsWith(path, ".pdf", base::CompareCase::INSENSITIVE_ASCII)) return "application/pdf"; - if (base::EndsWith(path, ".svg", false)) + if (base::EndsWith(path, ".svg", base::CompareCase::INSENSITIVE_ASCII)) return "image/svg+xml"; return "text/html"; diff --git a/content/common/set_process_title.cc b/content/common/set_process_title.cc index 229524e..d74af96 100644 --- a/content/common/set_process_title.cc +++ b/content/common/set_process_title.cc @@ -59,7 +59,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) { // If the binary has since been deleted, Linux appends " (deleted)" to the // symlink target. Remove it, since this is not really part of our name. const std::string kDeletedSuffix = " (deleted)"; - if (base::EndsWith(title, kDeletedSuffix, true)) + if (base::EndsWith(title, kDeletedSuffix, base::CompareCase::SENSITIVE)) title.resize(title.size() - kDeletedSuffix.size()); // PR_SET_NAME is available in Linux 2.6.9 and newer. |