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 "chromeos/dbus/debug_daemon_client.h" | 5 #include "chromeos/dbus/debug_daemon_client.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
507 | 507 |
508 void OnGetPerfData(const GetPerfDataCallback& callback, | 508 void OnGetPerfData(const GetPerfDataCallback& callback, |
509 dbus::Response* response) { | 509 dbus::Response* response) { |
510 std::vector<uint8> data; | 510 std::vector<uint8> data; |
511 | 511 |
512 if (!response) { | 512 if (!response) { |
513 return; | 513 return; |
514 } | 514 } |
515 | 515 |
516 dbus::MessageReader reader(response); | 516 dbus::MessageReader reader(response); |
517 uint8* buffer = NULL; | 517 const uint8* buffer = NULL; |
518 size_t buf_size = 0; | 518 size_t buf_size = 0; |
519 if (!reader.PopArrayOfBytes(reinterpret_cast<uint8**>( | 519 if (!reader.PopArrayOfBytes(reinterpret_cast<const uint8**>(&buffer), |
satorux1
2014/02/24 07:44:55
reinterpret_cast<> looks unnecessary?
Daniel Erat
2014/02/24 08:16:17
good catch; i'm not sure why it was there in the f
| |
520 &buffer), &buf_size)) { | 520 &buf_size)) { |
521 return; | 521 return; |
522 } | 522 } |
523 | 523 |
524 // TODO(asharif): Figure out a way to avoid this copy. | 524 // TODO(asharif): Figure out a way to avoid this copy. |
525 data.insert(data.end(), buffer, buffer + buf_size); | 525 data.insert(data.end(), buffer, buffer + buf_size); |
526 | 526 |
527 callback.Run(data); | 527 callback.Run(data); |
528 } | 528 } |
529 | 529 |
530 void OnGetAllLogs(const GetLogsCallback& callback, | 530 void OnGetAllLogs(const GetLogsCallback& callback, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
631 DebugDaemonClient::EmptyStopSystemTracingCallback() { | 631 DebugDaemonClient::EmptyStopSystemTracingCallback() { |
632 return base::Bind(&EmptyStopSystemTracingCallbackBody); | 632 return base::Bind(&EmptyStopSystemTracingCallbackBody); |
633 } | 633 } |
634 | 634 |
635 // static | 635 // static |
636 DebugDaemonClient* DebugDaemonClient::Create() { | 636 DebugDaemonClient* DebugDaemonClient::Create() { |
637 return new DebugDaemonClientImpl(); | 637 return new DebugDaemonClientImpl(); |
638 } | 638 } |
639 | 639 |
640 } // namespace chromeos | 640 } // namespace chromeos |
OLD | NEW |