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

Unified Diff: mojo/public/cpp/bindings/tests/handle_passing_unittest.cc

Issue 2136733002: Mojo C++ bindings: add a new mode to generator to use native STL/WTF types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@67_new
Patch Set: . Created 4 years, 5 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
Index: mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc b/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
index 417b857410a1cea8c17c00a7c1989f93c0ca8abb..0bd9b283b66dd6756e0329dd9938ea184789f620 100644
--- a/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
@@ -22,12 +22,12 @@ const char kText2[] = "world";
void RecordString(std::string* storage,
const base::Closure& closure,
- String str) {
- *storage = str.PassStorage();
+ const std::string& str) {
+ *storage = str;
closure.Run();
}
-base::Callback<void(mojo::String)> MakeStringRecorder(
+base::Callback<void(const std::string&)> MakeStringRecorder(
std::string* storage,
const base::Closure& closure) {
return base::Bind(&RecordString, storage, closure);
@@ -58,7 +58,7 @@ class SampleNamedObjectImpl : public sample::NamedObject {
public:
explicit SampleNamedObjectImpl(InterfaceRequest<sample::NamedObject> request)
: binding_(this, std::move(request)) {}
- void SetName(const mojo::String& name) override { name_ = name; }
+ void SetName(const std::string& name) override { name_ = name; }
void GetName(const GetNameCallback& callback) override {
callback.Run(name_);
@@ -167,7 +167,7 @@ void DoStuff(bool* got_response,
std::string* got_text_reply,
const base::Closure& closure,
sample::ResponsePtr response,
- String text_reply) {
+ const std::string& text_reply) {
*got_text_reply = text_reply;
if (response->pipe.is_valid()) {
@@ -190,9 +190,9 @@ void DoStuff(bool* got_response,
}
void DoStuff2(bool* got_response,
- std::string* got_text_reply,
- const base::Closure& closure,
- String text_reply) {
+ std::string* got_text_reply,
+ const base::Closure& closure,
+ const std::string& text_reply) {
*got_response = true;
*got_text_reply = text_reply;
closure.Run();
@@ -304,7 +304,7 @@ TEST_F(HandlePassingTest, PipesAreClosed) {
MojoHandle handle1_value = extra_pipe.handle1.get().value();
{
- Array<ScopedMessagePipeHandle> pipes(2);
+ std::vector<ScopedMessagePipeHandle> pipes(2);
pipes[0] = std::move(extra_pipe.handle0);
pipes[1] = std::move(extra_pipe.handle1);
« no previous file with comments | « mojo/public/cpp/bindings/tests/equals_unittest.cc ('k') | mojo/public/cpp/bindings/tests/pickle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698