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

Unified Diff: mojo/public/cpp/bindings/lib/router.h

Issue 322003002: Mojo message validation tests: add integration tests and move existing conformance tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « mojo/public/cpp/bindings/lib/message_header_validator.cc ('k') | mojo/public/cpp/bindings/lib/router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/router.h
diff --git a/mojo/public/cpp/bindings/lib/router.h b/mojo/public/cpp/bindings/lib/router.h
index 4a487d7f67d63829f3e6f4f49e38e3ec50d206dd..352bb56daed4aff0e0363283cd877364946fc534 100644
--- a/mojo/public/cpp/bindings/lib/router.h
+++ b/mojo/public/cpp/bindings/lib/router.h
@@ -33,13 +33,6 @@ class Router : public MessageReceiverWithResponder {
connector_.set_error_handler(error_handler);
}
- // Errors from incoming receivers will force the router's connector into an
- // error state, where no more messages will be processed. This method is used
- // during testing to prevent that from happening.
- void set_enforce_errors_from_incoming_receiver(bool enforce) {
- connector_.set_enforce_errors_from_incoming_receiver(enforce);
- }
-
// Returns true if an error was encountered while reading from the pipe or
// waiting to read from the pipe.
bool encountered_error() const { return connector_.encountered_error(); }
@@ -57,6 +50,13 @@ class Router : public MessageReceiverWithResponder {
virtual bool AcceptWithResponder(Message* message, MessageReceiver* responder)
MOJO_OVERRIDE;
+ // Sets this object to testing mode.
+ // In testing mode:
+ // - the object is more tolerant of unrecognized response messages;
+ // - the connector continues working after seeing errors from its incoming
+ // receiver.
+ void EnableTestingMode();
+
private:
typedef std::map<uint64_t, MessageReceiver*> ResponderMap;
@@ -81,6 +81,7 @@ class Router : public MessageReceiverWithResponder {
MessageReceiverWithResponder* incoming_receiver_;
ResponderMap responders_;
uint64_t next_request_id_;
+ bool testing_mode_;
};
} // namespace internal
« no previous file with comments | « mojo/public/cpp/bindings/lib/message_header_validator.cc ('k') | mojo/public/cpp/bindings/lib/router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698