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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_wapi_feed_processor.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
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_files.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/metrics/histogram.h" 5 #include "base/metrics/histogram.h"
6 #include "chrome/browser/chromeos/gdata/gdata_directory_service.h" 6 #include "chrome/browser/chromeos/gdata/gdata_directory_service.h"
7 #include "chrome/browser/chromeos/gdata/gdata_files.h" 7 #include "chrome/browser/chromeos/gdata/gdata_files.h"
8 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_processor.h" 8 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_processor.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 directory_service_->root()->set_upload_url( 279 directory_service_->root()->set_upload_url(
280 root_feed_upload_link->href()); 280 root_feed_upload_link->href());
281 *feed_changestamp = feed->largest_changestamp(); 281 *feed_changestamp = feed->largest_changestamp();
282 DCHECK_GE(*feed_changestamp, 0); 282 DCHECK_GE(*feed_changestamp, 0);
283 } 283 }
284 284
285 for (ScopedVector<DocumentEntry>::const_iterator iter = 285 for (ScopedVector<DocumentEntry>::const_iterator iter =
286 feed->entries().begin(); 286 feed->entries().begin();
287 iter != feed->entries().end(); ++iter) { 287 iter != feed->entries().end(); ++iter) {
288 DocumentEntry* doc = *iter; 288 DocumentEntry* doc = *iter;
289 GDataEntry* entry = directory_service_->FromDocumentEntry(doc); 289 GDataEntry* entry = directory_service_->FromDocumentEntry(*doc);
290 // Some document entries don't map into files (i.e. sites). 290 // Some document entries don't map into files (i.e. sites).
291 if (!entry) 291 if (!entry)
292 continue; 292 continue;
293 // Count the number of files. 293 // Count the number of files.
294 GDataFile* as_file = entry->AsGDataFile(); 294 GDataFile* as_file = entry->AsGDataFile();
295 if (as_file) { 295 if (as_file) {
296 if (as_file->is_hosted_document()) 296 if (as_file->is_hosted_document())
297 ++uma_stats->num_hosted_documents; 297 ++uma_stats->num_hosted_documents;
298 else 298 else
299 ++uma_stats->num_regular_files; 299 ++uma_stats->num_regular_files;
(...skipping 22 matching lines...) Expand all
322 // If the code above fails to parse a feed, any GDataEntry instance 322 // If the code above fails to parse a feed, any GDataEntry instance
323 // added to |file_by_url| is not managed by a GDataDirectory instance, 323 // added to |file_by_url| is not managed by a GDataDirectory instance,
324 // so we need to explicitly release them here. 324 // so we need to explicitly release them here.
325 STLDeleteValues(file_map); 325 STLDeleteValues(file_map);
326 } 326 }
327 327
328 return error; 328 return error;
329 } 329 }
330 330
331 } // namespace gdata 331 } // namespace gdata
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_files.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698