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

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

Issue 2854953005: Use constexpr TaskTraits constructor in chromeos. (Closed)
Patch Set: Created 3 years, 7 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/cert_loader.cc ('k') | chromeos/dbus/fake_auth_policy_client.cc » ('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 (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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // A self-deleting object that wraps the pipe reader operations for reading the 49 // A self-deleting object that wraps the pipe reader operations for reading the
50 // big feedback logs. It will delete itself once the pipe stream has been 50 // big feedback logs. It will delete itself once the pipe stream has been
51 // terminated. Once the data has been completely read from the pipe, it invokes 51 // terminated. Once the data has been completely read from the pipe, it invokes
52 // the GetLogsCallback |callback| passing the deserialized logs data back to 52 // the GetLogsCallback |callback| passing the deserialized logs data back to
53 // the requester. 53 // the requester.
54 class PipeReaderWrapper : public base::SupportsWeakPtr<PipeReaderWrapper> { 54 class PipeReaderWrapper : public base::SupportsWeakPtr<PipeReaderWrapper> {
55 public: 55 public:
56 explicit PipeReaderWrapper(const DebugDaemonClient::GetLogsCallback& callback) 56 explicit PipeReaderWrapper(const DebugDaemonClient::GetLogsCallback& callback)
57 : pipe_reader_(base::CreateTaskRunnerWithTraits( 57 : pipe_reader_(base::CreateTaskRunnerWithTraits(
58 base::TaskTraits().MayBlock().WithShutdownBehavior( 58 {base::MayBlock(),
59 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)), 59 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}),
60 base::Bind(&PipeReaderWrapper::OnIOComplete, AsWeakPtr())), 60 base::Bind(&PipeReaderWrapper::OnIOComplete, AsWeakPtr())),
61 callback_(callback) {} 61 callback_(callback) {}
62 62
63 base::ScopedFD Initialize() { return pipe_reader_.StartIO(); } 63 base::ScopedFD Initialize() { return pipe_reader_.StartIO(); }
64 64
65 void OnIOComplete() { 65 void OnIOComplete() {
66 std::string pipe_data; 66 std::string pipe_data;
67 pipe_reader_.GetData(&pipe_data); 67 pipe_reader_.GetData(&pipe_data);
68 JSONStringValueDeserializer json_reader(pipe_data); 68 JSONStringValueDeserializer json_reader(pipe_data);
69 69
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 DebugDaemonClient::EmptyStopAgentTracingCallback() { 775 DebugDaemonClient::EmptyStopAgentTracingCallback() {
776 return base::Bind(&EmptyStopAgentTracingCallbackBody); 776 return base::Bind(&EmptyStopAgentTracingCallbackBody);
777 } 777 }
778 778
779 // static 779 // static
780 DebugDaemonClient* DebugDaemonClient::Create() { 780 DebugDaemonClient* DebugDaemonClient::Create() {
781 return new DebugDaemonClientImpl(); 781 return new DebugDaemonClientImpl();
782 } 782 }
783 783
784 } // namespace chromeos 784 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/cert_loader.cc ('k') | chromeos/dbus/fake_auth_policy_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698