| 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_data_service_backend.h" | 5 #include "components/webdata/common/web_data_service_backend.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_database.h" | 10 #include "components/webdata/common/web_database.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return task.Run(db_.get()); | 105 return task.Run(db_.get()); |
| 106 } | 106 } |
| 107 return scoped_ptr<WDTypedResult>(); | 107 return scoped_ptr<WDTypedResult>(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 WebDataServiceBackend::~WebDataServiceBackend() { | 110 WebDataServiceBackend::~WebDataServiceBackend() { |
| 111 ShutdownDatabase(); | 111 ShutdownDatabase(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void WebDataServiceBackend::Commit() { | 114 void WebDataServiceBackend::Commit() { |
| 115 if (db_ && init_status_ == sql::INIT_OK) { | 115 DCHECK(db_); |
| 116 db_->CommitTransaction(); | 116 DCHECK_EQ(sql::INIT_OK, init_status_); |
| 117 db_->BeginTransaction(); | 117 db_->CommitTransaction(); |
| 118 } else { | 118 db_->BeginTransaction(); |
| 119 NOTREACHED() << "Commit scheduled after Shutdown()"; | |
| 120 } | |
| 121 } | 119 } |
| OLD | NEW |