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.h" | 8 #include "base/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" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return; | 64 return; |
65 wdbs_->ShutdownDatabase(); | 65 wdbs_->ShutdownDatabase(); |
66 } | 66 } |
67 | 67 |
68 void WebDataServiceBase::CancelRequest(Handle h) { | 68 void WebDataServiceBase::CancelRequest(Handle h) { |
69 if (!wdbs_.get()) | 69 if (!wdbs_.get()) |
70 return; | 70 return; |
71 wdbs_->CancelRequest(h); | 71 wdbs_->CancelRequest(h); |
72 } | 72 } |
73 | 73 |
74 content::NotificationSource WebDataServiceBase::GetNotificationSource() { | |
75 return content::Source<WebDataServiceBase>(this); | |
76 } | |
77 | |
78 bool WebDataServiceBase::IsDatabaseLoaded() { | 74 bool WebDataServiceBase::IsDatabaseLoaded() { |
79 return db_loaded_; | 75 return db_loaded_; |
80 } | 76 } |
81 | 77 |
82 void WebDataServiceBase::AddDBObserver(WebDatabaseObserver* observer) { | 78 void WebDataServiceBase::AddDBObserver(WebDatabaseObserver* observer) { |
83 if (!wdbs_.get()) | 79 if (!wdbs_.get()) |
84 return; | 80 return; |
85 wdbs_->AddObserver(observer); | 81 wdbs_->AddObserver(observer); |
86 } | 82 } |
87 | 83 |
88 void WebDataServiceBase::RemoveDBObserver(WebDatabaseObserver* observer) { | 84 void WebDataServiceBase::RemoveDBObserver(WebDatabaseObserver* observer) { |
89 if (!wdbs_.get()) | 85 if (!wdbs_.get()) |
90 return; | 86 return; |
91 wdbs_->RemoveObserver(observer); | 87 wdbs_->RemoveObserver(observer); |
92 } | 88 } |
93 | 89 |
94 WebDatabase* WebDataServiceBase::GetDatabase() { | 90 WebDatabase* WebDataServiceBase::GetDatabase() { |
95 if (!wdbs_.get()) | 91 if (!wdbs_.get()) |
96 return NULL; | 92 return NULL; |
97 return wdbs_->GetDatabaseOnDB(); | 93 return wdbs_->GetDatabaseOnDB(); |
98 } | 94 } |
99 | 95 |
100 WebDataServiceBase::~WebDataServiceBase() { | 96 WebDataServiceBase::~WebDataServiceBase() { |
101 } | 97 } |
OLD | NEW |