OLD | NEW |
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 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/stl_util-inl.h" | 6 #include "base/stl_util-inl.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 public: | 55 public: |
56 DBThreadObserverHelper() : done_event_(true, false) {} | 56 DBThreadObserverHelper() : done_event_(true, false) {} |
57 | 57 |
58 void Init(PasswordStore* password_store) { | 58 void Init(PasswordStore* password_store) { |
59 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 59 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
60 BrowserThread::PostTask( | 60 BrowserThread::PostTask( |
61 BrowserThread::DB, | 61 BrowserThread::DB, |
62 FROM_HERE, | 62 FROM_HERE, |
63 NewRunnableMethod(this, | 63 NewRunnableMethod(this, |
64 &DBThreadObserverHelper::AddObserverTask, | 64 &DBThreadObserverHelper::AddObserverTask, |
65 password_store)); | 65 make_scoped_refptr(password_store))); |
66 done_event_.Wait(); | 66 done_event_.Wait(); |
67 } | 67 } |
68 | 68 |
69 virtual ~DBThreadObserverHelper() { | 69 virtual ~DBThreadObserverHelper() { |
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
71 registrar_.RemoveAll(); | 71 registrar_.RemoveAll(); |
72 } | 72 } |
73 | 73 |
74 NotificationObserverMock& observer() { | 74 NotificationObserverMock& observer() { |
75 return observer_; | 75 return observer_; |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 expected_delete_changes))))); | 503 expected_delete_changes))))); |
504 | 504 |
505 // Deleting the login should trigger a notification. | 505 // Deleting the login should trigger a notification. |
506 store->RemoveLogin(*form); | 506 store->RemoveLogin(*form); |
507 | 507 |
508 // Wait for PasswordStore to send the notification. | 508 // Wait for PasswordStore to send the notification. |
509 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 509 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
510 new SignalingTask(&done)); | 510 new SignalingTask(&done)); |
511 done.Wait(); | 511 done.Wait(); |
512 } | 512 } |
OLD | NEW |