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

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

Issue 16654009: Rewrite scoped_ptr<T>(NULL) to use the default ctor in sync/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/test/engine/mock_connection_manager.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 "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 kernel->mutable_ref(static_cast<ProtoField>(i)).ParseFromArray( 101 kernel->mutable_ref(static_cast<ProtoField>(i)).ParseFromArray(
102 statement->ColumnBlob(i), statement->ColumnByteLength(i)); 102 statement->ColumnBlob(i), statement->ColumnByteLength(i));
103 } 103 }
104 for ( ; i < UNIQUE_POSITION_FIELDS_END; ++i) { 104 for ( ; i < UNIQUE_POSITION_FIELDS_END; ++i) {
105 std::string temp; 105 std::string temp;
106 statement->ColumnBlobAsString(i, &temp); 106 statement->ColumnBlobAsString(i, &temp);
107 107
108 sync_pb::UniquePosition proto; 108 sync_pb::UniquePosition proto;
109 if (!proto.ParseFromString(temp)) { 109 if (!proto.ParseFromString(temp)) {
110 DVLOG(1) << "Unpacked invalid position. Assuming the DB is corrupt"; 110 DVLOG(1) << "Unpacked invalid position. Assuming the DB is corrupt";
111 return scoped_ptr<EntryKernel>(NULL); 111 return scoped_ptr<EntryKernel>();
112 } 112 }
113 113
114 kernel->mutable_ref(static_cast<UniquePositionField>(i)) = 114 kernel->mutable_ref(static_cast<UniquePositionField>(i)) =
115 UniquePosition::FromProto(proto); 115 UniquePosition::FromProto(proto);
116 } 116 }
117 return kernel.Pass(); 117 return kernel.Pass();
118 } 118 }
119 119
120 namespace { 120 namespace {
121 121
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 } 1492 }
1493 query.append(" ) "); 1493 query.append(" ) ");
1494 values.append(" )"); 1494 values.append(" )");
1495 query.append(values); 1495 query.append(values);
1496 save_statement->Assign(db_->GetUniqueStatement( 1496 save_statement->Assign(db_->GetUniqueStatement(
1497 base::StringPrintf(query.c_str(), "metas").c_str())); 1497 base::StringPrintf(query.c_str(), "metas").c_str()));
1498 } 1498 }
1499 1499
1500 } // namespace syncable 1500 } // namespace syncable
1501 } // namespace syncer 1501 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/test/engine/mock_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698