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

Unified Diff: chrome/browser/password_manager/native_backend_gnome_x.cc

Issue 1858513002: chrome/browser/password_manager: scoped_ptr -> unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows -- revert unwanted change Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/native_backend_gnome_x.cc
diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc
index a0d4f1f6d4305f2d6e65c440f28af8bf4bff54e6..ded031e6053e3afb86159da548880481154ff1ed 100644
--- a/chrome/browser/password_manager/native_backend_gnome_x.cc
+++ b/chrome/browser/password_manager/native_backend_gnome_x.cc
@@ -8,13 +8,14 @@
#include <gnome-keyring.h>
#include <stddef.h>
#include <stdint.h>
+
#include <map>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
@@ -109,7 +110,8 @@ const char kGnomeKeyringAppString[] = "chrome";
// Convert the attributes of a given keyring entry into a new PasswordForm.
// Note: does *not* get the actual password, as that is not a key attribute!
// Returns NULL if the attributes are for the wrong application.
-scoped_ptr<PasswordForm> FormFromAttributes(GnomeKeyringAttributeList* attrs) {
+std::unique_ptr<PasswordForm> FormFromAttributes(
+ GnomeKeyringAttributeList* attrs) {
// Read the string and int attributes into the appropriate map.
std::map<std::string, std::string> string_attr_map;
std::map<std::string, uint32_t> uint_attr_map;
@@ -123,9 +125,9 @@ scoped_ptr<PasswordForm> FormFromAttributes(GnomeKeyringAttributeList* attrs) {
// Check to make sure this is a password we care about.
const std::string& app_value = string_attr_map["application"];
if (!base::StringPiece(app_value).starts_with(kGnomeKeyringAppString))
- return scoped_ptr<PasswordForm>();
+ return std::unique_ptr<PasswordForm>();
- scoped_ptr<PasswordForm> form(new PasswordForm());
+ std::unique_ptr<PasswordForm> form(new PasswordForm());
form->origin = GURL(string_attr_map["origin_url"]);
form->action = GURL(string_attr_map["action_url"]);
form->username_element = UTF8ToUTF16(string_attr_map["username_element"]);
@@ -194,7 +196,7 @@ ScopedVector<PasswordForm> ConvertFormList(GList* found,
GnomeKeyringFound* data = static_cast<GnomeKeyringFound*>(element->data);
GnomeKeyringAttributeList* attrs = data->attributes;
- scoped_ptr<PasswordForm> form(FormFromAttributes(attrs));
+ std::unique_ptr<PasswordForm> form(FormFromAttributes(attrs));
if (form) {
if (lookup_form && form->signon_realm != lookup_form->signon_realm) {
if (lookup_form->scheme != PasswordForm::SCHEME_HTML ||
@@ -305,8 +307,9 @@ class GKRMethod : public GnomeKeyringLoader {
}
};
- typedef scoped_ptr<GnomeKeyringAttributeList,
- GnomeKeyringAttributeListFreeDeleter> ScopedAttributeList;
+ typedef std::unique_ptr<GnomeKeyringAttributeList,
+ GnomeKeyringAttributeListFreeDeleter>
+ ScopedAttributeList;
// Helper methods to abbreviate Gnome Keyring long API names.
static void AppendString(ScopedAttributeList* list,
@@ -338,7 +341,7 @@ class GKRMethod : public GnomeKeyringLoader {
// Additionally, |lookup_form_->signon_realm| is also used to narrow down the
// found logins to those which indeed PSL-match the look-up. And finally,
// |lookup_form_| set to NULL means that PSL matching is not required.
- scoped_ptr<PasswordForm> lookup_form_;
+ std::unique_ptr<PasswordForm> lookup_form_;
};
void GKRMethod::AddLogin(const PasswordForm& form, const char* app_string) {

Powered by Google App Engine
This is Rietveld 408576698