Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: sync/syncable/directory_backing_store.cc

Issue 1539843002: Convert Pass()→std::move() in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sync/syncable/directory.cc ('k') | sync/syncable/entry_kernel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "sync/syncable/directory_backing_store.h" 5 #include "sync/syncable/directory_backing_store.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 // Sanity check on positions. We risk strange and rare crashes if our 169 // Sanity check on positions. We risk strange and rare crashes if our
170 // assumptions about unique position values are broken. 170 // assumptions about unique position values are broken.
171 if (kernel->ShouldMaintainPosition() && 171 if (kernel->ShouldMaintainPosition() &&
172 !kernel->ref(UNIQUE_POSITION).IsValid()) { 172 !kernel->ref(UNIQUE_POSITION).IsValid()) {
173 DVLOG(1) << "Unpacked invalid position on an entity that should have a " 173 DVLOG(1) << "Unpacked invalid position on an entity that should have a "
174 << "valid position. Assuming the DB is corrupt."; 174 << "valid position. Assuming the DB is corrupt.";
175 return scoped_ptr<EntryKernel>(); 175 return scoped_ptr<EntryKernel>();
176 } 176 }
177 177
178 return kernel.Pass(); 178 return kernel;
179 } 179 }
180 180
181 namespace { 181 namespace {
182 182
183 // This just has to be big enough to hold an UPDATE or INSERT statement that 183 // This just has to be big enough to hold an UPDATE or INSERT statement that
184 // modifies all the columns in the entry table. 184 // modifies all the columns in the entry table.
185 static const string::size_type kUpdateStatementBufferSize = 2048; 185 static const string::size_type kUpdateStatementBufferSize = 2048;
186 186
187 void OnSqliteError(const base::Closure& catastrophic_error_handler, 187 void OnSqliteError(const base::Closure& catastrophic_error_handler,
188 int err, 188 int err,
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 DCHECK(CalledOnValidThread()); 1746 DCHECK(CalledOnValidThread());
1747 DCHECK(!catastrophic_error_handler.is_null()); 1747 DCHECK(!catastrophic_error_handler.is_null());
1748 catastrophic_error_handler_ = catastrophic_error_handler; 1748 catastrophic_error_handler_ = catastrophic_error_handler;
1749 sql::Connection::ErrorCallback error_callback = 1749 sql::Connection::ErrorCallback error_callback =
1750 base::Bind(&OnSqliteError, catastrophic_error_handler_); 1750 base::Bind(&OnSqliteError, catastrophic_error_handler_);
1751 db_->set_error_callback(error_callback); 1751 db_->set_error_callback(error_callback);
1752 } 1752 }
1753 1753
1754 } // namespace syncable 1754 } // namespace syncable
1755 } // namespace syncer 1755 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/directory.cc ('k') | sync/syncable/entry_kernel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698