Skip to content

Commit

Permalink
Update uses of mtl::MessageLoop::task_runner() accessor. (flutter#3097)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Brown authored Oct 4, 2016
1 parent e13412b commit adb62de
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion assets/directory_asset_bundle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void DirectoryAssetBundle::GetAsStream(
if (fd.get() < 0)
return;
glue::CopyFromFileDescriptor(std::move(fd), std::move(pipe.producer_handle),
task_runner_.get(), [](bool ignored) {});
task_runner_, [](bool ignored) {});
}

DirectoryAssetBundle::~DirectoryAssetBundle() {}
Expand Down
2 changes: 1 addition & 1 deletion assets/zip_asset_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void ZipAssetStore::GetAsStream(const std::string& asset_name,
if (fd.get() < 0)
return;
glue::CopyFromFileDescriptor(std::move(fd), std::move(producer),
task_runner_.get(), [](bool ignored) {});
task_runner_, [](bool ignored) {});
} else {
zip::UniqueUnzipper unzipper = unzipper_provider_();
if (!unzipper.is_valid())
Expand Down
22 changes: 11 additions & 11 deletions glue/data_pipe_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CopyToFileHandler {
public:
CopyToFileHandler(mojo::ScopedDataPipeConsumerHandle source,
ftl::UniqueFD destination,
ftl::TaskRunner* task_runner,
ftl::RefPtr<ftl::TaskRunner> task_runner,
const std::function<void(bool)>& callback);

private:
Expand All @@ -46,11 +46,11 @@ class CopyToFileHandler {

CopyToFileHandler::CopyToFileHandler(mojo::ScopedDataPipeConsumerHandle source,
ftl::UniqueFD destination,
ftl::TaskRunner* task_runner,
ftl::RefPtr<ftl::TaskRunner> task_runner,
const std::function<void(bool)>& callback)
: source_(std::move(source)),
destination_(std::move(destination)),
task_runner_(task_runner),
task_runner_(std::move(task_runner)),
callback_(callback),
waiter_(mojo::Environment::GetDefaultAsyncWaiter()),
wait_id_(0) {
Expand Down Expand Up @@ -109,7 +109,7 @@ class CopyFromFileHandler {
public:
CopyFromFileHandler(ftl::UniqueFD source,
mojo::ScopedDataPipeProducerHandle destination,
ftl::TaskRunner* task_runner,
ftl::RefPtr<ftl::TaskRunner> task_runner,
const std::function<void(bool)>& callback);

private:
Expand All @@ -132,11 +132,11 @@ class CopyFromFileHandler {
CopyFromFileHandler::CopyFromFileHandler(
ftl::UniqueFD source,
mojo::ScopedDataPipeProducerHandle destination,
ftl::TaskRunner* task_runner,
ftl::RefPtr<ftl::TaskRunner> task_runner,
const std::function<void(bool)>& callback)
: source_(std::move(source)),
destination_(std::move(destination)),
task_runner_(task_runner),
task_runner_(std::move(task_runner)),
callback_(callback),
waiter_(mojo::Environment::GetDefaultAsyncWaiter()),
wait_id_(0) {
Expand Down Expand Up @@ -194,18 +194,18 @@ void CopyFromFileHandler::WaitComplete(void* context, MojoResult result) {

void CopyToFileDescriptor(mojo::ScopedDataPipeConsumerHandle source,
ftl::UniqueFD destination,
ftl::TaskRunner* task_runner,
ftl::RefPtr<ftl::TaskRunner> task_runner,
const std::function<void(bool)>& callback) {
new CopyToFileHandler(std::move(source), std::move(destination), task_runner,
callback);
new CopyToFileHandler(std::move(source), std::move(destination),
std::move(task_runner), callback);
}

void CopyFromFileDescriptor(ftl::UniqueFD source,
mojo::ScopedDataPipeProducerHandle destination,
ftl::TaskRunner* task_runner,
ftl::RefPtr<ftl::TaskRunner> task_runner,
const std::function<void(bool)>& callback) {
new CopyFromFileHandler(std::move(source), std::move(destination),
task_runner, callback);
std::move(task_runner), callback);
}

} // namespace glue
4 changes: 2 additions & 2 deletions glue/data_pipe_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace glue {
void CopyToFileDescriptor(
mojo::ScopedDataPipeConsumerHandle source,
ftl::UniqueFD destination,
ftl::TaskRunner* task_runner,
ftl::RefPtr<ftl::TaskRunner> task_runner,
const std::function<void(bool /*success*/)>& callback);

// Asynchronously copies data from source file to the destination. The given
Expand All @@ -30,7 +30,7 @@ void CopyToFileDescriptor(
void CopyFromFileDescriptor(
ftl::UniqueFD source,
mojo::ScopedDataPipeProducerHandle destination,
ftl::TaskRunner* task_runner,
ftl::RefPtr<ftl::TaskRunner> task_runner,
const std::function<void(bool /*success*/)>& callback);

} // namespace glue
Expand Down

0 comments on commit adb62de

Please sign in to comment.