mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This updates to mojo 4e4d51ce28a and mojo sdk 711a0bcfb141b4 and updates the sky package's pubspec.yaml dependency to '>=0.1.0 <0.2.0' to be compatible with the current mojo package. This includes an update to the Mojo Dart generator to produce real classes for enums and the corresponding updates for users of the KeyboardType enum in Sky as well as one scoped_ptr->std::unique_ptr in shell corresponding to a change in the Mojo EDK. When a new version of the sky and sky_services package are pushed this will fix domokit/mojo#440.
56 lines
2.0 KiB
C++
56 lines
2.0 KiB
C++
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_
|
|
#define MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_
|
|
|
|
#include <string>
|
|
|
|
#include "base/callback_forward.h"
|
|
#include "base/files/scoped_file.h"
|
|
#include "base/threading/platform_thread.h"
|
|
#include "mojo/public/cpp/system/core.h"
|
|
|
|
namespace base {
|
|
class FilePath;
|
|
class TaskRunner;
|
|
}
|
|
|
|
namespace mojo {
|
|
namespace common {
|
|
|
|
// Asynchronously copies data from source to the destination file. The given
|
|
// |callback| is run upon completion. File writes will be scheduled to the
|
|
// given |task_runner|.
|
|
void CopyToFile(ScopedDataPipeConsumerHandle source,
|
|
const base::FilePath& destination,
|
|
base::TaskRunner* task_runner,
|
|
const base::Callback<void(bool /*success*/)>& callback);
|
|
|
|
void CopyFromFile(const base::FilePath& source,
|
|
ScopedDataPipeProducerHandle destination,
|
|
uint32_t skip,
|
|
base::TaskRunner* task_runner,
|
|
const base::Callback<void(bool /*success*/)>& callback);
|
|
|
|
// Copies the data from |source| into |contents| and returns true on success and
|
|
// false on error. In case of I/O error, |contents| holds the data that could
|
|
// be read from source before the error occurred.
|
|
bool BlockingCopyToString(ScopedDataPipeConsumerHandle source,
|
|
std::string* contents);
|
|
|
|
bool BlockingCopyFromString(const std::string& source,
|
|
const ScopedDataPipeProducerHandle& destination);
|
|
|
|
// Synchronously copies source data to a temporary file, returning a file
|
|
// pointer on success and NULL on error. The temporary file is unlinked
|
|
// immediately so that it is only accessible by file pointer (and removed once
|
|
// closed or the creating process dies).
|
|
base::ScopedFILE BlockingCopyToTempFile(ScopedDataPipeConsumerHandle source);
|
|
|
|
} // namespace common
|
|
} // namespace mojo
|
|
|
|
#endif // MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_
|