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 "chrome/browser/chromeos/drive/change_list_processor.h" | 5 #include "chrome/browser/chromeos/drive/change_list_processor.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "chrome/browser/chromeos/drive/drive.pb.h" | 10 #include "chrome/browser/chromeos/drive/drive.pb.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 } | 345 } |
346 | 346 |
347 for (size_t j = 0; j < feed->entries().size(); ++j) { | 347 for (size_t j = 0; j < feed->entries().size(); ++j) { |
348 const google_apis::ResourceEntry* entry = feed->entries()[j]; | 348 const google_apis::ResourceEntry* entry = feed->entries()[j]; |
349 DriveEntryProto entry_proto = | 349 DriveEntryProto entry_proto = |
350 ConvertResourceEntryToDriveEntryProto(*entry); | 350 ConvertResourceEntryToDriveEntryProto(*entry); |
351 // Some document entries don't map into files (i.e. sites). | 351 // Some document entries don't map into files (i.e. sites). |
352 if (entry_proto.resource_id().empty()) | 352 if (entry_proto.resource_id().empty()) |
353 continue; | 353 continue; |
354 | 354 |
| 355 // TODO(haruki): Apply mapping from an empty parent to special dummy |
| 356 // directory here or in ConvertResourceEntryToDriveEntryProto. See |
| 357 // http://crbug.com/174233 http://crbug.com/171207. Until we implement it, |
| 358 // ChangeListProcessor ignores such "no parent" entries. |
| 359 if (entry_proto.parent_resource_id().empty()) { |
| 360 continue; |
| 361 } |
| 362 |
355 // Count the number of files. | 363 // Count the number of files. |
356 if (uma_stats && !entry_proto.file_info().is_directory()) { | 364 if (uma_stats && !entry_proto.file_info().is_directory()) { |
357 uma_stats->IncrementNumFiles( | 365 uma_stats->IncrementNumFiles( |
358 entry_proto.file_specific_info().is_hosted_document()); | 366 entry_proto.file_specific_info().is_hosted_document()); |
359 } | 367 } |
360 | 368 |
361 std::pair<DriveEntryProtoMap::iterator, bool> ret = entry_proto_map_. | 369 std::pair<DriveEntryProtoMap::iterator, bool> ret = entry_proto_map_. |
362 insert(std::make_pair(entry_proto.resource_id(), entry_proto)); | 370 insert(std::make_pair(entry_proto.resource_id(), entry_proto)); |
363 DCHECK(ret.second); | 371 DCHECK(ret.second); |
364 if (!ret.second) | 372 if (!ret.second) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 441 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
434 | 442 |
435 entry_proto_map_.clear(); | 443 entry_proto_map_.clear(); |
436 changed_dirs_.clear(); | 444 changed_dirs_.clear(); |
437 root_upload_url_ = GURL(); | 445 root_upload_url_ = GURL(); |
438 largest_changestamp_ = 0; | 446 largest_changestamp_ = 0; |
439 on_complete_callback_.Reset(); | 447 on_complete_callback_.Reset(); |
440 } | 448 } |
441 | 449 |
442 } // namespace drive | 450 } // namespace drive |
OLD | NEW |