| OLD | NEW |
| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "chrome/browser/chromeos/gdata/drive_resource_metadata.h" | 8 #include "chrome/browser/chromeos/gdata/drive_resource_metadata.h" |
| 9 #include "chrome/browser/chromeos/gdata/drive_files.h" | 9 #include "chrome/browser/chromeos/gdata/drive_files.h" |
| 10 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_processor.h" | 10 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_processor.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 uma_stats->num_regular_files = 0; | 251 uma_stats->num_regular_files = 0; |
| 252 uma_stats->num_hosted_documents = 0; | 252 uma_stats->num_hosted_documents = 0; |
| 253 uma_stats->num_files_with_entry_kind.clear(); | 253 uma_stats->num_files_with_entry_kind.clear(); |
| 254 for (size_t i = 0; i < feed_list.size(); ++i) { | 254 for (size_t i = 0; i < feed_list.size(); ++i) { |
| 255 const DocumentFeed* feed = feed_list[i]; | 255 const DocumentFeed* feed = feed_list[i]; |
| 256 | 256 |
| 257 // Get upload url from the root feed. Links for all other collections will | 257 // Get upload url from the root feed. Links for all other collections will |
| 258 // be handled in GDatadirectory::FromDocumentEntry(); | 258 // be handled in GDatadirectory::FromDocumentEntry(); |
| 259 if (i == 0) { | 259 if (i == 0) { |
| 260 const Link* root_feed_upload_link = | 260 const Link* root_feed_upload_link = |
| 261 feed->GetLinkByType(Link::RESUMABLE_CREATE_MEDIA); | 261 feed->GetLinkByType(Link::kResumableCreateMedia); |
| 262 if (root_feed_upload_link) | 262 if (root_feed_upload_link) |
| 263 resource_metadata_->root()->set_upload_url( | 263 resource_metadata_->root()->set_upload_url( |
| 264 root_feed_upload_link->href()); | 264 root_feed_upload_link->href()); |
| 265 *feed_changestamp = feed->largest_changestamp(); | 265 *feed_changestamp = feed->largest_changestamp(); |
| 266 DCHECK_GE(*feed_changestamp, 0); | 266 DCHECK_GE(*feed_changestamp, 0); |
| 267 } | 267 } |
| 268 | 268 |
| 269 for (ScopedVector<DocumentEntry>::const_iterator iter = | 269 for (ScopedVector<DocumentEntry>::const_iterator iter = |
| 270 feed->entries().begin(); | 270 feed->entries().begin(); |
| 271 iter != feed->entries().end(); ++iter) { | 271 iter != feed->entries().end(); ++iter) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 // If the code above fails to parse a feed, any DriveEntry instance | 309 // If the code above fails to parse a feed, any DriveEntry instance |
| 310 // added to |file_by_url| is not managed by a DriveDirectory instance, | 310 // added to |file_by_url| is not managed by a DriveDirectory instance, |
| 311 // so we need to explicitly release them here. | 311 // so we need to explicitly release them here. |
| 312 STLDeleteValues(file_map); | 312 STLDeleteValues(file_map); |
| 313 } | 313 } |
| 314 | 314 |
| 315 return error; | 315 return error; |
| 316 } | 316 } |
| 317 | 317 |
| 318 } // namespace gdata | 318 } // namespace gdata |
| OLD | NEW |