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

Unified Diff: content/public/browser/utility_process_mojo_client_impl.h

Issue 2049303002: Add the UtilityProcessMojoClient class and convert SafeJsonParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: content/public/browser/utility_process_mojo_client_impl.h
diff --git a/content/public/browser/utility_process_mojo_client_impl.h b/content/public/browser/utility_process_mojo_client_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..6eea0c45bc53b400f38efa4ab45b44c0d80e4087
--- /dev/null
+++ b/content/public/browser/utility_process_mojo_client_impl.h
@@ -0,0 +1,47 @@
+// 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_BROWSER_UTILITY_PROCESS_MOJO_CLIENT_IMPL_H_
+#define CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_MOJO_CLIENT_IMPL_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/strings/string16.h"
+#include "base/threading/thread_checker.h"
+#include "content/common/content_export.h"
+#include "mojo/public/cpp/system/message_pipe.h"
+
+namespace content {
+
+// Non-templated implementation of UtilityProcessMojoClient.
+class CONTENT_EXPORT UtilityProcessMojoClientImpl {
+ public:
+ explicit UtilityProcessMojoClientImpl(const base::string16& process_name);
+ ~UtilityProcessMojoClientImpl();
+
+ // Disables the sandbox in the utility process.
+ void set_disable_sandbox();
+
+ protected:
+ // Starts the utility process and connect to the remote Mojo service called
+ // |mojo_interface_name| using the |interface_pipe|.
+ void StartImpl(const std::string& mojo_interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe);
+
+ private:
+ class Holder;
Anand Mistry (off Chromium) 2016/06/10 11:13:55 I'm not a fan of the name Holder... but I don't ha
Patrick Monette 2016/06/10 18:13:24 I think Helper is a bit better.
+
+ scoped_refptr<Holder> holder_;
+
+ // Checks that this class is always accessed from the same thread.
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(UtilityProcessMojoClientImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_MOJO_CLIENT_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698