OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
7 // | 7 // |
8 // OVERVIEW | 8 // OVERVIEW |
9 // | 9 // |
10 // A MetricsService instance is typically created at application startup. It | 10 // A MetricsService instance is typically created at application startup. It |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 std::vector<webkit::npapi::WebPluginInfo> plugins_; | 334 std::vector<webkit::npapi::WebPluginInfo> plugins_; |
335 }; | 335 }; |
336 | 336 |
337 class MetricsService::InitTask : public Task { | 337 class MetricsService::InitTask : public Task { |
338 public: | 338 public: |
339 explicit InitTask(MessageLoop* callback_loop) | 339 explicit InitTask(MessageLoop* callback_loop) |
340 : callback_loop_(callback_loop) {} | 340 : callback_loop_(callback_loop) {} |
341 | 341 |
342 virtual void Run() { | 342 virtual void Run() { |
343 std::vector<webkit::npapi::WebPluginInfo> plugins; | 343 std::vector<webkit::npapi::WebPluginInfo> plugins; |
344 webkit::npapi::PluginList::Singleton()->GetPlugins(false, &plugins); | 344 webkit::npapi::PluginList::Singleton()->GetPlugins(&plugins); |
345 std::string hardware_class; // Empty string by default. | 345 std::string hardware_class; // Empty string by default. |
346 #if defined(OS_CHROMEOS) | 346 #if defined(OS_CHROMEOS) |
347 chromeos::system::StatisticsProvider::GetInstance()->GetMachineStatistic( | 347 chromeos::system::StatisticsProvider::GetInstance()->GetMachineStatistic( |
348 "hardware_class", &hardware_class); | 348 "hardware_class", &hardware_class); |
349 #endif // OS_CHROMEOS | 349 #endif // OS_CHROMEOS |
350 callback_loop_->PostTask(FROM_HERE, new InitTaskComplete( | 350 callback_loop_->PostTask(FROM_HERE, new InitTaskComplete( |
351 hardware_class, plugins)); | 351 hardware_class, plugins)); |
352 } | 352 } |
353 | 353 |
354 private: | 354 private: |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 thread_id = base::PlatformThread::CurrentId(); | 1692 thread_id = base::PlatformThread::CurrentId(); |
1693 return base::PlatformThread::CurrentId() == thread_id; | 1693 return base::PlatformThread::CurrentId() == thread_id; |
1694 } | 1694 } |
1695 | 1695 |
1696 #if defined(OS_CHROMEOS) | 1696 #if defined(OS_CHROMEOS) |
1697 void MetricsService::StartExternalMetrics() { | 1697 void MetricsService::StartExternalMetrics() { |
1698 external_metrics_ = new chromeos::ExternalMetrics; | 1698 external_metrics_ = new chromeos::ExternalMetrics; |
1699 external_metrics_->Start(); | 1699 external_metrics_->Start(); |
1700 } | 1700 } |
1701 #endif | 1701 #endif |
OLD | NEW |