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

Unified Diff: chrome/service/service_ipc_server.h

Issue 2139643003: Use ChannelMojo between browser and service processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: chrome/service/service_ipc_server.h
diff --git a/chrome/service/service_ipc_server.h b/chrome/service/service_ipc_server.h
index 34ed7081b4637befc2b14cd3b0e9951b2f424944..9d9a6cb6a436771d2f102ac2a77eab9a5d169bfe 100644
--- a/chrome/service/service_ipc_server.h
+++ b/chrome/service/service_ipc_server.h
@@ -12,10 +12,12 @@
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
+#include "base/single_thread_task_runner.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
#include "ipc/ipc_sync_channel.h"
+#include "mojo/public/cpp/system/message_pipe.h"
namespace base {
@@ -44,15 +46,21 @@ class ServiceIPCServer : public IPC::Listener, public IPC::Sender {
// Called when a product update is available.
virtual void OnUpdateAvailable() = 0;
+ // Called when the service process should remain running after being
+ // disconnected for testing.
+ virtual void OnStayAliveForTesting() = 0;
+
// Called when the IPC channel is closed. A return value of true indicates
// that the IPC server should continue listening for new connections.
virtual bool OnIPCClientDisconnect() = 0;
+
+ // Called to create a message pipe to use for an IPC Channel connection.
+ virtual mojo::ScopedMessagePipeHandle CreateChannelMessagePipe() = 0;
};
ServiceIPCServer(
Client* client,
const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
- const IPC::ChannelHandle& handle,
base::WaitableEvent* shutdown_event);
~ServiceIPCServer() override;
@@ -82,19 +90,19 @@ class ServiceIPCServer : public IPC::Listener, public IPC::Sender {
void OnGetHistograms();
void OnShutdown();
void OnUpdateAvailable();
+ void OnStayAliveForTesting();
// Helper method to create the sync channel.
void CreateChannel();
Client* client_;
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
- IPC::ChannelHandle channel_handle_;
std::unique_ptr<IPC::SyncChannel> channel_;
base::WaitableEvent* shutdown_event_;
ScopedVector<MessageHandler> message_handlers_;
// Indicates whether an IPC client is currently connected to the channel.
- bool ipc_client_connected_;
+ bool ipc_client_connected_ = false;
// Calculates histograms deltas.
std::unique_ptr<base::HistogramDeltaSerialization>

Powered by Google App Engine
This is Rietveld 408576698