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

Side by Side Diff: chrome/browser/password_manager/password_store_win.h

Issue 6646051: Fix DCHECK, memory leak, and refactor PasswordStore to use CancelableRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use non-zero tests until http://crbug.com/77650 is addressed. Created 9 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
11 11
(...skipping 15 matching lines...) Expand all
27 virtual int GetLogins(const webkit_glue::PasswordForm& form, 27 virtual int GetLogins(const webkit_glue::PasswordForm& form,
28 PasswordStoreConsumer* consumer); 28 PasswordStoreConsumer* consumer);
29 29
30 private: 30 private:
31 virtual ~PasswordStoreWin(); 31 virtual ~PasswordStoreWin();
32 32
33 // See PasswordStoreDefault. 33 // See PasswordStoreDefault.
34 void OnWebDataServiceRequestDone(WebDataService::Handle h, 34 void OnWebDataServiceRequestDone(WebDataService::Handle h,
35 const WDTypedResult* result); 35 const WDTypedResult* result);
36 36
37 virtual void NotifyConsumer( 37 virtual void ForwardLoginsResult(GetLoginsRequest* request);
38 GetLoginsRequest* request,
39 const std::vector<webkit_glue::PasswordForm*> forms);
40 38
41 // Takes ownership of |request| and tracks it under |handle|. 39 // Takes ownership of |request| and tracks it under |handle|.
42 void TrackRequest(WebDataService::Handle handle, GetLoginsRequest* request); 40 void TrackRequest(WebDataService::Handle handle, GetLoginsRequest* request);
43 41
44 // Finds the GetLoginsRequest associated with the in-flight WebDataService 42 // Finds the GetLoginsRequest associated with the in-flight WebDataService
45 // request identified by |handle|, removes it from the tracking list, and 43 // request identified by |handle|, removes it from the tracking list, and
46 // returns it. Ownership of the GetLoginsRequest passes to the caller. 44 // returns it. Ownership of the GetLoginsRequest passes to the caller.
47 // Returns NULL if the request has been cancelled. 45 // Returns NULL if the request has been cancelled.
48 GetLoginsRequest* TakeRequestWithHandle(WebDataService::Handle handle); 46 GetLoginsRequest* TakeRequestWithHandle(WebDataService::Handle handle);
49 47
50 // Gets logins from IE7 if no others are found. Also copies them into 48 // Gets logins from IE7 if no others are found. Also copies them into
51 // Chrome's WebDatabase so we don't need to look next time. 49 // Chrome's WebDatabase so we don't need to look next time.
52 webkit_glue::PasswordForm* GetIE7Result( 50 webkit_glue::PasswordForm* GetIE7Result(
53 const WDTypedResult* result, 51 const WDTypedResult* result,
54 const webkit_glue::PasswordForm& form); 52 const webkit_glue::PasswordForm& form);
55 53
56 // Holds requests associated with in-flight GetLogin queries. 54 // Holds requests associated with in-flight GetLogin queries.
57 typedef std::map<int, GetLoginsRequest*> PendingRequestMap; 55 typedef std::map<int, GetLoginsRequest*> PendingRequestMap;
58 PendingRequestMap pending_requests_; 56 PendingRequestMap pending_requests_;
59 57
60 // Holds forms associated with in-flight GetLogin queries. 58 // Holds forms associated with in-flight GetLogin queries.
61 typedef std::map<int, webkit_glue::PasswordForm> PendingRequestFormMap; 59 typedef std::map<int, webkit_glue::PasswordForm> PendingRequestFormMap;
62 PendingRequestFormMap pending_request_forms_; 60 PendingRequestFormMap pending_request_forms_;
63 61
64 DISALLOW_COPY_AND_ASSIGN(PasswordStoreWin); 62 DISALLOW_COPY_AND_ASSIGN(PasswordStoreWin);
65 }; 63 };
66 64
67 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ 65 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_store_mac_unittest.cc ('k') | chrome/browser/password_manager/password_store_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698