| 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/metrics/perf/perf_provider_chromeos.h" | 5 #include "chrome/browser/metrics/perf/perf_provider_chromeos.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 AddToPerfHistogram(ILLEGAL_DATA_RETURNED); | 400 AddToPerfHistogram(ILLEGAL_DATA_RETURNED); |
| 401 return; | 401 return; |
| 402 } | 402 } |
| 403 | 403 |
| 404 if (!perf_data.empty()) { | 404 if (!perf_data.empty()) { |
| 405 PerfDataProto perf_data_proto; | 405 PerfDataProto perf_data_proto; |
| 406 if (!perf_data_proto.ParseFromArray(perf_data.data(), perf_data.size())) { | 406 if (!perf_data_proto.ParseFromArray(perf_data.data(), perf_data.size())) { |
| 407 AddToPerfHistogram(PROTOBUF_NOT_PARSED); | 407 AddToPerfHistogram(PROTOBUF_NOT_PARSED); |
| 408 return; | 408 return; |
| 409 } | 409 } |
| 410 sampled_profile->set_ms_after_boot(base::SysInfo::Uptime()); | 410 sampled_profile->set_ms_after_boot( |
| 411 base::SysInfo::Uptime().InMilliseconds()); |
| 411 sampled_profile->mutable_perf_data()->Swap(&perf_data_proto); | 412 sampled_profile->mutable_perf_data()->Swap(&perf_data_proto); |
| 412 } else { | 413 } else { |
| 413 DCHECK(!perf_stat.empty()); | 414 DCHECK(!perf_stat.empty()); |
| 414 PerfStatProto perf_stat_proto; | 415 PerfStatProto perf_stat_proto; |
| 415 if (!perf_stat_proto.ParseFromArray(perf_stat.data(), perf_stat.size())) { | 416 if (!perf_stat_proto.ParseFromArray(perf_stat.data(), perf_stat.size())) { |
| 416 AddToPerfHistogram(PROTOBUF_NOT_PARSED); | 417 AddToPerfHistogram(PROTOBUF_NOT_PARSED); |
| 417 return; | 418 return; |
| 418 } | 419 } |
| 419 sampled_profile->mutable_perf_stat()->Swap(&perf_stat_proto); | 420 sampled_profile->mutable_perf_stat()->Swap(&perf_stat_proto); |
| 420 } | 421 } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 scoped_ptr<SampledProfile> sampled_profile(new SampledProfile); | 613 scoped_ptr<SampledProfile> sampled_profile(new SampledProfile); |
| 613 sampled_profile->set_trigger_event(SampledProfile::RESTORE_SESSION); | 614 sampled_profile->set_trigger_event(SampledProfile::RESTORE_SESSION); |
| 614 sampled_profile->set_ms_after_restore(time_after_restore.InMilliseconds()); | 615 sampled_profile->set_ms_after_restore(time_after_restore.InMilliseconds()); |
| 615 sampled_profile->set_num_tabs_restored(num_tabs_restored); | 616 sampled_profile->set_num_tabs_restored(num_tabs_restored); |
| 616 | 617 |
| 617 CollectIfNecessary(sampled_profile.Pass()); | 618 CollectIfNecessary(sampled_profile.Pass()); |
| 618 last_session_restore_collection_time_ = base::TimeTicks::Now(); | 619 last_session_restore_collection_time_ = base::TimeTicks::Now(); |
| 619 } | 620 } |
| 620 | 621 |
| 621 } // namespace metrics | 622 } // namespace metrics |
| OLD | NEW |