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

Side by Side Diff: chrome/test/live_sync/live_passwords_sync_test.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: git try works all platforms now. Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_ 5 #ifndef CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_
6 #define CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_ 6 #define CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 private: 59 private:
60 class PasswordStoreConsumerHelper : public PasswordStoreConsumer { 60 class PasswordStoreConsumerHelper : public PasswordStoreConsumer {
61 public: 61 public:
62 explicit PasswordStoreConsumerHelper( 62 explicit PasswordStoreConsumerHelper(
63 std::vector<webkit_glue::PasswordForm>& result) 63 std::vector<webkit_glue::PasswordForm>& result)
64 : PasswordStoreConsumer(), result_(result) {} 64 : PasswordStoreConsumer(), result_(result) {}
65 65
66 virtual void OnPasswordStoreRequestDone( 66 virtual void OnPasswordStoreRequestDone(
67 int handle, const std::vector<webkit_glue::PasswordForm*>& result) { 67 PasswordStore::Handle handle,
68 const std::vector<webkit_glue::PasswordForm*>& result) {
68 result_.clear(); 69 result_.clear();
69 for (std::vector<webkit_glue::PasswordForm*>::const_iterator it = 70 for (std::vector<webkit_glue::PasswordForm*>::const_iterator it =
70 result.begin(); it != result.end(); ++it) { 71 result.begin(); it != result.end(); ++it) {
71 // Make a copy of the form since it gets deallocated after the caller of 72 // Make a copy of the form since it gets deallocated after the caller of
72 // this method returns. 73 // this method returns.
73 result_.push_back(**it); 74 result_.push_back(**it);
74 } 75 }
75 MessageLoopForUI::current()->Quit(); 76 MessageLoopForUI::current()->Quit();
76 } 77 }
77 78
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 class ManyClientLivePasswordsSyncTest : public LivePasswordsSyncTest { 117 class ManyClientLivePasswordsSyncTest : public LivePasswordsSyncTest {
117 public: 118 public:
118 ManyClientLivePasswordsSyncTest() : LivePasswordsSyncTest(MANY_CLIENT) {} 119 ManyClientLivePasswordsSyncTest() : LivePasswordsSyncTest(MANY_CLIENT) {}
119 virtual ~ManyClientLivePasswordsSyncTest() {} 120 virtual ~ManyClientLivePasswordsSyncTest() {}
120 121
121 private: 122 private:
122 DISALLOW_COPY_AND_ASSIGN(ManyClientLivePasswordsSyncTest); 123 DISALLOW_COPY_AND_ASSIGN(ManyClientLivePasswordsSyncTest);
123 }; 124 };
124 125
125 #endif // CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_ 126 #endif // CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698