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

Side by Side Diff: chrome/browser/password_manager/password_store.cc

Issue 153943002: Eliminate BrowserThread usage from PasswordStoreDefault. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 10 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/password_manager/password_store.h" 5 #include "chrome/browser/password_manager/password_store.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 observers_.AddObserver(observer); 146 observers_.AddObserver(observer);
147 } 147 }
148 148
149 void PasswordStore::RemoveObserver(Observer* observer) { 149 void PasswordStore::RemoveObserver(Observer* observer) {
150 observers_.RemoveObserver(observer); 150 observers_.RemoveObserver(observer);
151 } 151 }
152 152
153 PasswordStore::~PasswordStore() {} 153 PasswordStore::~PasswordStore() {}
154 154
155 bool PasswordStore::ScheduleTask(const base::Closure& task) { 155 bool PasswordStore::ScheduleTask(const base::Closure& task) {
156 scoped_refptr<base::SequencedTaskRunner> task_runner( 156 scoped_refptr<base::SingleThreadTaskRunner> task_runner(
157 GetBackgroundTaskRunner()); 157 GetBackgroundTaskRunner());
158 if (task_runner.get()) 158 if (task_runner.get())
159 return task_runner->PostTask(FROM_HERE, task); 159 return task_runner->PostTask(FROM_HERE, task);
160 return false; 160 return false;
161 } 161 }
162 162
163 scoped_refptr<base::SequencedTaskRunner> 163 scoped_refptr<base::SingleThreadTaskRunner>
164 PasswordStore::GetBackgroundTaskRunner() { 164 PasswordStore::GetBackgroundTaskRunner() {
165 return db_thread_runner_; 165 return db_thread_runner_;
166 } 166 }
167 167
168 void PasswordStore::ForwardLoginsResult(GetLoginsRequest* request) { 168 void PasswordStore::ForwardLoginsResult(GetLoginsRequest* request) {
169 request->ApplyIgnoreLoginsCutoff(); 169 request->ApplyIgnoreLoginsCutoff();
170 request->ForwardResult(); 170 request->ForwardResult();
171 } 171 }
172 172
173 void PasswordStore::CopyAndForwardLoginsResult( 173 void PasswordStore::CopyAndForwardLoginsResult(
(...skipping 29 matching lines...) Expand all
203 void PasswordStore::PostNotifyLoginsChanged() { 203 void PasswordStore::PostNotifyLoginsChanged() {
204 main_thread_runner_->PostTask( 204 main_thread_runner_->PostTask(
205 FROM_HERE, 205 FROM_HERE,
206 base::Bind(&PasswordStore::NotifyLoginsChanged, this)); 206 base::Bind(&PasswordStore::NotifyLoginsChanged, this));
207 } 207 }
208 208
209 void PasswordStore::NotifyLoginsChanged() { 209 void PasswordStore::NotifyLoginsChanged() {
210 DCHECK(main_thread_runner_->BelongsToCurrentThread()); 210 DCHECK(main_thread_runner_->BelongsToCurrentThread());
211 FOR_EACH_OBSERVER(Observer, observers_, OnLoginsChanged()); 211 FOR_EACH_OBSERVER(Observer, observers_, OnLoginsChanged());
212 } 212 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_store.h ('k') | chrome/browser/password_manager/password_store_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698