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

Unified Diff: content/browser/mojo/browser_shell_connection.h

Issue 1889253002: Remove uses of shell::Loader from content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/browser/frame_host/frame_mojo_shell.cc ('k') | content/browser/mojo/browser_shell_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/mojo/browser_shell_connection.h
diff --git a/content/browser/mojo/browser_shell_connection.h b/content/browser/mojo/browser_shell_connection.h
index 213085641a2a80c04a9f278ea5b9a9c2c085a463..75e58766d33ff5b65350aab45b2e9d31647cb077 100644
--- a/content/browser/mojo/browser_shell_connection.h
+++ b/content/browser/mojo/browser_shell_connection.h
@@ -33,7 +33,17 @@ class BrowserShellConnection
public shell::InterfaceFactory<shell::mojom::ShellClientFactory>,
public shell::mojom::ShellClientFactory {
public:
+ using ShellClientRequestHandler =
+ base::Callback<void(shell::mojom::ShellClientRequest)>;
+
+ // Constructs a connection which does not own a ShellClient pipe. This
+ // connection must be manually fed new incoming connections via its
+ // shell::ShellClient interface.
+ BrowserShellConnection();
+
+ // Constructs a connection associated with its own ShellClient pipe.
explicit BrowserShellConnection(shell::mojom::ShellClientRequest request);
+
~BrowserShellConnection() override;
shell::Connector* GetConnector();
@@ -48,6 +58,15 @@ class BrowserShellConnection
const EmbeddedApplicationRunner::FactoryCallback& callback,
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
+ // Adds a generic ShellClientRequestHandler for a given application name. This
+ // will be used to satisfy any incoming calls to CreateShellClient() which
+ // reference the given name.
+ //
+ // For in-process applications, it is preferrable to use
+ // |AddEmbeddedApplication()| as defined above.
+ void AddShellClientRequestHandler(const base::StringPiece& name,
+ const ShellClientRequestHandler& handler);
+
private:
// shell::ShellClient:
bool AcceptConnection(shell::Connection* connection) override;
@@ -64,6 +83,7 @@ class BrowserShellConnection
mojo::BindingSet<shell::mojom::ShellClientFactory> factory_bindings_;
std::unordered_map<std::string, std::unique_ptr<EmbeddedApplicationRunner>>
embedded_apps_;
+ std::unordered_map<std::string, ShellClientRequestHandler> request_handlers_;
DISALLOW_COPY_AND_ASSIGN(BrowserShellConnection);
};
« no previous file with comments | « content/browser/frame_host/frame_mojo_shell.cc ('k') | content/browser/mojo/browser_shell_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698