| OLD | NEW |
| 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 "components/webdata/common/web_data_service_base.h" | 5 #include "components/webdata/common/web_data_service_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| 11 #include "components/webdata/common/web_database_service.h" | 11 #include "components/webdata/common/web_database_service.h" |
| 12 | 12 |
| 13 //////////////////////////////////////////////////////////////////////////////// | 13 //////////////////////////////////////////////////////////////////////////////// |
| 14 // | 14 // |
| 15 // WebDataServiceBase implementation. | 15 // WebDataServiceBase implementation. |
| 16 // | 16 // |
| 17 //////////////////////////////////////////////////////////////////////////////// | 17 //////////////////////////////////////////////////////////////////////////////// |
| 18 | 18 |
| 19 using base::Bind; | 19 using base::Bind; |
| 20 using base::Time; | 20 using base::Time; |
| 21 | 21 |
| 22 WebDataServiceBase::WebDataServiceBase( | 22 WebDataServiceBase::WebDataServiceBase( |
| 23 scoped_refptr<WebDatabaseService> wdbs, | 23 scoped_refptr<WebDatabaseService> wdbs, |
| 24 const ProfileErrorCallback& callback, | 24 const ProfileErrorCallback& callback, |
| 25 const scoped_refptr<base::MessageLoopProxy>& ui_thread) | 25 const scoped_refptr<base::MessageLoopProxy>& ui_thread) |
| 26 : base::RefCountedDeleteOnMessageLoop<WebDataServiceBase>(ui_thread), | 26 : base::RefCountedDeleteOnTaskRunner<WebDataServiceBase>(ui_thread), |
| 27 wdbs_(wdbs), | 27 wdbs_(wdbs), |
| 28 profile_error_callback_(callback) { | 28 profile_error_callback_(callback) { |
| 29 } | 29 } |
| 30 | 30 |
| 31 void WebDataServiceBase::ShutdownOnUIThread() { | 31 void WebDataServiceBase::ShutdownOnUIThread() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 void WebDataServiceBase::Init() { | 34 void WebDataServiceBase::Init() { |
| 35 DCHECK(wdbs_.get()); | 35 DCHECK(wdbs_.get()); |
| 36 wdbs_->RegisterDBErrorCallback(profile_error_callback_); | 36 wdbs_->RegisterDBErrorCallback(profile_error_callback_); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 WebDatabase* WebDataServiceBase::GetDatabase() { | 65 WebDatabase* WebDataServiceBase::GetDatabase() { |
| 66 if (!wdbs_.get()) | 66 if (!wdbs_.get()) |
| 67 return NULL; | 67 return NULL; |
| 68 return wdbs_->GetDatabaseOnDB(); | 68 return wdbs_->GetDatabaseOnDB(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 WebDataServiceBase::~WebDataServiceBase() { | 71 WebDataServiceBase::~WebDataServiceBase() { |
| 72 } | 72 } |
| OLD | NEW |