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

Unified Diff: content/browser/plugin_service_impl.cc

Issue 2119283002: Use container::back() and container::pop_back() for content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/plugin_service_impl.cc
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc
index c81e19b6b234a1fcf979d52c6bd2d6a2d8e8fd8c..b4f9eb0a9aef71abc9c92a3d296d90fc51d23102 100644
--- a/content/browser/plugin_service_impl.cc
+++ b/content/browser/plugin_service_impl.cc
@@ -334,15 +334,10 @@ void PluginServiceImpl::RegisterPepperPlugins() {
// There should generally be very few plugins so a brute-force search is fine.
PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo(
const base::FilePath& plugin_path) {
- PepperPluginInfo* info = NULL;
for (size_t i = 0; i < ppapi_plugins_.size(); ++i) {
- if (ppapi_plugins_[i].path == plugin_path) {
- info = &ppapi_plugins_[i];
- break;
- }
+ if (ppapi_plugins_[i].path == plugin_path)
+ return &ppapi_plugins_[i];
}
- if (info)
- return info;
// We did not find the plugin in our list. But wait! the plugin can also
// be a latecomer, as it happens with pepper flash. This information
// can be obtained from the PluginList singleton and we can use it to
@@ -350,12 +345,12 @@ PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo(
// in the renderer side in PepperPluginRegistry.
WebPluginInfo webplugin_info;
if (!GetPluginInfoByPath(plugin_path, &webplugin_info))
- return NULL;
+ return nullptr;
PepperPluginInfo new_pepper_info;
if (!MakePepperPluginInfo(webplugin_info, &new_pepper_info))
- return NULL;
+ return nullptr;
ppapi_plugins_.push_back(new_pepper_info);
- return &ppapi_plugins_[ppapi_plugins_.size() - 1];
+ return &ppapi_plugins_.back();
}
void PluginServiceImpl::SetFilter(PluginServiceFilter* filter) {

Powered by Google App Engine
This is Rietveld 408576698