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

Unified Diff: mojo/shell/public/cpp/shell_connection.h

Issue 1725353003: Eliminate mojo::Shell client lib class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@15connector
Patch Set: . Created 4 years, 10 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/shell/public/cpp/shell_client.h ('k') | mojo/shell/runner/child/native_apptest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/shell_connection.h
diff --git a/mojo/shell/public/cpp/shell_connection.h b/mojo/shell/public/cpp/shell_connection.h
index d79b788f118e740bb54f45cbcb769c4bb2a4cba9..123bd93043ed62d1bc16aaaab5e593443b7dd2d6 100644
--- a/mojo/shell/public/cpp/shell_connection.h
+++ b/mojo/shell/public/cpp/shell_connection.h
@@ -14,14 +14,12 @@
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/callback.h"
#include "mojo/public/cpp/system/core.h"
-#include "mojo/shell/public/cpp/shell.h"
#include "mojo/shell/public/cpp/shell_client.h"
#include "mojo/shell/public/interfaces/shell.mojom.h"
#include "mojo/shell/public/interfaces/shell_client.mojom.h"
namespace mojo {
-class AppRefCountImpl;
class Connector;
// Encapsulates a connection to the Mojo Shell in two parts:
@@ -44,10 +42,7 @@ class Connector;
// Client Lib's mojo::ShellClient interface. See documentation in shell_client.h
// for details.
//
-// Though this class provides the canonical implementation of the Shell Client
-// lib's mojo::Shell interface, this interface should not be reached through
-// pointers to this type.
-class ShellConnection : public Shell, public shell::mojom::ShellClient {
+class ShellConnection : public shell::mojom::ShellClient {
public:
// Does not take ownership of |delegate|, which must remain valid for the
// lifetime of ShellConnection.
@@ -59,16 +54,9 @@ class ShellConnection : public Shell, public shell::mojom::ShellClient {
// shell.
void WaitForInitialize();
- private:
- friend AppRefCountImpl;
-
- // Shell:
- scoped_ptr<Connection> Connect(const std::string& url) override;
- scoped_ptr<Connection> Connect(Connector::ConnectParams* params) override;
- scoped_ptr<Connector> CloneConnector() const override;
- scoped_ptr<AppRefCount> CreateAppRefCount() override;
- void Quit() override;
+ Connector* connector() { return connector_.get(); }
+ private:
// shell::mojom::ShellClient:
void Initialize(shell::mojom::ConnectorPtr connector,
const mojo::String& url,
@@ -85,17 +73,12 @@ class ShellConnection : public Shell, public shell::mojom::ShellClient {
void OnConnectionError();
- // Called from AppRefCountImpl.
- void AddRef();
- void Release();
-
// We track the lifetime of incoming connection registries as it more
// convenient for the client.
ScopedVector<Connection> incoming_connections_;
mojo::ShellClient* client_;
Binding<shell::mojom::ShellClient> binding_;
scoped_ptr<Connector> connector_;
- int ref_count_;
base::WeakPtrFactory<ShellConnection> weak_factory_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ShellConnection);
« no previous file with comments | « mojo/shell/public/cpp/shell_client.h ('k') | mojo/shell/runner/child/native_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698