OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/webdata/common/web_database_service.h" | 5 #include "components/webdata/common/web_database_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "components/webdata/common/web_data_request_manager.h" | 9 #include "components/webdata/common/web_data_request_manager.h" |
10 #include "components/webdata/common/web_data_results.h" | 10 #include "components/webdata/common/web_data_results.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 wds_backend_, false)); | 84 wds_backend_, false)); |
85 } | 85 } |
86 | 86 |
87 WebDatabase* WebDatabaseService::GetDatabaseOnDB() const { | 87 WebDatabase* WebDatabaseService::GetDatabaseOnDB() const { |
88 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 88 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
89 if (!wds_backend_) | 89 if (!wds_backend_) |
90 return NULL; | 90 return NULL; |
91 return wds_backend_->database(); | 91 return wds_backend_->database(); |
92 } | 92 } |
93 | 93 |
| 94 scoped_refptr<WebDataServiceBackend> WebDatabaseService::GetBackend() const { |
| 95 return wds_backend_; |
| 96 } |
| 97 |
94 void WebDatabaseService::ScheduleDBTask( | 98 void WebDatabaseService::ScheduleDBTask( |
95 const tracked_objects::Location& from_here, | 99 const tracked_objects::Location& from_here, |
96 const WriteTask& task) { | 100 const WriteTask& task) { |
97 if (!wds_backend_) { | 101 if (!wds_backend_) { |
98 NOTREACHED() << "Task scheduled after Shutdown()"; | 102 NOTREACHED() << "Task scheduled after Shutdown()"; |
99 return; | 103 return; |
100 } | 104 } |
101 | 105 |
102 scoped_ptr<WebDataRequest> request( | 106 scoped_ptr<WebDataRequest> request( |
103 new WebDataRequest(NULL, wds_backend_->request_manager())); | 107 new WebDataRequest(NULL, wds_backend_->request_manager())); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 FOR_EACH_OBSERVER(WebDatabaseObserver, | 154 FOR_EACH_OBSERVER(WebDatabaseObserver, |
151 observer_list_, | 155 observer_list_, |
152 WebDatabaseLoaded()); | 156 WebDatabaseLoaded()); |
153 } else { | 157 } else { |
154 // Notify that the database load failed. | 158 // Notify that the database load failed. |
155 FOR_EACH_OBSERVER(WebDatabaseObserver, | 159 FOR_EACH_OBSERVER(WebDatabaseObserver, |
156 observer_list_, | 160 observer_list_, |
157 WebDatabaseLoadFailed(status)); | 161 WebDatabaseLoadFailed(status)); |
158 } | 162 } |
159 } | 163 } |
OLD | NEW |