diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/devtools_http_handler/devtools_http_handler.cc | 12 | ||||
-rw-r--r-- | components/dom_distiller/core/page_features.cc | 7 | ||||
-rw-r--r-- | components/google/core/browser/google_util.cc | 2 | ||||
-rw-r--r-- | components/omnibox/keyword_provider.cc | 2 | ||||
-rw-r--r-- | components/omnibox/search_suggestion_parser.cc | 2 | ||||
-rw-r--r-- | components/password_manager/core/browser/password_manager.cc | 2 | ||||
-rw-r--r-- | components/plugins/renderer/mobile_youtube_plugin.cc | 4 | ||||
-rw-r--r-- | components/plugins/renderer/plugin_placeholder.cc | 4 | ||||
-rw-r--r-- | components/search/search.cc | 2 | ||||
-rw-r--r-- | components/storage_monitor/volume_mount_watcher_win.cc | 2 | ||||
-rw-r--r-- | components/test_runner/web_test_proxy.cc | 2 | ||||
-rw-r--r-- | components/translate/core/browser/translate_language_list.cc | 2 | ||||
-rw-r--r-- | components/variations/net/variations_http_header_provider.cc | 2 | ||||
-rw-r--r-- | components/wifi/wifi_service_win.cc | 2 |
14 files changed, 25 insertions, 22 deletions
diff --git a/components/devtools_http_handler/devtools_http_handler.cc b/components/devtools_http_handler/devtools_http_handler.cc index 1255dbf..16e7d04 100644 --- a/components/devtools_http_handler/devtools_http_handler.cc +++ b/components/devtools_http_handler/devtools_http_handler.cc @@ -359,17 +359,17 @@ static std::string PathWithoutParams(const std::string& path) { } static std::string GetMimeType(const std::string& filename) { - if (EndsWith(filename, ".html", false)) { + if (base::EndsWith(filename, ".html", false)) { return "text/html"; - } else if (EndsWith(filename, ".css", false)) { + } else if (base::EndsWith(filename, ".css", false)) { return "text/css"; - } else if (EndsWith(filename, ".js", false)) { + } else if (base::EndsWith(filename, ".js", false)) { return "application/javascript"; - } else if (EndsWith(filename, ".png", false)) { + } else if (base::EndsWith(filename, ".png", false)) { return "image/png"; - } else if (EndsWith(filename, ".gif", false)) { + } else if (base::EndsWith(filename, ".gif", false)) { return "image/gif"; - } else if (EndsWith(filename, ".json", false)) { + } else if (base::EndsWith(filename, ".json", false)) { return "application/json"; } LOG(ERROR) << "GetMimeType doesn't know mime type for: " diff --git a/components/dom_distiller/core/page_features.cc b/components/dom_distiller/core/page_features.cc index 7d3115c..f931bbe 100644 --- a/components/dom_distiller/core/page_features.cc +++ b/components/dom_distiller/core/page_features.cc @@ -16,6 +16,7 @@ namespace dom_distiller { */ namespace { + std::string GetLastSegment(const std::string& path) { // return re.search('[^/]*\/?$', path).group(0) if (path.size() == 0) @@ -46,7 +47,8 @@ bool EndsWith(const std::string& t, const std::string& s) { return s.size() >= t.size() && s.compare(s.size() - t.size(), std::string::npos, t) == 0; } -} + +} // namespace int kDerivedFeaturesCount = 29; @@ -176,4 +178,5 @@ std::vector<double> CalculateDerivedFeaturesFromJSON( numAnchors, numForms, innerText, textContent, innerHTML); } -} + +} // namespace dom_distiller diff --git a/components/google/core/browser/google_util.cc b/components/google/core/browser/google_util.cc index 4d7d9d7..5326502 100644 --- a/components/google/core/browser/google_util.cc +++ b/components/google/core/browser/google_util.cc @@ -57,7 +57,7 @@ bool IsValidHostName(const std::string& host, if (base::LowerCaseEqualsASCII(host_minus_tld, domain_in_lower_case.c_str())) return true; if (subdomain_permission == google_util::ALLOW_SUBDOMAIN) - return EndsWith(host_minus_tld, "." + domain_in_lower_case, false); + return base::EndsWith(host_minus_tld, "." + domain_in_lower_case, false); return base::LowerCaseEqualsASCII(host_minus_tld, ("www." + domain_in_lower_case).c_str()); } diff --git a/components/omnibox/keyword_provider.cc b/components/omnibox/keyword_provider.cc index 13b2710..d805b09 100644 --- a/components/omnibox/keyword_provider.cc +++ b/components/omnibox/keyword_provider.cc @@ -138,7 +138,7 @@ const TemplateURL* KeywordProvider::GetSubstitutingTemplateURLForInput( // of the original input. if (input->cursor_position() != base::string16::npos && !remaining_input.empty() && - EndsWith(input->text(), remaining_input, true)) { + base::EndsWith(input->text(), remaining_input, true)) { int offset = input->text().length() - input->cursor_position(); // The cursor should never be past the last character or before the // first character. diff --git a/components/omnibox/search_suggestion_parser.cc b/components/omnibox/search_suggestion_parser.cc index ecf580d..5ef4201 100644 --- a/components/omnibox/search_suggestion_parser.cc +++ b/components/omnibox/search_suggestion_parser.cc @@ -149,7 +149,7 @@ void SearchSuggestionParser::SuggestResult::ClassifyMatchContents( // Ensure the query starts with the input text, and ends with the match // contents, and the input text has an overlap with contents. if (base::StartsWith(suggestion_, input_text, true) && - EndsWith(suggestion_, match_contents_, true) && + base::EndsWith(suggestion_, match_contents_, true) && (input_text.length() > contents_index)) { lookup_text = input_text.substr(contents_index); } diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index 8f9c6fa..4ff4f02 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc @@ -424,7 +424,7 @@ void PasswordManager::CreatePendingLoginManagers( iter != forms.end(); ++iter) { // Don't involve the password manager if this form corresponds to // SpdyProxy authentication, as indicated by the realm. - if (EndsWith(iter->signon_realm, kSpdyProxyRealm, true)) + if (base::EndsWith(iter->signon_realm, kSpdyProxyRealm, true)) continue; bool old_manager_found = false; for (const auto& old_manager : old_login_managers) { diff --git a/components/plugins/renderer/mobile_youtube_plugin.cc b/components/plugins/renderer/mobile_youtube_plugin.cc index 9745a0a..af24a2b 100644 --- a/components/plugins/renderer/mobile_youtube_plugin.cc +++ b/components/plugins/renderer/mobile_youtube_plugin.cc @@ -89,8 +89,8 @@ MobileYouTubePlugin::~MobileYouTubePlugin() {} bool MobileYouTubePlugin::IsYouTubeURL(const GURL& url, const std::string& mime_type) { std::string host = url.host(); - bool is_youtube = EndsWith(host, "youtube.com", true) || - EndsWith(host, "youtube-nocookie.com", true); + bool is_youtube = base::EndsWith(host, "youtube.com", true) || + base::EndsWith(host, "youtube-nocookie.com", true); return is_youtube && IsValidYouTubeVideo(url.path()) && base::LowerCaseEqualsASCII(mime_type, diff --git a/components/plugins/renderer/plugin_placeholder.cc b/components/plugins/renderer/plugin_placeholder.cc index 7ef233d..b44cbe9 100644 --- a/components/plugins/renderer/plugin_placeholder.cc +++ b/components/plugins/renderer/plugin_placeholder.cc @@ -78,14 +78,14 @@ void PluginPlaceholderBase::HidePlugin() { if (element.hasAttribute("width") && element.hasAttribute("height")) { std::string width_str("width:[\\s]*"); width_str += element.getAttribute("width").utf8().data(); - if (EndsWith(width_str, "px", false)) { + if (base::EndsWith(width_str, "px", false)) { width_str = width_str.substr(0, width_str.length() - 2); } base::TrimWhitespace(width_str, base::TRIM_TRAILING, &width_str); width_str += "[\\s]*px"; std::string height_str("height:[\\s]*"); height_str += element.getAttribute("height").utf8().data(); - if (EndsWith(height_str, "px", false)) { + if (base::EndsWith(height_str, "px", false)) { height_str = height_str.substr(0, height_str.length() - 2); } base::TrimWhitespace(height_str, base::TRIM_TRAILING, &height_str); diff --git a/components/search/search.cc b/components/search/search.cc index 9afd666..8c50d16 100644 --- a/components/search/search.cc +++ b/components/search/search.cc @@ -90,7 +90,7 @@ bool GetFieldTrialInfo(FieldTrialFlags* flags) { kInstantExtendedFieldTrialName); } - if (EndsWith(group_name, kDisablingSuffix, true)) + if (base::EndsWith(group_name, kDisablingSuffix, true)) return false; // We have a valid trial that isn't disabled. Extract the flags. diff --git a/components/storage_monitor/volume_mount_watcher_win.cc b/components/storage_monitor/volume_mount_watcher_win.cc index bdc7634..0828db5 100644 --- a/components/storage_monitor/volume_mount_watcher_win.cc +++ b/components/storage_monitor/volume_mount_watcher_win.cc @@ -70,7 +70,7 @@ DeviceType GetDeviceType(const base::string16& mount_point) { // Check device strings of the form "X:" and "\\.\X:" // For floppy drives, these will return strings like "/Device/Floppy0" base::string16 device = mount_point; - if (EndsWith(mount_point, L"\\", false)) + if (base::EndsWith(mount_point, L"\\", false)) device = mount_point.substr(0, mount_point.length() - 1); base::string16 device_path; base::string16 device_path_slash; diff --git a/components/test_runner/web_test_proxy.cc b/components/test_runner/web_test_proxy.cc index 2f0c0c7..b363120 100644 --- a/components/test_runner/web_test_proxy.cc +++ b/components/test_runner/web_test_proxy.cc @@ -199,7 +199,7 @@ bool IsLocalHost(const std::string& host) { } bool IsTestHost(const std::string& host) { - return EndsWith(host, ".test", false); + return base::EndsWith(host, ".test", false); } bool HostIsUsedBySomeTestsToGenerateError(const std::string& host) { diff --git a/components/translate/core/browser/translate_language_list.cc b/components/translate/core/browser/translate_language_list.cc index 1b1bfed..c3a16f1 100644 --- a/components/translate/core/browser/translate_language_list.cc +++ b/components/translate/core/browser/translate_language_list.cc @@ -267,7 +267,7 @@ void TranslateLanguageList::SetSupportedLanguages( if (!base::StartsWithASCII(language_list, TranslateLanguageList::kLanguageListCallbackName, false) || - !EndsWith(language_list, ")", false)) { + !base::EndsWith(language_list, ")", false)) { // We don't have a NOTREACHED here since this can happen in ui_tests, even // though the the BrowserMain function won't call us with parameters.ui_task // is NULL some tests don't set it, so we must bail here. diff --git a/components/variations/net/variations_http_header_provider.cc b/components/variations/net/variations_http_header_provider.cc index fae7c95..00aa5d6 100644 --- a/components/variations/net/variations_http_header_provider.cc +++ b/components/variations/net/variations_http_header_provider.cc @@ -280,7 +280,7 @@ bool VariationsHttpHeaderProvider::ShouldAppendHeaders(const GURL& url) { // is very straight forward. const std::string host = url.host(); for (size_t i = 0; i < arraysize(kSuffixesToSetHeadersFor); ++i) { - if (EndsWith(host, kSuffixesToSetHeadersFor[i], false)) + if (base::EndsWith(host, kSuffixesToSetHeadersFor[i], false)) return true; } diff --git a/components/wifi/wifi_service_win.cc b/components/wifi/wifi_service_win.cc index f232000..5145fba 100644 --- a/components/wifi/wifi_service_win.cc +++ b/components/wifi/wifi_service_win.cc @@ -1152,7 +1152,7 @@ DWORD WiFiServiceImpl::FindAdapterIndexMapByGUID( error = GetInterfaceInfo(interface_info, &buffer_length); if (error == ERROR_SUCCESS) { for (int adapter = 0; adapter < interface_info->NumAdapters; ++adapter) { - if (EndsWith( + if (base::EndsWith( interface_info->Adapter[adapter].Name, guid_string, false)) { *adapter_index_map = interface_info->Adapter[adapter]; break; |