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

Unified Diff: content/public/common/connection_filter.h

Issue 2111353002: Move content's shell connections to the IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/child/child_thread.h ('k') | content/public/common/mojo_shell_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/connection_filter.h
diff --git a/content/public/common/connection_filter.h b/content/public/common/connection_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..be8da3fb00839193de913d3c11f2bf9b8c5347d2
--- /dev/null
+++ b/content/public/common/connection_filter.h
@@ -0,0 +1,40 @@
+// 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.
+
+#ifndef CONTENT_PUBLIC_COMMON_CONNECTION_FILTER_H_
+#define CONTENT_PUBLIC_COMMON_CONNECTION_FILTER_H_
+
+#include "content/common/content_export.h"
+
+namespace shell {
+class Connection;
+class Connector;
+}
+
+namespace content {
+
+// A ConnectionFilter may be used to conditionally expose interfaces on inbound
+// connections accepted by MojoShellConnection. ConnectionFilters are used
+// exclusively on the IO thread. See MojoShellConnection::AddConnectionFilter
+// for details.
+class CONTENT_EXPORT ConnectionFilter {
+ public:
+ virtual ~ConnectionFilter() {}
+
+ // Called for every new connection accepted. Implementations may add
+ // interfaces to |connection|, in which case they should return |true|.
+ // |connector| is a corresponding outgoing Connector that may be used by any
+ // interfaces added to the connection. Note that references to |connector|
+ // must not be retained, but an owned copy may be obtained by calling
+ // |connector->Clone()|.
+ //
+ // If a ConnectionFilter is not interested in an incoming connection, it
+ // should return |false|.
+ virtual bool OnConnect(shell::Connection* connection,
+ shell::Connector* connector) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_CONNECTION_FILTER_H_
« no previous file with comments | « content/public/child/child_thread.h ('k') | content/public/common/mojo_shell_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698