Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: chromeos/dbus/fake_debug_daemon_client.cc

Issue 1218583002: metrics: Add dbus interface for GetRandomPerfOutput (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check has_ms_after_login() instead of ms_after_login() value Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/dbus/fake_debug_daemon_client.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chromeos/dbus/fake_debug_daemon_client.h" 5 #include "chromeos/dbus/fake_debug_daemon_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 FROM_HERE, base::Bind(callback, false, "")); 80 FROM_HERE, base::Bind(callback, false, ""));
81 } 81 }
82 82
83 void FakeDebugDaemonClient::GetPerfData(uint32_t duration, 83 void FakeDebugDaemonClient::GetPerfData(uint32_t duration,
84 const GetPerfDataCallback& callback) { 84 const GetPerfDataCallback& callback) {
85 std::vector<uint8> data; 85 std::vector<uint8> data;
86 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, 86 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
87 base::Bind(callback, data)); 87 base::Bind(callback, data));
88 } 88 }
89 89
90 void FakeDebugDaemonClient::GetPerfOutput(
91 uint32_t duration,
92 const GetPerfOutputCallback& callback) {
93 int status = 0;
94 std::vector<uint8> perf_data;
95 std::vector<uint8> perf_stat;
96 base::ThreadTaskRunnerHandle::Get()->PostTask(
97 FROM_HERE, base::Bind(callback, status, perf_data, perf_stat));
98 }
99
90 void FakeDebugDaemonClient::GetScrubbedLogs(const GetLogsCallback& callback) { 100 void FakeDebugDaemonClient::GetScrubbedLogs(const GetLogsCallback& callback) {
91 std::map<std::string, std::string> sample; 101 std::map<std::string, std::string> sample;
92 sample["Sample Scrubbed Log"] = "Your email address is xxxxxxxx"; 102 sample["Sample Scrubbed Log"] = "Your email address is xxxxxxxx";
93 base::ThreadTaskRunnerHandle::Get()->PostTask( 103 base::ThreadTaskRunnerHandle::Get()->PostTask(
94 FROM_HERE, base::Bind(callback, false, sample)); 104 FROM_HERE, base::Bind(callback, false, sample));
95 } 105 }
96 106
97 void FakeDebugDaemonClient::GetAllLogs(const GetLogsCallback& callback) { 107 void FakeDebugDaemonClient::GetAllLogs(const GetLogsCallback& callback) {
98 std::map<std::string, std::string> sample; 108 std::map<std::string, std::string> sample;
99 sample["Sample Log"] = "Your email address is abc@abc.com"; 109 sample["Sample Log"] = "Your email address is abc@abc.com";
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (!is_available) 181 if (!is_available)
172 return; 182 return;
173 183
174 std::vector<WaitForServiceToBeAvailableCallback> callbacks; 184 std::vector<WaitForServiceToBeAvailableCallback> callbacks;
175 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); 185 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_);
176 for (size_t i = 0; i < callbacks.size(); ++i) 186 for (size_t i = 0; i < callbacks.size(); ++i)
177 callbacks[i].Run(is_available); 187 callbacks[i].Run(is_available);
178 } 188 }
179 189
180 } // namespace chromeos 190 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_debug_daemon_client.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698