提交 cb40b67f 编写于 作者: M mikejurka 提交者: GitHub

Roll mojo (#2881)

* Update to mojo ba13534f2b2af27a1d73e176f7406dbab25f8e14

* Fix build for updated mojo

* Fix android build. Undo some of the mojo roll.

* Fix iOS build.
上级 2dc2fac0
......@@ -20,7 +20,7 @@
vars = {
'chromium_git': 'https://chromium.googlesource.com',
'fuchsia_git': 'https://fuchsia.googlesource.com',
'mojo_sdk_revision': 'b200aa62c93647a0421b9239804ef5ce1509ab20',
'mojo_sdk_revision': '6b5fb1227c742f5ecc077486ebc029f2711c61fa',
'base_revision': '672b04e54b937ec899429a6bd5409c5a6300d151',
'skia_revision': 'd1bdd1fcbd308afb9903f39d231742f5c951cf07',
......@@ -286,4 +286,29 @@ hooks = [
'src/tools',
],
},
# Pull the mojom generator binaries using checked-in hashes.
{
'name': 'mojom_generators',
'pattern': '',
'action': [ 'download_from_google_storage.py',
'--no_resume',
'--quiet',
'--platform=linux*',
'--no_auth',
'--bucket', 'mojo/mojom_parser/linux64/generators',
'-d', 'src/mojo/public/tools/bindings/mojom_tool/bin/linux64/generators',
],
},
{
'name': 'mojom_generators',
'pattern': '',
'action': [ 'download_from_google_storage.py',
'--no_resume',
'--quiet',
'--platform=darwin',
'--no_auth',
'--bucket', 'mojo/mojom_parser/mac64/generators',
'-d', 'src/mojo/public/tools/bindings/mojom_tool/bin/mac64/generators',
],
},
]
fd8d18dbf7a4f9ed8a607648cca6d2c595b1c580
\ No newline at end of file
ba13534f2b2af27a1d73e176f7406dbab25f8e14
\ No newline at end of file
......@@ -29,6 +29,7 @@ source_set("content_handler") {
"//base",
"//mojo/environment:chromium",
"//mojo/message_pump",
"//mojo/public/cpp/bindings",
"//mojo/public/interfaces/application",
"//mojo/services/content_handler/interfaces",
"//mojo/services/network/interfaces",
......
......@@ -6,37 +6,22 @@ import("//mojo/public/mojo_application.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//testing/test.gni")
source_set("common") {
sources = [
"binding_set.h",
"interface_ptr_set.h",
"strong_binding_set.h",
]
deps = [
"//base",
"//mojo/public/cpp/bindings",
]
# TODO(vtl): Remove this when tonic stops depending on a :common target.
group("common") {
}
# TODO(vtl): callback_binding_unittest.cc is orphaned. This target (and
# :mojo_common_apptests) should be moved somewhere else, but where?
source_set("tests") {
testonly = true
sources = [
"binding_set_unittest.cc",
"callback_binding_unittest.cc",
"interface_ptr_set_unittest.cc",
"strong_binding_set_unittest.cc",
]
deps = [
":common",
":test_interfaces",
"//base",
"//mojo/message_pump",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/bindings:callback",
"//mojo/public/cpp/system",
"//testing/gtest",
]
}
......@@ -51,13 +36,7 @@ mojo_native_application("mojo_common_apptests") {
]
}
mojom("test_interfaces") {
testonly = true
sources = [
"test_interfaces.mojom",
]
}
# TODO(vtl): This should probably be moved into its own directory.
source_set("tracing_impl") {
sources = [
"trace_provider_impl.cc",
......
// 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_COMMON_BINDING_SET_H_
#define MOJO_COMMON_BINDING_SET_H_
#include <algorithm>
#include <memory>
#include <vector>
#include "base/logging.h"
#include "base/macros.h"
#include "mojo/public/cpp/bindings/binding.h"
namespace mojo {
// Use this class to manage a set of bindings each of which is
// owned by the pipe it is bound to.
template <typename Interface>
class BindingSet {
public:
BindingSet() {}
~BindingSet() { CloseAllBindings(); }
// Adds a binding to the list and arranges for it to be removed when
// a connection error occurs. Does not take ownership of |impl|, which
// must outlive the binding set.
void AddBinding(Interface* impl, InterfaceRequest<Interface> request) {
bindings_.emplace_back(new Binding<Interface>(impl, request.Pass()));
auto* binding = bindings_.back().get();
// Set the connection error handler for the newly added Binding to be a
// function that will erase it from the vector.
binding->set_connection_error_handler([this, binding]() {
auto it =
std::find_if(bindings_.begin(), bindings_.end(),
[binding](const std::unique_ptr<Binding<Interface>>& b) {
return (b.get() == binding);
});
DCHECK(it != bindings_.end());
bindings_.erase(it);
});
}
void CloseAllBindings() { bindings_.clear(); }
size_t size() const { return bindings_.size(); }
private:
std::vector<std::unique_ptr<Binding<Interface>>> bindings_;
DISALLOW_COPY_AND_ASSIGN(BindingSet);
};
} // namespace mojo
#endif // MOJO_COMMON_BINDING_SET_H_
// Copyright 2015 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.
#include "mojo/common/binding_set.h"
#include "base/message_loop/message_loop.h"
#include "mojo/common/test_interfaces.mojom.h"
#include "mojo/message_pump/message_pump_mojo.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace common {
namespace {
class DummyImpl : public tests::Dummy {
public:
DummyImpl() {}
void Foo() override { call_count_++; }
int call_count() const { return call_count_; }
private:
int call_count_ = 0;
DISALLOW_COPY_AND_ASSIGN(DummyImpl);
};
// Tests all of the functionality of BindingSet.
TEST(BindingSetTest, FullLifeCycle) {
base::MessageLoop loop(MessagePumpMojo::Create());
// Create 10 InterfacePtrs and DummyImpls.
const size_t kNumObjects = 10;
InterfacePtr<tests::Dummy> intrfc_ptrs[kNumObjects];
DummyImpl impls[kNumObjects];
// Create 10 message pipes, bind everything together, and add the
// bindings to binding_set.
BindingSet<tests::Dummy> binding_set;
EXPECT_EQ(0u, binding_set.size());
for (size_t i = 0; i < kNumObjects; i++) {
binding_set.AddBinding(&impls[i], GetProxy(&intrfc_ptrs[i]));
}
EXPECT_EQ(kNumObjects, binding_set.size());
// Check that initially all call counts are zero.
for (const auto& impl : impls) {
EXPECT_EQ(0, impl.call_count());
}
// Invoke method foo() on all 10 InterfacePointers.
for (InterfacePtr<tests::Dummy>& ptr : intrfc_ptrs) {
ptr->Foo();
}
// Check that now all call counts are one.
loop.RunUntilIdle();
for (const auto& impl : impls) {
EXPECT_EQ(1, impl.call_count());
}
// Close the first 5 message pipes and destroy the first five
// InterfacePtrs.
for (size_t i = 0; i < kNumObjects / 2; i++) {
intrfc_ptrs[i].reset();
}
// Check that the set contains only five elements now.
loop.RunUntilIdle();
EXPECT_EQ(kNumObjects / 2, binding_set.size());
// Invoke method foo() on the second five InterfacePointers.
for (size_t i = kNumObjects / 2; i < kNumObjects; i++) {
intrfc_ptrs[i]->Foo();
}
loop.RunUntilIdle();
// Check that now the first five counts are still 1 but the second five
// counts are two.
for (size_t i = 0; i < kNumObjects; i++) {
int expected = (i < kNumObjects / 2 ? 1 : 2);
EXPECT_EQ(expected, impls[i].call_count());
}
// Invoke CloseAllBindings
binding_set.CloseAllBindings();
EXPECT_EQ(0u, binding_set.size());
// Invoke method foo() on the second five InterfacePointers.
for (size_t i = kNumObjects / 2; i < kNumObjects; i++) {
intrfc_ptrs[i]->Foo();
}
loop.RunUntilIdle();
// Check that the call counts are the same as before.
for (size_t i = 0; i < kNumObjects; i++) {
int expected = (i < kNumObjects / 2 ? 1 : 2);
EXPECT_EQ(expected, impls[i].call_count());
}
}
} // namespace
} // namespace common
} // namespace mojo
// 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_COMMON_INTERFACE_PTR_SET_H_
#define MOJO_COMMON_INTERFACE_PTR_SET_H_
#include <vector>
#include "base/logging.h"
#include "mojo/public/cpp/bindings/interface_ptr.h"
namespace mojo {
// An InterfacePtrSet contains a collection of InterfacePtrs
// that are automatically removed from the collection and destroyed
// when their associated MessagePipe experiences a connection error.
// When the set is destroyed all of the MessagePipes will be closed.
template <typename Interface>
class InterfacePtrSet {
public:
InterfacePtrSet() {}
~InterfacePtrSet() { CloseAll(); }
// |ptr| must be bound to a message pipe.
void AddInterfacePtr(InterfacePtr<Interface> ptr) {
DCHECK(ptr.is_bound());
ptrs_.emplace_back(ptr.Pass());
InterfacePtr<Interface>& intrfc_ptr = ptrs_.back();
Interface* pointer = intrfc_ptr.get();
// Set the connection error handler for the newly added InterfacePtr to be a
// function that will erase it from the vector.
intrfc_ptr.set_connection_error_handler([pointer, this]() {
// Since InterfacePtr itself is a movable type, the thing that uniquely
// identifies the InterfacePtr we wish to erase is its Interface*.
auto it = std::find_if(ptrs_.begin(), ptrs_.end(),
[pointer](const InterfacePtr<Interface>& p) {
return (p.get() == pointer);
});
DCHECK(it != ptrs_.end());
ptrs_.erase(it);
});
}
// Applies |function| to each of the InterfacePtrs in the set.
template <typename FunctionType>
void ForAllPtrs(FunctionType function) {
for (const auto& it : ptrs_) {
if (it)
function(it.get());
}
}
// Closes the MessagePipe associated with each of the InterfacePtrs in
// this set and clears the set.
void CloseAll() {
for (auto& it : ptrs_) {
if (it)
it.reset();
}
ptrs_.clear();
}
size_t size() const { return ptrs_.size(); }
private:
std::vector<InterfacePtr<Interface>> ptrs_;
};
} // namespace mojo
#endif // MOJO_COMMON_INTERFACE_PTR_SET_H_
// Copyright 2015 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.
#include "mojo/common/interface_ptr_set.h"
#include "base/message_loop/message_loop.h"
#include "mojo/common/test_interfaces.mojom.h"
#include "mojo/message_pump/message_pump_mojo.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace common {
namespace {
class DummyImpl : public tests::Dummy {
public:
explicit DummyImpl(InterfaceRequest<tests::Dummy> request)
: binding_(this, request.Pass()) {}
void Foo() override { call_count_++; }
void CloseMessagePipe() { binding_.Close(); }
int call_count() { return call_count_; }
private:
Binding<tests::Dummy> binding_;
int call_count_ = 0;
DISALLOW_COPY_AND_ASSIGN(DummyImpl);
};
// Tests all of the functionality of InterfacePtrSet.
TEST(InterfacePtrSetTest, FullLifeCycle) {
base::MessageLoop loop(MessagePumpMojo::Create());
// Create 10 InterfacePtrs.
const size_t kNumObjects = 10;
InterfacePtr<tests::Dummy> intrfc_ptrs[kNumObjects];
// Create 10 DummyImpls and 10 message pipes and bind them all together.
std::unique_ptr<DummyImpl> impls[kNumObjects];
for (size_t i = 0; i < kNumObjects; i++) {
impls[i].reset(new DummyImpl(GetProxy(&intrfc_ptrs[i])));
}
// Move all 10 InterfacePtrs into the set.
InterfacePtrSet<tests::Dummy> intrfc_ptr_set;
EXPECT_EQ(0u, intrfc_ptr_set.size());
for (InterfacePtr<tests::Dummy>& ptr : intrfc_ptrs) {
intrfc_ptr_set.AddInterfacePtr(ptr.Pass());
}
EXPECT_EQ(kNumObjects, intrfc_ptr_set.size());
// Check that initially all call counts are zero.
for (const std::unique_ptr<DummyImpl>& impl : impls) {
EXPECT_EQ(0, impl->call_count());
}
// Invoke ForAllPtrs().
size_t num_invocations = 0;
intrfc_ptr_set.ForAllPtrs([&num_invocations](tests::Dummy* dummy) {
dummy->Foo();
num_invocations++;
});
EXPECT_EQ(kNumObjects, num_invocations);
// Check that now all call counts are one.
loop.RunUntilIdle();
for (const std::unique_ptr<DummyImpl>& impl : impls) {
EXPECT_EQ(1, impl->call_count());
}
// Close the first 5 message pipes. This will (after RunUntilIdle) cause
// connection errors on the closed pipes which will cause the first five
// objects to be removed.
for (size_t i = 0; i < kNumObjects / 2; i++) {
impls[i]->CloseMessagePipe();
}
EXPECT_EQ(kNumObjects, intrfc_ptr_set.size());
loop.RunUntilIdle();
EXPECT_EQ(kNumObjects / 2, intrfc_ptr_set.size());
// Invoke ForAllPtrs again on the remaining five pointers
intrfc_ptr_set.ForAllPtrs([](tests::Dummy* dummy) { dummy->Foo(); });
loop.RunUntilIdle();
// Check that now the first five counts are still 1 but the second five
// counts are two.
for (size_t i = 0; i < kNumObjects; i++) {
int expected = (i < kNumObjects / 2 ? 1 : 2);
EXPECT_EQ(expected, impls[i]->call_count());
}
// Close all of the MessagePipes and clear the set.
intrfc_ptr_set.CloseAll();
// Invoke ForAllPtrs() again.
intrfc_ptr_set.ForAllPtrs([](tests::Dummy* dummy) { dummy->Foo(); });
loop.RunUntilIdle();
// Check that the counts are the same as last time.
for (size_t i = 0; i < kNumObjects; i++) {
int expected = (i < kNumObjects / 2 ? 1 : 2);
EXPECT_EQ(expected, impls[i]->call_count());
}
EXPECT_EQ(0u, intrfc_ptr_set.size());
}
} // namespace
} // namespace common
} // namespace mojo
// 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_COMMON_STRONG_BINDING_SET_H_
#define MOJO_COMMON_STRONG_BINDING_SET_H_
#include <algorithm>
#include <memory>
#include <vector>
#include "base/logging.h"
#include "base/macros.h"
#include "mojo/public/cpp/bindings/binding.h"
namespace mojo {
// Use this class to manage a set of strong bindings each of which is
// owned by the pipe it is bound to. The set takes ownership of the
// interfaces and will delete them when the bindings are closed.
template <typename Interface>
class StrongBindingSet {
public:
StrongBindingSet() {}
~StrongBindingSet() { CloseAllBindings(); }
// Adds a binding to the list and arranges for it to be removed when
// a connection error occurs. Takes ownership of |impl|, which
// will be deleted when the binding is closed.
void AddBinding(Interface* impl, InterfaceRequest<Interface> request) {
bindings_.emplace_back(new Binding<Interface>(impl, request.Pass()));
auto* binding = bindings_.back().get();
// Set the connection error handler for the newly added Binding to be a
// function that will erase it from the vector.
binding->set_connection_error_handler([this, binding]() {
auto it =
std::find_if(bindings_.begin(), bindings_.end(),
[binding](const std::unique_ptr<Binding<Interface>>& b) {
return (b.get() == binding);
});
DCHECK(it != bindings_.end());
delete binding->impl();
bindings_.erase(it);
});
}
// Removes all bindings for the specified interface implementation.
// The implementation object is not destroyed.
void RemoveBindings(Interface* impl) {
bindings_.erase(
std::remove_if(bindings_.begin(), bindings_.end(),
[impl](const std::unique_ptr<Binding<Interface>>& b) {
return (b->impl() == impl);
}));
}
// Closes all bindings and deletes their associated interfaces.
void CloseAllBindings() {
for (auto it = bindings_.begin(); it != bindings_.end(); ++it) {
delete (*it)->impl();
}
bindings_.clear();
}
size_t size() const { return bindings_.size(); }
private:
std::vector<std::unique_ptr<Binding<Interface>>> bindings_;
DISALLOW_COPY_AND_ASSIGN(StrongBindingSet);
};
} // namespace mojo
#endif // MOJO_COMMON_STRONG_BINDING_SET_H_
// Copyright 2015 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.
#include "mojo/common/strong_binding_set.h"
#include "base/message_loop/message_loop.h"
#include "mojo/common/test_interfaces.mojom.h"
#include "mojo/message_pump/message_pump_mojo.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace common {
namespace {
class DummyImpl : public tests::Dummy {
public:
explicit DummyImpl(bool* deleted_flag) : deleted_flag_(deleted_flag) {}
~DummyImpl() override { *deleted_flag_ = true; }
void Foo() override { call_count_++; }
int call_count() const { return call_count_; }
private:
bool* deleted_flag_;
int call_count_ = 0;
DISALLOW_COPY_AND_ASSIGN(DummyImpl);
};
// Tests all of the functionality of StrongBindingSet.
TEST(StrongBindingSetTest, FullLifeCycle) {
base::MessageLoop loop(MessagePumpMojo::Create());
// Create 10 InterfacePtrs and DummyImpls.
const size_t kNumObjects = 10;
InterfacePtr<tests::Dummy> intrfc_ptrs[kNumObjects];
DummyImpl* impls[kNumObjects];
bool deleted_flags[kNumObjects] = {};
// Create 10 message pipes, bind everything together, and add the
// bindings to binding_set.
StrongBindingSet<tests::Dummy> binding_set;
EXPECT_EQ(0u, binding_set.size());
for (size_t i = 0; i < kNumObjects; i++) {
impls[i] = new DummyImpl(&deleted_flags[i]);
binding_set.AddBinding(impls[i], GetProxy(&intrfc_ptrs[i]));
}
EXPECT_EQ(kNumObjects, binding_set.size());
// Check that initially all call counts are zero.
for (const auto& impl : impls) {
EXPECT_EQ(0, impl->call_count());
}
// Invoke method foo() on all 10 InterfacePointers.
for (InterfacePtr<tests::Dummy>& ptr : intrfc_ptrs) {
ptr->Foo();
}
// Check that now all call counts are one.
loop.RunUntilIdle();
for (const auto& impl : impls) {
EXPECT_EQ(1, impl->call_count());
}
// Close the first 5 message pipes and destroy the first five
// InterfacePtrs.
for (size_t i = 0; i < kNumObjects / 2; i++) {
intrfc_ptrs[i].reset();
}
// Check that the set contains only five elements now.
loop.RunUntilIdle();
EXPECT_EQ(kNumObjects / 2, binding_set.size());
// Check that the first 5 interfaces have all been deleted.
for (size_t i = 0; i < kNumObjects; i++) {
bool expected = (i < kNumObjects / 2);
EXPECT_EQ(expected, deleted_flags[i]);
}
// Invoke method foo() on the second five InterfacePointers.
for (size_t i = kNumObjects / 2; i < kNumObjects; i++) {
intrfc_ptrs[i]->Foo();
}
loop.RunUntilIdle();
// Check that now the second five counts are two.
for (size_t i = kNumObjects / 2; i < kNumObjects; i++) {
EXPECT_EQ(2, impls[i]->call_count());
}
// Invoke CloseAllBindings
binding_set.CloseAllBindings();
EXPECT_EQ(0u, binding_set.size());
// Invoke method foo() on the second five InterfacePointers.
for (size_t i = kNumObjects / 2; i < kNumObjects; i++) {
intrfc_ptrs[i]->Foo();
}
loop.RunUntilIdle();
// Check that all interfaces have all been deleted.
for (size_t i = 0; i < kNumObjects; i++) {
EXPECT_TRUE(deleted_flags[i]);
}
}
} // namespace
} // namespace common
} // namespace mojo
// Copyright 2015 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.
module mojo.common.tests;
interface Dummy {
Foo();
};
## 0.4.27
- 18 changes: https://github.com/domokit/mojo/compare/5f0e8bf...9397aa5
MOJO_SDK: 9397aa588d55e96077c3859d4a136e4e6adf57ea
## 0.4.26
- 72 changes: https://github.com/domokit/mojo/compare/db036b1...38c5dbd
MOJO_SDK: 38c5dbd1426e105d42d6b070b8e4089c9db957eb
## 0.4.25
- 51 changes: https://github.com/domokit/mojo/compare/38edfe4...ee5b33c
......
......@@ -2,7 +2,6 @@
// See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py.
library application_mojom;
import 'dart:async';
import 'package:mojo/bindings.dart' as bindings;
import 'package:mojo/core.dart' as core;
import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as service_describer;
......@@ -27,39 +26,15 @@ class _ApplicationInitializeParams extends bindings.Struct {
String this.url
) : super(kVersions.last.size);
static _ApplicationInitializeParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static _ApplicationInitializeParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static _ApplicationInitializeParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
_ApplicationInitializeParams result = new _ApplicationInitializeParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.shell = decoder0.decodeServiceInterface(8, false, shell_mojom.ShellProxy.newFromEndpoint);
......@@ -87,14 +62,12 @@ class _ApplicationInitializeParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "_ApplicationInitializeParams";
String fieldName;
try {
fieldName = "shell";
encoder0.encodeInterface(shell, 8, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"shell of struct _ApplicationInitializeParams: $e";
rethrow;
}
try {
fieldName = "args";
if (args == null) {
encoder0.encodeNullPointer(16, true);
} else {
......@@ -103,16 +76,10 @@ class _ApplicationInitializeParams extends bindings.Struct {
encoder1.encodeString(args[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"args of struct _ApplicationInitializeParams: $e";
rethrow;
}
try {
fieldName = "url";
encoder0.encodeString(url, 24, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"url of struct _ApplicationInitializeParams: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......@@ -147,39 +114,15 @@ class _ApplicationAcceptConnectionParams extends bindings.Struct {
service_provider_mojom.ServiceProviderInterfaceRequest this.services
) : super(kVersions.last.size);
static _ApplicationAcceptConnectionParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static _ApplicationAcceptConnectionParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static _ApplicationAcceptConnectionParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
_ApplicationAcceptConnectionParams result = new _ApplicationAcceptConnectionParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.requestorUrl = decoder0.decodeString(8, false);
......@@ -197,25 +140,17 @@ class _ApplicationAcceptConnectionParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "_ApplicationAcceptConnectionParams";
String fieldName;
try {
fieldName = "requestorUrl";
encoder0.encodeString(requestorUrl, 8, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"requestorUrl of struct _ApplicationAcceptConnectionParams: $e";
rethrow;
}
try {
fieldName = "resolvedUrl";
encoder0.encodeString(resolvedUrl, 16, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"resolvedUrl of struct _ApplicationAcceptConnectionParams: $e";
rethrow;
}
try {
fieldName = "services";
encoder0.encodeInterfaceRequest(services, 24, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"services of struct _ApplicationAcceptConnectionParams: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......@@ -244,44 +179,27 @@ class _ApplicationRequestQuitParams extends bindings.Struct {
_ApplicationRequestQuitParams.init(
) : super(kVersions.last.size);
static _ApplicationRequestQuitParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static _ApplicationRequestQuitParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static _ApplicationRequestQuitParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
_ApplicationRequestQuitParams result = new _ApplicationRequestQuitParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
bindings.Struct.checkVersion(decoder0, kVersions);
return result;
}
void encode(bindings.Encoder encoder) {
encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "_ApplicationRequestQuitParams";
String fieldName;
try {
} on bindings.MojoCodecError catch(e) {
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
String toString() {
......
......@@ -2,7 +2,6 @@
// See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py.
library application_connector_mojom;
import 'dart:async';
import 'package:mojo/bindings.dart' as bindings;
import 'package:mojo/core.dart' as core;
import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as service_describer;
......@@ -24,39 +23,15 @@ class _ApplicationConnectorConnectToApplicationParams extends bindings.Struct {
service_provider_mojom.ServiceProviderInterfaceRequest this.services
) : super(kVersions.last.size);
static _ApplicationConnectorConnectToApplicationParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static _ApplicationConnectorConnectToApplicationParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static _ApplicationConnectorConnectToApplicationParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
_ApplicationConnectorConnectToApplicationParams result = new _ApplicationConnectorConnectToApplicationParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.applicationUrl = decoder0.decodeString(8, false);
......@@ -70,18 +45,15 @@ class _ApplicationConnectorConnectToApplicationParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "_ApplicationConnectorConnectToApplicationParams";
String fieldName;
try {
fieldName = "applicationUrl";
encoder0.encodeString(applicationUrl, 8, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"applicationUrl of struct _ApplicationConnectorConnectToApplicationParams: $e";
rethrow;
}
try {
fieldName = "services";
encoder0.encodeInterfaceRequest(services, 16, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"services of struct _ApplicationConnectorConnectToApplicationParams: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......@@ -111,39 +83,15 @@ class _ApplicationConnectorDuplicateParams extends bindings.Struct {
ApplicationConnectorInterfaceRequest this.applicationConnectorRequest
) : super(kVersions.last.size);
static _ApplicationConnectorDuplicateParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static _ApplicationConnectorDuplicateParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static _ApplicationConnectorDuplicateParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
_ApplicationConnectorDuplicateParams result = new _ApplicationConnectorDuplicateParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.applicationConnectorRequest = decoder0.decodeInterfaceRequest(8, false, ApplicationConnectorStub.newFromEndpoint);
......@@ -153,11 +101,13 @@ class _ApplicationConnectorDuplicateParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "_ApplicationConnectorDuplicateParams";
String fieldName;
try {
fieldName = "applicationConnectorRequest";
encoder0.encodeInterfaceRequest(applicationConnectorRequest, 8, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"applicationConnectorRequest of struct _ApplicationConnectorDuplicateParams: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......
......@@ -32,39 +32,15 @@ class MojomFile extends bindings.Struct {
String this.serializedRuntimeTypeInfo
) : super(kVersions.last.size);
static MojomFile deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static MojomFile deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static MojomFile decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
MojomFile result = new MojomFile();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.fileName = decoder0.decodeString(8, false);
......@@ -120,28 +96,16 @@ class MojomFile extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "MojomFile";
String fieldName;
try {
fieldName = "fileName";
encoder0.encodeString(fileName, 8, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"fileName of struct MojomFile: $e";
rethrow;
}
try {
fieldName = "specifiedFileName";
encoder0.encodeString(specifiedFileName, 16, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"specifiedFileName of struct MojomFile: $e";
rethrow;
}
try {
fieldName = "moduleNamespace";
encoder0.encodeString(moduleNamespace, 24, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"moduleNamespace of struct MojomFile: $e";
rethrow;
}
try {
fieldName = "attributes";
if (attributes == null) {
encoder0.encodeNullPointer(32, true);
} else {
......@@ -150,12 +114,7 @@ class MojomFile extends bindings.Struct {
encoder1.encodeStruct(attributes[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"attributes of struct MojomFile: $e";
rethrow;
}
try {
fieldName = "imports";
if (imports == null) {
encoder0.encodeNullPointer(40, true);
} else {
......@@ -164,23 +123,12 @@ class MojomFile extends bindings.Struct {
encoder1.encodeString(imports[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"imports of struct MojomFile: $e";
rethrow;
}
try {
fieldName = "declaredMojomObjects";
encoder0.encodeStruct(declaredMojomObjects, 48, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"declaredMojomObjects of struct MojomFile: $e";
rethrow;
}
try {
fieldName = "serializedRuntimeTypeInfo";
encoder0.encodeString(serializedRuntimeTypeInfo, 56, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"serializedRuntimeTypeInfo of struct MojomFile: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......@@ -226,39 +174,15 @@ class MojomFileGraph extends bindings.Struct {
Map<String, mojom_types_mojom.DeclaredConstant> this.resolvedConstants
) : super(kVersions.last.size);
static MojomFileGraph deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static MojomFileGraph deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static MojomFileGraph decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
MojomFileGraph result = new MojomFileGraph();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
var decoder1 = decoder0.decodePointer(8, false);
......@@ -375,7 +299,10 @@ class MojomFileGraph extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "MojomFileGraph";
String fieldName;
try {
fieldName = "files";
if (files == null) {
encoder0.encodeNullPointer(8, false);
} else {
......@@ -397,12 +324,7 @@ class MojomFileGraph extends bindings.Struct {
}
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"files of struct MojomFileGraph: $e";
rethrow;
}
try {
fieldName = "resolvedTypes";
if (resolvedTypes == null) {
encoder0.encodeNullPointer(16, false);
} else {
......@@ -424,12 +346,7 @@ class MojomFileGraph extends bindings.Struct {
}
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"resolvedTypes of struct MojomFileGraph: $e";
rethrow;
}
try {
fieldName = "resolvedConstants";
if (resolvedConstants == null) {
encoder0.encodeNullPointer(24, false);
} else {
......@@ -452,8 +369,7 @@ class MojomFileGraph extends bindings.Struct {
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"resolvedConstants of struct MojomFileGraph: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......@@ -499,39 +415,15 @@ class KeysByType extends bindings.Struct {
List<String> this.embeddedConstants
) : super(kVersions.last.size);
static KeysByType deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static KeysByType deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static KeysByType decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
KeysByType result = new KeysByType();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
var decoder1 = decoder0.decodePointer(8, true);
......@@ -635,7 +527,10 @@ class KeysByType extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "KeysByType";
String fieldName;
try {
fieldName = "interfaces";
if (interfaces == null) {
encoder0.encodeNullPointer(8, true);
} else {
......@@ -644,12 +539,7 @@ class KeysByType extends bindings.Struct {
encoder1.encodeString(interfaces[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"interfaces of struct KeysByType: $e";
rethrow;
}
try {
fieldName = "structs";
if (structs == null) {
encoder0.encodeNullPointer(16, true);
} else {
......@@ -658,12 +548,7 @@ class KeysByType extends bindings.Struct {
encoder1.encodeString(structs[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"structs of struct KeysByType: $e";
rethrow;
}
try {
fieldName = "unions";
if (unions == null) {
encoder0.encodeNullPointer(24, true);
} else {
......@@ -672,12 +557,7 @@ class KeysByType extends bindings.Struct {
encoder1.encodeString(unions[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"unions of struct KeysByType: $e";
rethrow;
}
try {
fieldName = "topLevelEnums";
if (topLevelEnums == null) {
encoder0.encodeNullPointer(32, true);
} else {
......@@ -686,12 +566,7 @@ class KeysByType extends bindings.Struct {
encoder1.encodeString(topLevelEnums[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"topLevelEnums of struct KeysByType: $e";
rethrow;
}
try {
fieldName = "embeddedEnums";
if (embeddedEnums == null) {
encoder0.encodeNullPointer(40, true);
} else {
......@@ -700,12 +575,7 @@ class KeysByType extends bindings.Struct {
encoder1.encodeString(embeddedEnums[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"embeddedEnums of struct KeysByType: $e";
rethrow;
}
try {
fieldName = "topLevelConstants";
if (topLevelConstants == null) {
encoder0.encodeNullPointer(48, true);
} else {
......@@ -714,12 +584,7 @@ class KeysByType extends bindings.Struct {
encoder1.encodeString(topLevelConstants[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"topLevelConstants of struct KeysByType: $e";
rethrow;
}
try {
fieldName = "embeddedConstants";
if (embeddedConstants == null) {
encoder0.encodeNullPointer(56, true);
} else {
......@@ -729,8 +594,7 @@ class KeysByType extends bindings.Struct {
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"embeddedConstants of struct KeysByType: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......
......@@ -21,39 +21,15 @@ class HttpHeader extends bindings.Struct {
String this.value
) : super(kVersions.last.size);
static HttpHeader deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static HttpHeader deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static HttpHeader decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
HttpHeader result = new HttpHeader();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.name = decoder0.decodeString(8, false);
......@@ -67,18 +43,15 @@ class HttpHeader extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "HttpHeader";
String fieldName;
try {
fieldName = "name";
encoder0.encodeString(name, 8, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"name of struct HttpHeader: $e";
rethrow;
}
try {
fieldName = "value";
encoder0.encodeString(value, 16, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"value of struct HttpHeader: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......
......@@ -25,39 +25,15 @@ class RunMessageParams extends bindings.Struct {
QueryVersion this.queryVersion
) : super(kVersions.last.size);
static RunMessageParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static RunMessageParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static RunMessageParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
RunMessageParams result = new RunMessageParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.reserved0 = decoder0.decodeUint32(8);
......@@ -76,25 +52,17 @@ class RunMessageParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "RunMessageParams";
String fieldName;
try {
fieldName = "reserved0";
encoder0.encodeUint32(reserved0, 8);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"reserved0 of struct RunMessageParams: $e";
rethrow;
}
try {
fieldName = "reserved1";
encoder0.encodeUint32(reserved1, 12);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"reserved1 of struct RunMessageParams: $e";
rethrow;
}
try {
fieldName = "queryVersion";
encoder0.encodeStruct(queryVersion, 16, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"queryVersion of struct RunMessageParams: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......@@ -132,39 +100,15 @@ class RunResponseMessageParams extends bindings.Struct {
QueryVersionResult this.queryVersionResult
) : super(kVersions.last.size);
static RunResponseMessageParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static RunResponseMessageParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static RunResponseMessageParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
RunResponseMessageParams result = new RunResponseMessageParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.reserved0 = decoder0.decodeUint32(8);
......@@ -183,25 +127,17 @@ class RunResponseMessageParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "RunResponseMessageParams";
String fieldName;
try {
fieldName = "reserved0";
encoder0.encodeUint32(reserved0, 8);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"reserved0 of struct RunResponseMessageParams: $e";
rethrow;
}
try {
fieldName = "reserved1";
encoder0.encodeUint32(reserved1, 12);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"reserved1 of struct RunResponseMessageParams: $e";
rethrow;
}
try {
fieldName = "queryVersionResult";
encoder0.encodeStruct(queryVersionResult, 16, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"queryVersionResult of struct RunResponseMessageParams: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......@@ -233,44 +169,27 @@ class QueryVersion extends bindings.Struct {
QueryVersion.init(
) : super(kVersions.last.size);
static QueryVersion deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static QueryVersion deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static QueryVersion decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
QueryVersion result = new QueryVersion();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
bindings.Struct.checkVersion(decoder0, kVersions);
return result;
}
void encode(bindings.Encoder encoder) {
encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "QueryVersion";
String fieldName;
try {
} on bindings.MojoCodecError catch(e) {
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
String toString() {
......@@ -296,39 +215,15 @@ class QueryVersionResult extends bindings.Struct {
int this.version
) : super(kVersions.last.size);
static QueryVersionResult deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static QueryVersionResult deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static QueryVersionResult decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
QueryVersionResult result = new QueryVersionResult();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.version = decoder0.decodeUint32(8);
......@@ -338,11 +233,13 @@ class QueryVersionResult extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "QueryVersionResult";
String fieldName;
try {
fieldName = "version";
encoder0.encodeUint32(version, 8);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"version of struct QueryVersionResult: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......@@ -376,39 +273,15 @@ class RunOrClosePipeMessageParams extends bindings.Struct {
RequireVersion this.requireVersion
) : super(kVersions.last.size);
static RunOrClosePipeMessageParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static RunOrClosePipeMessageParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static RunOrClosePipeMessageParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
RunOrClosePipeMessageParams result = new RunOrClosePipeMessageParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.reserved0 = decoder0.decodeUint32(8);
......@@ -427,25 +300,17 @@ class RunOrClosePipeMessageParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "RunOrClosePipeMessageParams";
String fieldName;
try {
fieldName = "reserved0";
encoder0.encodeUint32(reserved0, 8);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"reserved0 of struct RunOrClosePipeMessageParams: $e";
rethrow;
}
try {
fieldName = "reserved1";
encoder0.encodeUint32(reserved1, 12);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"reserved1 of struct RunOrClosePipeMessageParams: $e";
rethrow;
}
try {
fieldName = "requireVersion";
encoder0.encodeStruct(requireVersion, 16, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"requireVersion of struct RunOrClosePipeMessageParams: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......@@ -479,39 +344,15 @@ class RequireVersion extends bindings.Struct {
int this.version
) : super(kVersions.last.size);
static RequireVersion deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static RequireVersion deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static RequireVersion decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
RequireVersion result = new RequireVersion();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.version = decoder0.decodeUint32(8);
......@@ -521,11 +362,13 @@ class RequireVersion extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "RequireVersion";
String fieldName;
try {
fieldName = "version";
encoder0.encodeUint32(version, 8);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"version of struct RequireVersion: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......
......@@ -21,39 +21,15 @@ class NetworkError extends bindings.Struct {
String this.description
) : super(kVersions.last.size);
static NetworkError deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static NetworkError deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static NetworkError decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
NetworkError result = new NetworkError();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.code = decoder0.decodeInt32(8);
......@@ -67,18 +43,15 @@ class NetworkError extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "NetworkError";
String fieldName;
try {
fieldName = "code";
encoder0.encodeInt32(code, 8);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"code of struct NetworkError: $e";
rethrow;
}
try {
fieldName = "description";
encoder0.encodeString(description, 16, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"description of struct NetworkError: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......
......@@ -2,7 +2,6 @@
// See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py.
library service_provider_mojom;
import 'dart:async';
import 'package:mojo/bindings.dart' as bindings;
import 'package:mojo/core.dart' as core;
import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as service_describer;
......@@ -23,39 +22,15 @@ class _ServiceProviderConnectToServiceParams extends bindings.Struct {
core.MojoMessagePipeEndpoint this.pipe
) : super(kVersions.last.size);
static _ServiceProviderConnectToServiceParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static _ServiceProviderConnectToServiceParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static _ServiceProviderConnectToServiceParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
_ServiceProviderConnectToServiceParams result = new _ServiceProviderConnectToServiceParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.interfaceName = decoder0.decodeString(8, false);
......@@ -69,18 +44,15 @@ class _ServiceProviderConnectToServiceParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "_ServiceProviderConnectToServiceParams";
String fieldName;
try {
fieldName = "interfaceName";
encoder0.encodeString(interfaceName, 8, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"interfaceName of struct _ServiceProviderConnectToServiceParams: $e";
rethrow;
}
try {
fieldName = "pipe";
encoder0.encodeMessagePipeHandle(pipe, 16, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"pipe of struct _ServiceProviderConnectToServiceParams: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......
......@@ -2,7 +2,6 @@
// See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py.
library shell_mojom;
import 'dart:async';
import 'package:mojo/bindings.dart' as bindings;
import 'package:mojo/core.dart' as core;
import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as service_describer;
......@@ -25,39 +24,15 @@ class _ShellConnectToApplicationParams extends bindings.Struct {
service_provider_mojom.ServiceProviderInterfaceRequest this.services
) : super(kVersions.last.size);
static _ShellConnectToApplicationParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static _ShellConnectToApplicationParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static _ShellConnectToApplicationParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
_ShellConnectToApplicationParams result = new _ShellConnectToApplicationParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.applicationUrl = decoder0.decodeString(8, false);
......@@ -71,18 +46,15 @@ class _ShellConnectToApplicationParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "_ShellConnectToApplicationParams";
String fieldName;
try {
fieldName = "applicationUrl";
encoder0.encodeString(applicationUrl, 8, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"applicationUrl of struct _ShellConnectToApplicationParams: $e";
rethrow;
}
try {
fieldName = "services";
encoder0.encodeInterfaceRequest(services, 16, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"services of struct _ShellConnectToApplicationParams: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......@@ -112,39 +84,15 @@ class _ShellCreateApplicationConnectorParams extends bindings.Struct {
application_connector_mojom.ApplicationConnectorInterfaceRequest this.applicationConnectorRequest
) : super(kVersions.last.size);
static _ShellCreateApplicationConnectorParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static _ShellCreateApplicationConnectorParams deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static _ShellCreateApplicationConnectorParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
_ShellCreateApplicationConnectorParams result = new _ShellCreateApplicationConnectorParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.applicationConnectorRequest = decoder0.decodeInterfaceRequest(8, false, application_connector_mojom.ApplicationConnectorStub.newFromEndpoint);
......@@ -154,11 +102,13 @@ class _ShellCreateApplicationConnectorParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "_ShellCreateApplicationConnectorParams";
String fieldName;
try {
fieldName = "applicationConnectorRequest";
encoder0.encodeInterfaceRequest(applicationConnectorRequest, 8, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"applicationConnectorRequest of struct _ShellCreateApplicationConnectorParams: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......
......@@ -92,39 +92,15 @@ class UrlRequest extends bindings.Struct {
UrlRequestCacheMode this.cacheMode
) : super(kVersions.last.size);
static UrlRequest deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static UrlRequest deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static UrlRequest decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
UrlRequest result = new UrlRequest();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
result.url = decoder0.decodeString(8, false);
......@@ -173,21 +149,14 @@ class UrlRequest extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "UrlRequest";
String fieldName;
try {
fieldName = "url";
encoder0.encodeString(url, 8, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"url of struct UrlRequest: $e";
rethrow;
}
try {
fieldName = "method";
encoder0.encodeString(method, 16, false);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"method of struct UrlRequest: $e";
rethrow;
}
try {
fieldName = "headers";
if (headers == null) {
encoder0.encodeNullPointer(24, true);
} else {
......@@ -196,37 +165,16 @@ class UrlRequest extends bindings.Struct {
encoder1.encodeStruct(headers[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"headers of struct UrlRequest: $e";
rethrow;
}
try {
fieldName = "body";
encoder0.encodeConsumerHandleArray(body, 32, bindings.kArrayNullable, bindings.kUnspecifiedArrayLength);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"body of struct UrlRequest: $e";
rethrow;
}
try {
fieldName = "responseBodyBufferSize";
encoder0.encodeUint32(responseBodyBufferSize, 40);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"responseBodyBufferSize of struct UrlRequest: $e";
rethrow;
}
try {
fieldName = "autoFollowRedirects";
encoder0.encodeBool(autoFollowRedirects, 44, 0);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"autoFollowRedirects of struct UrlRequest: $e";
rethrow;
}
try {
fieldName = "cacheMode";
encoder0.encodeEnum(cacheMode, 48);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"cacheMode of struct UrlRequest: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......
......@@ -42,39 +42,15 @@ class UrlResponse extends bindings.Struct {
String this.redirectReferrer
) : super(kVersions.last.size);
static UrlResponse deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static UrlResponse deserialize(bindings.Message message) =>
bindings.Struct.deserialize(decode, message);
static UrlResponse decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
UrlResponse result = new UrlResponse();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = kVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= kVersions[i].version) {
if (mainDataHeader.size == kVersions[i].size) {
// Found a match.
break;
}
throw new bindings.MojoCodecError(
'Header size doesn\'t correspond to known version size.');
}
}
} else if (mainDataHeader.size < kVersions.last.size) {
throw new bindings.MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
var mainDataHeader = bindings.Struct.checkVersion(decoder0, kVersions);
if (mainDataHeader.version >= 0) {
var decoder1 = decoder0.decodePointer(8, true);
......@@ -136,42 +112,20 @@ class UrlResponse extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
const String structName = "UrlResponse";
String fieldName;
try {
fieldName = "error";
encoder0.encodeStruct(error, 8, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"error of struct UrlResponse: $e";
rethrow;
}
try {
fieldName = "body";
encoder0.encodeConsumerHandle(body, 16, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"body of struct UrlResponse: $e";
rethrow;
}
try {
fieldName = "statusCode";
encoder0.encodeUint32(statusCode, 20);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"statusCode of struct UrlResponse: $e";
rethrow;
}
try {
fieldName = "url";
encoder0.encodeString(url, 24, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"url of struct UrlResponse: $e";
rethrow;
}
try {
fieldName = "statusLine";
encoder0.encodeString(statusLine, 32, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"statusLine of struct UrlResponse: $e";
rethrow;
}
try {
fieldName = "headers";
if (headers == null) {
encoder0.encodeNullPointer(40, true);
} else {
......@@ -180,44 +134,18 @@ class UrlResponse extends bindings.Struct {
encoder1.encodeStruct(headers[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
}
}
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"headers of struct UrlResponse: $e";
rethrow;
}
try {
fieldName = "mimeType";
encoder0.encodeString(mimeType, 48, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"mimeType of struct UrlResponse: $e";
rethrow;
}
try {
fieldName = "charset";
encoder0.encodeString(charset, 56, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"charset of struct UrlResponse: $e";
rethrow;
}
try {
fieldName = "redirectMethod";
encoder0.encodeString(redirectMethod, 64, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"redirectMethod of struct UrlResponse: $e";
rethrow;
}
try {
fieldName = "redirectUrl";
encoder0.encodeString(redirectUrl, 72, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"redirectUrl of struct UrlResponse: $e";
rethrow;
}
try {
fieldName = "redirectReferrer";
encoder0.encodeString(redirectReferrer, 80, true);
} on bindings.MojoCodecError catch(e) {
e.message = "Error encountered while encoding field "
"redirectReferrer of struct UrlResponse: $e";
bindings.Struct.fixErrorMessage(e, fieldName, structName);
rethrow;
}
}
......
......@@ -68,7 +68,7 @@ abstract class ServiceConnector {
}
abstract class ProxyMessageHandler extends core.MojoEventHandler
implements MojoInterfaceControl {
implements MojoInterfaceControl {
HashMap<int, Function> _callbackMap = new HashMap<int, Function>();
Completer _errorCompleter = new Completer();
Set<Completer> _errorCompleters;
......@@ -185,8 +185,20 @@ abstract class ProxyMessageHandler extends core.MojoEventHandler
}
}
// Need a getter for this for access in subclasses.
HashMap<int, Function> get callbackMap => _callbackMap;
Function getCallback(ServiceMessage message) {
if (!message.header.hasRequestId) {
proxyError("Expected a message with a valid request Id.");
return null;
}
int requestId = message.header.requestId;
if (!_callbackMap.containsKey(requestId)) {
proxyError("Message had unknown request Id: $requestId");
return null;
}
Function callback = _callbackMap[requestId];
_callbackMap.remove(requestId);
return callback;
}
@override
String toString() {
......@@ -203,7 +215,7 @@ abstract class ProxyMessageHandler extends core.MojoEventHandler
params.reserved1 = 0;
params.queryVersion = new icm.QueryVersion();
sendMessageWithRequestId(
params, icm.kRunMessageId, -1, MessageHeader.kMessageExpectsResponse,
params, icm.kRunMessageId, -1, MessageHeader.kMessageExpectsResponse,
(r0, r1, queryResult) {
_version = queryResult.version;
completer.complete(_version);
......@@ -294,18 +306,33 @@ abstract class ProxyMessageHandler extends core.MojoEventHandler
proxyError("Expected a message with a valid request Id.");
return;
}
Function callback = callbackMap[message.header.requestId];
Function callback = _callbackMap[message.header.requestId];
if (callback == null) {
proxyError("Message had unknown request Id: ${message.header.requestId}");
return;
}
callbackMap.remove(message.header.requestId);
_callbackMap.remove(message.header.requestId);
callback(
response.reserved0, response.reserved1, response.queryVersionResult);
return;
}
}
// The interface implemented by a class that can implement a function with up
// to 20 unnamed arguments.
abstract class _GenericFunction implements Function {
const _GenericFunction();
// Work-around to avoid checked-mode only having grudging support for
// Function implemented with noSuchMethod. See:
// https://github.com/dart-lang/sdk/issues/26528
dynamic call([
dynamic a1, dynamic a2, dynamic a3, dynamic a4, dynamic a5,
dynamic a6, dynamic a7, dynamic a8, dynamic a9, dynamic a10,
dynamic a11, dynamic a12, dynamic a13, dynamic a14, dynamic a15,
dynamic a16, dynamic a17, dynamic a18, dynamic a19, dynamic a20]);
}
// A class that acts like a function, but which completes a completer with the
// the result of the function rather than returning the result. E.g.:
//
......@@ -319,7 +346,7 @@ abstract class ProxyMessageHandler extends core.MojoEventHandler
// More usefully for Mojo, e.g.:
// await _Completerator.completerate(
// proxy.method, argList, MethodResponseParams#init);
class _Completerator implements Function {
class _Completerator extends _GenericFunction {
final Completer _c;
final Function _toComplete;
......@@ -333,15 +360,6 @@ class _Completerator implements Function {
return c.future;
}
// Work-around to avoid checked-mode only having grudging support for
// Function implemented with noSuchMethod. See:
// https://github.com/dart-lang/sdk/issues/26528
dynamic call([
dynamic a1, dynamic a2, dynamic a3, dynamic a4, dynamic a5,
dynamic a6, dynamic a7, dynamic a8, dynamic a9, dynamic a10,
dynamic a11, dynamic a12, dynamic a13, dynamic a14, dynamic a15,
dynamic a16, dynamic a17, dynamic a18, dynamic a19, dynamic a20]);
@override
dynamic noSuchMethod(Invocation invocation) =>
(invocation.memberName == #call)
......@@ -399,9 +417,37 @@ abstract class FuturizedProxy<T extends Proxy> {
@override
dynamic noSuchMethod(Invocation invocation) =>
mojoMethods.containsKey(invocation.memberName)
? _Completerator.completerate(
mojoMethods[invocation.memberName],
invocation.positionalArguments,
mojoResponses[invocation.memberName])
: super.noSuchMethod(invocation);
? _Completerator.completerate(
mojoMethods[invocation.memberName],
invocation.positionalArguments,
mojoResponses[invocation.memberName])
: super.noSuchMethod(invocation);
}
/// A class that acts like a function that can take up to 20 arguments, and
/// does nothing.
///
/// This class is used in the generated bindings to allow null to be passed for
/// the callback to interface methods implemented by mock services where the
/// result of the method is not needed.
class DoNothingFunction extends _GenericFunction {
// TODO(zra): DoNothingFunction could rather be implemented just by a function
// taking some large number of dynamic arguments as we're doing already in
// _GenericFunction. However, instead of duplicating that hack, we should
// keep it in once place, and extend from _GenericFunction when we need to
// use it. Then, if/when there's better support for this sort of thing, we
// can replace _GenericFunction and propagate any changes needed to things
// that use it.
const DoNothingFunction();
static const DoNothingFunction fn = const DoNothingFunction();
@override
dynamic noSuchMethod(Invocation invocation) {
if (invocation.memberName != #call) {
return super.noSuchMethod(invocation);
}
return null;
}
}
......@@ -9,6 +9,44 @@ abstract class Struct {
Struct(this.encodedSize);
static StructDataHeader checkVersion(
Decoder decoder, List<StructDataHeader> knownVersions) {
var mainDataHeader = decoder.decodeStructDataHeader();
if (mainDataHeader.version <= knownVersions.last.version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = knownVersions.length - 1; i >= 0; --i) {
if (mainDataHeader.version >= knownVersions[i].version) {
if (mainDataHeader.size == knownVersions[i].size) {
// Found a match.
break;
}
throw new MojoCodecError(
"Header size doesn't correspond to known version size.");
}
}
} else if (mainDataHeader.size < knownVersions.last.size) {
throw new MojoCodecError(
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
return mainDataHeader;
}
static dynamic deserialize(dynamic decode(Decoder d), Message message) {
var decoder = new Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
decoder.excessHandles.forEach((h) => h.close());
}
return result;
}
static void fixErrorMessage(
MojoCodecError e, String fieldName, String structName) {
e.message = "Error encountered while encoding field $fieldName "
"of struct $structName: $e";
}
void encode(Encoder encoder);
Message serialize() {
......
......@@ -2,4 +2,4 @@ author: Chromium Authors <mojo-dev@googlegroups.com>
description: Dart files to support executing inside Mojo.
homepage: https://github.com/domokit/mojo
name: mojo
version: 0.4.25
version: 0.4.27
......@@ -10,6 +10,7 @@ class MojoHandleWatcher {
static const int _REMOVE = 1;
static const int _CLOSE = 2;
static const int _TIMER = 3;
// ignore: unused_field
static const int _SHUTDOWN = 4;
static const int _kMojoHandleInvalid = 0;
......@@ -17,10 +18,8 @@ class MojoHandleWatcher {
static int mojoControlHandle;
static int _sendControlData(int command,
int handleOrDeadline,
SendPort port,
int signals) {
static int _sendControlData(
int command, int handleOrDeadline, SendPort port, int signals) {
int controlHandle = mojoControlHandle;
if (controlHandle == _kMojoHandleInvalid) {
return _kMojoResultFailedPrecondition;
......
......@@ -76,6 +76,7 @@ class MojoHandleNatives {
// Called from the embedder's unhandled exception callback.
// Returns the number of successfully closed handles.
// ignore: unused_element
static int _closeOpenHandles() {
int count = 0;
_openHandles.forEach((int handle, _) {
......
......@@ -27,7 +27,8 @@ struct Configuration {
size_t max_mapping_table_sze;
// Upper limit of |MojoWaitMany()|'s |num_handles|. The default is 1,000,000.
// Must be same as or smaller than |max_handle_table_size|.
// TODO(vtl): Should probably decrease the default once we actually have wait
// sets and are using them.
size_t max_wait_many_num_handles;
// Maximum data size of messages sent over message pipes, in bytes. The
......@@ -60,6 +61,9 @@ struct Configuration {
// (This will also entail some auditing to make sure I'm not messing up my
// checks anywhere.)
size_t max_shared_memory_num_bytes;
// Maximum number of entries in a wait set. The default is 1,000,000.
size_t max_wait_set_num_entries;
};
} // namespace embedder
......
......@@ -218,4 +218,33 @@ MojoResult MojoUnmapBuffer(void* buffer) {
return g_core->UnmapBuffer(MakeUserPointer(buffer));
}
MojoResult MojoCreateWaitSet(const struct MojoCreateWaitSetOptions* options,
MojoHandle* handle) {
return g_core->CreateWaitSet(MakeUserPointer(options),
MakeUserPointer(handle));
}
MojoResult MojoWaitSetAdd(MojoHandle wait_set_handle,
MojoHandle handle,
MojoHandleSignals signals,
uint64_t cookie,
const struct MojoWaitSetAddOptions* options) {
return g_core->WaitSetAdd(wait_set_handle, handle, signals, cookie,
MakeUserPointer(options));
}
MojoResult MojoWaitSetRemove(MojoHandle wait_set_handle, uint64_t cookie) {
return g_core->WaitSetRemove(wait_set_handle, cookie);
}
MojoResult MojoWaitSetWait(MojoHandle wait_set_handle,
MojoDeadline deadline,
uint32_t* num_results,
struct MojoWaitSetResult* results,
uint32_t* max_results) {
return g_core->WaitSetWait(
wait_set_handle, deadline, MakeUserPointer(num_results),
MakeUserPointer(results), MakeUserPointer(max_results));
}
} // extern "C"
......@@ -14,6 +14,7 @@ mojo_edk_source_set("system") {
sources = [
"async_waiter.cc",
"async_waiter.h",
"awakable.cc",
"awakable.h",
"awakable_list.cc",
"awakable_list.h",
......@@ -173,6 +174,7 @@ mojo_edk_unittests("mojo_edk_system_unittests") {
"test_channel_endpoint_client.cc",
"test_channel_endpoint_client.h",
"unique_identifier_unittest.cc",
"wait_set_dispatcher_unittest.cc",
"waiter_test_utils.cc",
"waiter_test_utils.h",
"waiter_unittest.cc",
......
......@@ -11,10 +11,11 @@ AsyncWaiter::AsyncWaiter(const AwakeCallback& callback) : callback_(callback) {}
AsyncWaiter::~AsyncWaiter() {}
bool AsyncWaiter::Awake(MojoResult result, uint64_t /*context*/) {
callback_(result);
void AsyncWaiter::Awake(uint64_t /*context*/,
AwakeReason reason,
const HandleSignalsState& /*signals_state*/) {
callback_(MojoResultForAwakeReason(reason));
delete this;
return false;
}
} // namespace system
......
......@@ -14,7 +14,9 @@
namespace mojo {
namespace system {
// An |Awakable| implementation that just calls a given callback object.
// An |Awakable| implementation that just calls a given callback object. It
// should be used in a non-persistent way (i.e., |Awake()| should be called at
// most once by each source, and only for "leading edges").
class AsyncWaiter final : public Awakable {
public:
using AwakeCallback = std::function<void(MojoResult)>;
......@@ -25,7 +27,9 @@ class AsyncWaiter final : public Awakable {
private:
// |Awakable| implementation:
bool Awake(MojoResult result, uint64_t context) override;
void Awake(uint64_t context,
AwakeReason reason,
const HandleSignalsState& signals_state) override;
AwakeCallback callback_;
......
// Copyright 2016 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.
#include "mojo/edk/system/awakable.h"
#include "base/logging.h"
namespace mojo {
namespace system {
// static
MojoResult Awakable::MojoResultForAwakeReason(AwakeReason reason) {
switch (reason) {
case AwakeReason::CANCELLED:
return MOJO_RESULT_CANCELLED;
case AwakeReason::SATISFIED:
return MOJO_RESULT_OK;
case AwakeReason::UNSATISFIABLE:
return MOJO_RESULT_FAILED_PRECONDITION;
case AwakeReason::INITIALIZE:
break;
case AwakeReason::CHANGED:
break;
}
NOTREACHED();
return MOJO_RESULT_INTERNAL;
}
} // namespace system
} // namespace mojo
......@@ -7,6 +7,7 @@
#include <stdint.h>
#include "mojo/edk/system/handle_signals_state.h"
#include "mojo/public/c/system/result.h"
namespace mojo {
......@@ -16,13 +17,39 @@ namespace system {
// implementation that blocks while waiting to be awoken.
class Awakable {
public:
// See |AwakableList| (in particular its |Add()| method) for information about
// persistent versus one-shot awakables.
enum class AwakeReason {
// Sent to both persistent and one-shot awakables (after |Awake()| is
// called with this, it will no longer be called by the same source):
CANCELLED,
// Sent to one-shot awakables:
SATISFIED,
UNSATISFIABLE,
// Sent to persistent awakables:
INITIALIZE,
CHANGED,
};
// Helper function that translates:
// - |AwakeReason::CANCELLED| -> |MOJO_RESULT_CANCELLED|.
// - |AwakeReason::SATISFIED| -> |MOJO_RESULT_OK|,
// - |AwakeReason::UNSATISFIABLE| -> |MOJO_RESULT_FAILED_PRECONDITION|, and
// - |AwakeReason::INITIALIZE| -> |MOJO_RESULT_INTERNAL| (this function
// never be called with this reason).
// - |AwakeReason::CHANGED| -> |MOJO_RESULT_INTERNAL| (this function never
// be called with this reason).
static MojoResult MojoResultForAwakeReason(AwakeReason reason);
// |Awake()| must satisfy the following contract:
// - It must be thread-safe.
// - Since it is called with a mutex held, it must not call anything that
// takes "non-terminal" locks, i.e., those which are always safe to take.
// - It should return false if it must not be called again for the same
// reason (e.g., for the same call to |AwakableList::Add()|).
virtual bool Awake(MojoResult result, uint64_t context) = 0;
// If |reason| is |AwakeReason::CANCELLED|, |Awake()| will not be called
// again (by the same source).
virtual void Awake(uint64_t context,
AwakeReason reason,
const HandleSignalsState& signals_state) = 0;
protected:
Awakable() {}
......
此差异已折叠。
此差异已折叠。
......@@ -64,7 +64,7 @@ TEST_F(ChannelTest, ShutdownAfterAttach) {
Waiter waiter;
waiter.Init();
ASSERT_EQ(MOJO_RESULT_OK,
mp->AddAwakable(0, &waiter, MOJO_HANDLE_SIGNAL_READABLE, false, 123,
mp->AddAwakable(0, &waiter, 123, false, MOJO_HANDLE_SIGNAL_READABLE,
nullptr));
// Don't wait for the shutdown to run ...
......@@ -72,9 +72,9 @@ TEST_F(ChannelTest, ShutdownAfterAttach) {
// ... since this |Wait()| should fail once the channel is shut down.
EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr));
waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr, nullptr));
HandleSignalsState hss;
mp->RemoveAwakable(0, &waiter, &hss);
mp->RemoveAwakable(0, false, &waiter, 0, &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals);
......@@ -99,7 +99,7 @@ TEST_F(ChannelTest, WaitAfterAttachRunAndShutdown) {
waiter.Init();
HandleSignalsState hss;
EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
mp->AddAwakable(0, &waiter, MOJO_HANDLE_SIGNAL_READABLE, false, 123,
mp->AddAwakable(0, &waiter, 123, false, MOJO_HANDLE_SIGNAL_READABLE,
&hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -40,6 +40,7 @@ template void CheckUserPointerWithCount<1, 1>(const void*, size_t);
template void CheckUserPointerWithCount<4, 4>(const void*, size_t);
template void CheckUserPointerWithCount<8, 4>(const void*, size_t);
template void CheckUserPointerWithCount<8, 8>(const void*, size_t);
template void CheckUserPointerWithCount<24, 8>(const void*, size_t);
template <size_t alignment>
void CheckUserPointerWithSize(const void* pointer, size_t size) {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册