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

Side by Side Diff: components/autofill/core/common/password_form.h

Issue 1096983002: Update usages of std::map to use ScopedPtrMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@passwordmanager-scopedmemory
Patch Set: Rebase. Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ 5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ 6 #define COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/containers/scoped_ptr_map.h"
13 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h" 14 #include "base/time/time.h"
13 #include "components/autofill/core/common/form_data.h" 15 #include "components/autofill/core/common/form_data.h"
14 #include "url/gurl.h" 16 #include "url/gurl.h"
15 17
16 namespace autofill { 18 namespace autofill {
17 19
18 // The PasswordForm struct encapsulates information about a login form, 20 // The PasswordForm struct encapsulates information about a login form,
19 // which can be an HTML form or a dialog with username/password text fields. 21 // which can be an HTML form or a dialog with username/password text fields.
20 // 22 //
21 // The Web Data database stores saved username/passwords and associated form 23 // The Web Data database stores saved username/passwords and associated form
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 275
274 // Equality operators for testing. 276 // Equality operators for testing.
275 bool operator==(const PasswordForm& form) const; 277 bool operator==(const PasswordForm& form) const;
276 bool operator!=(const PasswordForm& form) const; 278 bool operator!=(const PasswordForm& form) const;
277 279
278 PasswordForm(); 280 PasswordForm();
279 ~PasswordForm(); 281 ~PasswordForm();
280 }; 282 };
281 283
282 // Map username to PasswordForm* for convenience. See password_form_manager.h. 284 // Map username to PasswordForm* for convenience. See password_form_manager.h.
283 typedef std::map<base::string16, PasswordForm*> PasswordFormMap; 285 typedef base::ScopedPtrMap<base::string16, scoped_ptr<PasswordForm>>
286 PasswordFormMap;
284 287
288 // Like PasswordFormMap, but with weak (not owned) pointers.
285 typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap; 289 typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap;
286 290
287 // For testing. 291 // For testing.
288 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); 292 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout);
289 std::ostream& operator<<(std::ostream& os, const autofill::PasswordForm& form); 293 std::ostream& operator<<(std::ostream& os, const autofill::PasswordForm& form);
290 std::ostream& operator<<(std::ostream& os, autofill::PasswordForm* form); 294 std::ostream& operator<<(std::ostream& os, autofill::PasswordForm* form);
291 295
292 } // namespace autofill 296 } // namespace autofill
293 297
294 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ 298 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__
OLDNEW
« no previous file with comments | « chromeos/dbus/shill_profile_client.cc ('k') | components/autofill/core/common/password_form_fill_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698