| 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 "chrome/browser/webdata/web_database_service_impl.h" | 5 #include "chrome/browser/webdata/web_database_service_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "chrome/browser/api/webdata/web_data_results.h" | 10 #include "chrome/browser/api/webdata/web_data_results.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 db_->CommitTransaction(); | 175 db_->CommitTransaction(); |
| 176 db_->BeginTransaction(); | 176 db_->BeginTransaction(); |
| 177 } else { | 177 } else { |
| 178 NOTREACHED() << "Commit scheduled after Shutdown()"; | 178 NOTREACHED() << "Commit scheduled after Shutdown()"; |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 //////////////////////////////////////////////////////////////////////////////// | 182 //////////////////////////////////////////////////////////////////////////////// |
| 183 WebDatabaseServiceImpl::WebDatabaseServiceImpl(const base::FilePath& path) | 183 WebDatabaseServiceImpl::WebDatabaseServiceImpl(const base::FilePath& path) |
| 184 : path_(path) { | 184 : path_(path) { |
| 185 // Do not start WebDatabaseService on ImportProcess. | |
| 186 DCHECK(!ProfileManager::IsImportProcess(*CommandLine::ForCurrentProcess())); | |
| 187 // WebDatabaseService should be instantiated on UI thread. | 185 // WebDatabaseService should be instantiated on UI thread. |
| 188 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 186 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 189 // WebDatabaseService requires DB thread if instantiated. | 187 // WebDatabaseService requires DB thread if instantiated. |
| 190 DCHECK(BrowserThread::IsWellKnownThread(BrowserThread::DB)); | 188 DCHECK(BrowserThread::IsWellKnownThread(BrowserThread::DB)); |
| 191 } | 189 } |
| 192 | 190 |
| 193 WebDatabaseServiceImpl::~WebDatabaseServiceImpl() { | 191 WebDatabaseServiceImpl::~WebDatabaseServiceImpl() { |
| 194 wdbs_internal_ = NULL; | 192 wdbs_internal_ = NULL; |
| 195 } | 193 } |
| 196 | 194 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 void WebDatabaseServiceImpl::CancelRequest(WebDataServiceBase::Handle h) { | 259 void WebDatabaseServiceImpl::CancelRequest(WebDataServiceBase::Handle h) { |
| 262 if (wdbs_internal_) | 260 if (wdbs_internal_) |
| 263 wdbs_internal_->request_manager()->CancelRequest(h); | 261 wdbs_internal_->request_manager()->CancelRequest(h); |
| 264 } | 262 } |
| 265 | 263 |
| 266 // Testing | 264 // Testing |
| 267 void WebDatabaseServiceImpl::set_init_complete(bool complete) { | 265 void WebDatabaseServiceImpl::set_init_complete(bool complete) { |
| 268 if (wdbs_internal_) | 266 if (wdbs_internal_) |
| 269 wdbs_internal_->set_init_complete(complete); | 267 wdbs_internal_->set_init_complete(complete); |
| 270 } | 268 } |
| OLD | NEW |