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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl

Issue 2280483002: Add FlushForTesting to InterfacePtr and Binding. (Closed)
Patch Set: Created 4 years, 3 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/tools/bindings/generators/cpp_templates/interface_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
index fa147259ff08b056c91612ca9ac0c0cc6b65c2b7..23908c26a603123d93a3b78376151800803ec05c 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
@@ -145,7 +145,7 @@ bool {{class_name}}_{{method.name}}_ForwardToCallback::Accept(
{%- endfor %}
{{proxy_name}}::{{proxy_name}}(mojo::MessageReceiverWithResponder* receiver)
- : ControlMessageProxy(receiver) {
+ : receiver_(receiver) {
}
{#--- Proxy definitions #}
@@ -296,8 +296,7 @@ void {{class_name}}_{{method.name}}_ProxyToResponder::Run(
{%- endfor %}
{{class_name}}Stub::{{class_name}}Stub()
- : sink_(nullptr),
- control_message_handler_({{interface.name}}::Version_) {
+ : sink_(nullptr) {
}
{{class_name}}Stub::~{{interface.name}}Stub() {}
@@ -305,8 +304,6 @@ void {{class_name}}_{{method.name}}_ProxyToResponder::Run(
{#--- Stub definition #}
bool {{class_name}}Stub::Accept(mojo::Message* message) {
- if (mojo::internal::ControlMessageHandler::IsControlMessage(message))
- return control_message_handler_.Accept(message);
{%- if interface.methods %}
switch (message->header()->name) {
{%- for method in interface.methods %}
@@ -337,8 +334,6 @@ bool {{class_name}}Stub::Accept(mojo::Message* message) {
bool {{class_name}}Stub::AcceptWithResponder(
mojo::Message* message, mojo::MessageReceiverWithStatus* responder) {
- if (mojo::internal::ControlMessageHandler::IsControlMessage(message))
- return control_message_handler_.AcceptWithResponder(message, responder);
{%- if interface.methods %}
switch (message->header()->name) {
{%- for method in interface.methods %}
@@ -378,16 +373,13 @@ bool {{class_name}}Stub::AcceptWithResponder(
{#--- Request validator definitions #}
bool {{class_name}}RequestValidator::Accept(mojo::Message* message) {
+ if (mojo::internal::ControlMessageHandler::IsControlMessage(message))
+ return true;
+
mojo::internal::ValidationContext validation_context(
message->data(), message->data_num_bytes(), message->handles()->size(),
message, "{{class_name}} RequestValidator");
- if (mojo::internal::ControlMessageHandler::IsControlMessage(message)) {
- if (!mojo::internal::ValidateControlRequest(message, &validation_context))
- return false;
- return true;
- }
-
switch (message->header()->name) {
{%- for method in interface.methods %}
case internal::k{{class_name}}_{{method.name}}_Name: {
@@ -424,16 +416,13 @@ bool {{class_name}}RequestValidator::Accept(mojo::Message* message) {
{#--- Response validator definitions #}
{% if interface|has_callbacks %}
bool {{class_name}}ResponseValidator::Accept(mojo::Message* message) {
+ if (mojo::internal::ControlMessageHandler::IsControlMessage(message))
+ return true;
+
mojo::internal::ValidationContext validation_context(
message->data(), message->data_num_bytes(), message->handles()->size(),
message, "{{class_name}} ResponseValidator");
- if (mojo::internal::ControlMessageHandler::IsControlMessage(message)) {
- if (!mojo::internal::ValidateControlResponse(message, &validation_context))
- return false;
- return true;
- }
-
if (!mojo::internal::ValidateMessageIsResponse(message, &validation_context))
return false;
switch (message->header()->name) {

Powered by Google App Engine
This is Rietveld 408576698