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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_directory_service.cc

Issue 10854180: Pass const ref instead of pointer for FromDocumentEntry() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for comments. Created 8 years, 4 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
OLDNEW
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 "chrome/browser/chromeos/gdata/gdata_directory_service.h" 5 #include "chrome/browser/chromeos/gdata/gdata_directory_service.h"
6 6
7 #include <leveldb/db.h> 7 #include <leveldb/db.h>
8 8
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 GDataDirectoryService::~GDataDirectoryService() { 197 GDataDirectoryService::~GDataDirectoryService() {
198 ClearRoot(); 198 ClearRoot();
199 199
200 // Ensure db is closed on the blocking pool. 200 // Ensure db is closed on the blocking pool.
201 if (blocking_task_runner_ && directory_service_db_.get()) 201 if (blocking_task_runner_ && directory_service_db_.get())
202 blocking_task_runner_->DeleteSoon(FROM_HERE, 202 blocking_task_runner_->DeleteSoon(FROM_HERE,
203 directory_service_db_.release()); 203 directory_service_db_.release());
204 } 204 }
205 205
206 GDataEntry* GDataDirectoryService::FromDocumentEntry(DocumentEntry* doc) { 206 GDataEntry* GDataDirectoryService::FromDocumentEntry(const DocumentEntry& doc) {
207 DCHECK(doc);
208 GDataEntry* entry = NULL; 207 GDataEntry* entry = NULL;
209 if (doc->is_folder()) 208 if (doc.is_folder())
210 entry = CreateGDataDirectory(); 209 entry = CreateGDataDirectory();
211 else if (doc->is_hosted_document() || doc->is_file()) 210 else if (doc.is_hosted_document() || doc.is_file())
212 entry = CreateGDataFile(); 211 entry = CreateGDataFile();
213 212
214 if (entry) 213 if (entry)
215 entry->InitFromDocumentEntry(doc); 214 entry->InitFromDocumentEntry(doc);
216 return entry; 215 return entry;
217 } 216 }
218 217
219 GDataFile* GDataDirectoryService::CreateGDataFile() { 218 GDataFile* GDataDirectoryService::CreateGDataFile() {
220 return new GDataFile(this); 219 return new GDataFile(this);
221 } 220 }
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 DCHECK(result.get()); 753 DCHECK(result.get());
755 754
756 result->second.path = second_path; 755 result->second.path = second_path;
757 result->second.error = error; 756 result->second.error = error;
758 result->second.proto = entry_proto.Pass(); 757 result->second.proto = entry_proto.Pass();
759 758
760 callback.Run(result.Pass()); 759 callback.Run(result.Pass());
761 } 760 }
762 761
763 } // namespace gdata 762 } // namespace gdata
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_directory_service.h ('k') | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698