| 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 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BACKEND_H_ | 5 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BACKEND_H_ |
| 6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BACKEND_H_ | 6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BACKEND_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void DBReadTaskWrapper( | 69 void DBReadTaskWrapper( |
| 70 const WebDatabaseService::ReadTask& task, | 70 const WebDatabaseService::ReadTask& task, |
| 71 scoped_ptr<WebDataRequest> request); | 71 scoped_ptr<WebDataRequest> request); |
| 72 | 72 |
| 73 const scoped_refptr<WebDataRequestManager>& request_manager() { | 73 const scoped_refptr<WebDataRequestManager>& request_manager() { |
| 74 return request_manager_; | 74 return request_manager_; |
| 75 } | 75 } |
| 76 | 76 |
| 77 WebDatabase* database() { return db_.get(); } | 77 WebDatabase* database() { return db_.get(); } |
| 78 | 78 |
| 79 // Asynchronously gets a weak ptr to |db_|. |
| 80 void GetDatabaseAsync(const WebDatabaseService::DBCallback& callback); |
| 81 |
| 79 private: | 82 private: |
| 80 friend struct content::BrowserThread::DeleteOnThread< | 83 friend struct content::BrowserThread::DeleteOnThread< |
| 81 content::BrowserThread::DB>; | 84 content::BrowserThread::DB>; |
| 82 friend class base::DeleteHelper<WebDataServiceBackend>; | 85 friend class base::DeleteHelper<WebDataServiceBackend>; |
| 83 | 86 |
| 84 virtual ~WebDataServiceBackend(); | 87 virtual ~WebDataServiceBackend(); |
| 85 | 88 |
| 86 // Commit the current transaction. | 89 // Commit the current transaction. |
| 87 void Commit(); | 90 void Commit(); |
| 88 | 91 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 112 // fails), used to avoid continually trying to reinit if the db init fails. | 115 // fails), used to avoid continually trying to reinit if the db init fails. |
| 113 bool init_complete_; | 116 bool init_complete_; |
| 114 | 117 |
| 115 // Delegate. See the class definition above for more information. | 118 // Delegate. See the class definition above for more information. |
| 116 scoped_ptr<Delegate> delegate_; | 119 scoped_ptr<Delegate> delegate_; |
| 117 | 120 |
| 118 DISALLOW_COPY_AND_ASSIGN(WebDataServiceBackend); | 121 DISALLOW_COPY_AND_ASSIGN(WebDataServiceBackend); |
| 119 }; | 122 }; |
| 120 | 123 |
| 121 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BACKEND_H_ | 124 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BACKEND_H_ |
| OLD | NEW |