mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Go directly from vmo to vector<char> (instead of via string) (#3170)
This commit is contained in:
parent
a8604ba9d2
commit
bbc8f5fe22
@ -9,7 +9,7 @@
|
||||
#include "flutter/content_handler/runtime_holder.h"
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/mtl/data_pipe/vector.h"
|
||||
#include "lib/mtl/shared_buffer/strings.h"
|
||||
#include "lib/mtl/shared_buffer/vector.h"
|
||||
#include "lib/zip/unzipper.h"
|
||||
#include "mojo/public/cpp/application/connect.h"
|
||||
|
||||
@ -30,13 +30,11 @@ ApplicationImpl::ApplicationImpl(
|
||||
return;
|
||||
}
|
||||
} else if (response->body->is_buffer()) {
|
||||
std::string string;
|
||||
bool result = mtl::StringFromSharedBuffer(std::move(response->body->get_buffer()), &string);
|
||||
bool result = mtl::VectorFromSharedBuffer(std::move(response->body->get_buffer()), &bundle_);
|
||||
if (!result) {
|
||||
FTL_LOG(ERROR) << "Failed to receive bundle.";
|
||||
return;
|
||||
}
|
||||
bundle_.assign(string.begin(), string.end());
|
||||
} else {
|
||||
FTL_NOTREACHED();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user