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

Unified Diff: chrome/browser/metrics/perf/perf_output.cc

Issue 2081153002: No dbus::FileDescriptor in DebugDaemonClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/metrics/perf/perf_output.h ('k') | chromeos/dbus/debug_daemon_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/perf/perf_output.cc
diff --git a/chrome/browser/metrics/perf/perf_output.cc b/chrome/browser/metrics/perf/perf_output.cc
index c9c1d37a646ddd773bfd8514c2dfddb6a3924d57..4988d54fafe8f338733df81e207c2b89dcc0c35c 100644
--- a/chrome/browser/metrics/perf/perf_output.cc
+++ b/chrome/browser/metrics/perf/perf_output.cc
@@ -4,26 +4,10 @@
#include "chrome/browser/metrics/perf/perf_output.h"
-#include <memory>
-
#include "base/bind.h"
-#include "base/location.h"
-#include "base/task_runner_util.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/debug_daemon_client.h"
-namespace {
-
-// Create a dbus::FileDescriptor from a base::File.
-dbus::ScopedFileDescriptor CreateFileDescriptor(base::File pipe_write_end) {
- dbus::ScopedFileDescriptor file_descriptor(new dbus::FileDescriptor);
- file_descriptor->PutValue(pipe_write_end.TakePlatformFile());
- file_descriptor->CheckValidity();
- return file_descriptor;
-}
-
-} // namespace
-
PerfOutputCall::PerfOutputCall(
scoped_refptr<base::TaskRunner> blocking_task_runner,
base::TimeDelta duration,
@@ -40,29 +24,16 @@ PerfOutputCall::PerfOutputCall(
blocking_task_runner_,
base::Bind(&PerfOutputCall::OnIOComplete, weak_factory_.GetWeakPtr())));
- base::File pipe_write_end = perf_data_pipe_reader_->StartIO();
- base::PostTaskAndReplyWithResult(
- blocking_task_runner_.get(), FROM_HERE,
- base::Bind(&CreateFileDescriptor, base::Passed(&pipe_write_end)),
- base::Bind(&PerfOutputCall::OnFileDescriptorCreated,
- weak_factory_.GetWeakPtr()));
-}
-
-PerfOutputCall::~PerfOutputCall() {}
-
-void PerfOutputCall::OnFileDescriptorCreated(
- dbus::ScopedFileDescriptor file_descriptor) {
- DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(file_descriptor);
-
+ base::ScopedFD pipe_write_end = perf_data_pipe_reader_->StartIO();
chromeos::DebugDaemonClient* client =
chromeos::DBusThreadManager::Get()->GetDebugDaemonClient();
-
- client->GetPerfOutput(duration_, perf_args_, std::move(file_descriptor),
+ client->GetPerfOutput(duration_, perf_args_, pipe_write_end.get(),
base::Bind(&PerfOutputCall::OnGetPerfOutputError,
weak_factory_.GetWeakPtr()));
}
+PerfOutputCall::~PerfOutputCall() {}
+
void PerfOutputCall::OnIOComplete() {
DCHECK(thread_checker_.CalledOnValidThread());
« no previous file with comments | « chrome/browser/metrics/perf/perf_output.h ('k') | chromeos/dbus/debug_daemon_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698