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

Unified Diff: mojo/common/data_pipe_utils.cc

Issue 2608173002: Remove unused parts of //mojo/common. (Closed)
Patch Set: Created 3 years, 12 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 | « mojo/common/data_pipe_utils.h ('k') | mojo/common/user_agent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/data_pipe_utils.cc
diff --git a/mojo/common/data_pipe_utils.cc b/mojo/common/data_pipe_utils.cc
index 8540ac63473278bedd6d05978fe15fd34f23f206..bed5e858fc04e831232c15f2e15cd0cbd0b43d57 100644
--- a/mojo/common/data_pipe_utils.cc
+++ b/mojo/common/data_pipe_utils.cc
@@ -4,16 +4,9 @@
#include "mojo/common/data_pipe_utils.h"
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
#include <utility>
-#include "base/files/file_path.h"
-#include "base/files/file_util.h"
-#include "base/files/scoped_file.h"
-#include "base/message_loop/message_loop.h"
-#include "base/task_runner_util.h"
+#include "base/bind.h"
namespace mojo {
namespace common {
@@ -58,12 +51,7 @@ size_t CopyToStringHelper(
return num_bytes;
}
-size_t CopyToFileHelper(FILE* fp, const void* buffer, uint32_t num_bytes) {
- return fwrite(buffer, 1, num_bytes, fp);
-}
-
-} // namespace
-
+} // namespace
// TODO(hansmuller): Add a max_size parameter.
bool BlockingCopyToString(ScopedDataPipeConsumerHandle source,
@@ -107,25 +95,5 @@ bool MOJO_COMMON_EXPORT BlockingCopyFromString(
}
}
-bool BlockingCopyToFile(ScopedDataPipeConsumerHandle source,
- const base::FilePath& destination) {
- base::ScopedFILE fp(base::OpenFile(destination, "wb"));
- if (!fp)
- return false;
- return BlockingCopyHelper(std::move(source),
- base::Bind(&CopyToFileHelper, fp.get()));
-}
-
-void CopyToFile(ScopedDataPipeConsumerHandle source,
- const base::FilePath& destination,
- base::TaskRunner* task_runner,
- const base::Callback<void(bool)>& callback) {
- base::PostTaskAndReplyWithResult(
- task_runner,
- FROM_HERE,
- base::Bind(&BlockingCopyToFile, base::Passed(&source), destination),
- callback);
-}
-
} // namespace common
} // namespace mojo
« no previous file with comments | « mojo/common/data_pipe_utils.h ('k') | mojo/common/user_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698