| OLD | NEW |
| 1 // Copyright (c) 2009 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 "chrome/browser/webdata/web_data_service.h" | 5 #include "chrome/browser/webdata/web_data_service.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "base/thread.h" | 10 #include "base/thread.h" |
| 11 #include "chrome/browser/autofill/autofill_profile.h" | 11 #include "chrome/browser/autofill/autofill_profile.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 void WebDataService::UnloadDatabase() { | 65 void WebDataService::UnloadDatabase() { |
| 66 ScheduleTask(NewRunnableMethod(this, &WebDataService::ShutdownDatabase)); | 66 ScheduleTask(NewRunnableMethod(this, &WebDataService::ShutdownDatabase)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void WebDataService::CancelRequest(Handle h) { | 69 void WebDataService::CancelRequest(Handle h) { |
| 70 AutoLock l(pending_lock_); | 70 AutoLock l(pending_lock_); |
| 71 RequestMap::iterator i = pending_requests_.find(h); | 71 RequestMap::iterator i = pending_requests_.find(h); |
| 72 if (i == pending_requests_.end()) { | 72 if (i == pending_requests_.end()) { |
| 73 NOTREACHED() << "Canceling a nonexistant web data service request"; | 73 NOTREACHED() << "Canceling a nonexistent web data service request"; |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 i->second->Cancel(); | 76 i->second->Cancel(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool WebDataService::IsDatabaseLoaded() { | 79 bool WebDataService::IsDatabaseLoaded() { |
| 80 return db_ != NULL; | 80 return db_ != NULL; |
| 81 } | 81 } |
| 82 | 82 |
| 83 WebDatabase* WebDataService::GetDatabase() { | 83 WebDatabase* WebDataService::GetDatabase() { |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 return result_; | 1167 return result_; |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 void WebDataService::WebDataRequest::RequestComplete() { | 1170 void WebDataService::WebDataRequest::RequestComplete() { |
| 1171 WebDataService* s = service_; | 1171 WebDataService* s = service_; |
| 1172 Task* t = NewRunnableMethod(s, | 1172 Task* t = NewRunnableMethod(s, |
| 1173 &WebDataService::RequestCompleted, | 1173 &WebDataService::RequestCompleted, |
| 1174 handle_); | 1174 handle_); |
| 1175 message_loop_->PostTask(FROM_HERE, t); | 1175 message_loop_->PostTask(FROM_HERE, t); |
| 1176 } | 1176 } |
| OLD | NEW |