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/gdata/gdata_file_system.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 3630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3641 return error; | 3641 return error; |
3642 | 3642 |
3643 ApplyFeedFromFileUrlMap( | 3643 ApplyFeedFromFileUrlMap( |
3644 is_delta_feed, | 3644 is_delta_feed, |
3645 is_delta_feed ? delta_feed_changestamp : root_feed_changestamp, | 3645 is_delta_feed ? delta_feed_changestamp : root_feed_changestamp, |
3646 &file_map); | 3646 &file_map); |
3647 | 3647 |
3648 if (should_notify_initial_load) | 3648 if (should_notify_initial_load) |
3649 NotifyInitialLoadFinished(); | 3649 NotifyInitialLoadFinished(); |
3650 | 3650 |
3651 const int num_total_files = num_hosted_documents + num_regular_files; | 3651 // Shouldn't record histograms when processing delta feeds. |
3652 UMA_HISTOGRAM_COUNTS("GData.NumberOfRegularFiles", num_regular_files); | 3652 if (!is_delta_feed) { |
3653 UMA_HISTOGRAM_COUNTS("GData.NumberOfHostedDocuments", | 3653 const int num_total_files = num_hosted_documents + num_regular_files; |
3654 num_hosted_documents); | 3654 UMA_HISTOGRAM_COUNTS("GData.NumberOfRegularFiles", num_regular_files); |
3655 UMA_HISTOGRAM_COUNTS("GData.NumberOfTotalFiles", num_total_files); | 3655 UMA_HISTOGRAM_COUNTS("GData.NumberOfHostedDocuments", |
| 3656 num_hosted_documents); |
| 3657 UMA_HISTOGRAM_COUNTS("GData.NumberOfTotalFiles", num_total_files); |
| 3658 } |
3656 return base::PLATFORM_FILE_OK; | 3659 return base::PLATFORM_FILE_OK; |
3657 } | 3660 } |
3658 | 3661 |
3659 void GDataFileSystem::ApplyFeedFromFileUrlMap( | 3662 void GDataFileSystem::ApplyFeedFromFileUrlMap( |
3660 bool is_delta_feed, | 3663 bool is_delta_feed, |
3661 int feed_changestamp, | 3664 int feed_changestamp, |
3662 FileResourceIdMap* file_map) { | 3665 FileResourceIdMap* file_map) { |
3663 lock_.AssertAcquired(); | 3666 lock_.AssertAcquired(); |
3664 // Don't send directory content change notification while performing | 3667 // Don't send directory content change notification while performing |
3665 // the initial content retrieval. | 3668 // the initial content retrieval. |
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5261 pref_registrar_->Init(profile_->GetPrefs()); | 5264 pref_registrar_->Init(profile_->GetPrefs()); |
5262 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); | 5265 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); |
5263 } | 5266 } |
5264 | 5267 |
5265 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { | 5268 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { |
5266 delete global_free_disk_getter_for_testing; // Safe to delete NULL; | 5269 delete global_free_disk_getter_for_testing; // Safe to delete NULL; |
5267 global_free_disk_getter_for_testing = getter; | 5270 global_free_disk_getter_for_testing = getter; |
5268 } | 5271 } |
5269 | 5272 |
5270 } // namespace gdata | 5273 } // namespace gdata |
OLD | NEW |