content: Move/rename render_sandbox_host_linux to exclude the word render.
This patch does the following:
- Renames render_sandbox_host_linux to sandbox_host_linux
- Moves it from content/browser/renderer_host/ to content/browser/
- Moves sandbox_ipc_linux from content/browser/renderer_host/ to content/browser/
- Updates names in those classes to refer to "sandboxed process" instead of "renderer"
This patch does not affect any behavior.
The motivation for this is the development of out of process rasterization, which
will start rasterizing content on the gpu process. This means that similar access
will be needed from the gpu process as is now required from the renderer process
(specifically font access via FontConfigIPC). Renaming these classes makes it
more clear that there are other processes other than the renderer that use it.
Change-Id: I4d78f3f186f03cc7ad72dab41a7065cc97827180
Reviewed-on: https://chromium-review.googlesource.com/656063
Commit-Queue: Vladimir Levin <[email protected]>
Reviewed-by: Jorge Lucangeli Obes <[email protected]>
Reviewed-by: Antoine Labour <[email protected]>
Cr-Commit-Position: refs/heads/master@{#501084}
diff --git a/content/browser/sandbox_ipc_linux.h b/content/browser/sandbox_ipc_linux.h
new file mode 100644
index 0000000..06c2c604
--- /dev/null
+++ b/content/browser/sandbox_ipc_linux.h
@@ -0,0 +1,90 @@
+// Copyright 2014 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.
+
+// https://chromium.googlesource.com/chromium/src/+/master/docs/linux_sandbox_ipc.md
+
+#ifndef CONTENT_BROWSER_SANDBOX_IPC_LINUX_H_
+#define CONTENT_BROWSER_SANDBOX_IPC_LINUX_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "base/files/scoped_file.h"
+#include "base/macros.h"
+#include "base/pickle.h"
+#include "base/threading/simple_thread.h"
+#include "content/common/content_export.h"
+#include "third_party/icu/source/common/unicode/uchar.h"
+
+class SkString;
+
+namespace content {
+
+class SandboxIPCHandler : public base::DelegateSimpleThread::Delegate {
+ public:
+ // lifeline_fd: the read end of a pipe which the main thread holds
+ // the other end of.
+ // browser_socket: the browser's end of the sandbox IPC socketpair.
+ SandboxIPCHandler(int lifeline_fd, int browser_socket);
+ ~SandboxIPCHandler() override;
+
+ void Run() override;
+
+ class TestObserver {
+ public:
+ virtual void OnGetFallbackFontForChar(UChar32 c,
+ std::string name,
+ int id) = 0;
+ virtual void OnFontOpen(int id) = 0;
+ };
+ CONTENT_EXPORT static void SetObserverForTests(TestObserver* observer);
+
+ private:
+ int FindOrAddPath(const SkString& path);
+
+ void HandleRequestFromChild(int fd);
+
+ void HandleFontMatchRequest(int fd,
+ base::PickleIterator iter,
+ const std::vector<base::ScopedFD>& fds);
+
+ void HandleFontOpenRequest(int fd,
+ base::PickleIterator iter,
+ const std::vector<base::ScopedFD>& fds);
+
+ void HandleGetFallbackFontForChar(int fd,
+ base::PickleIterator iter,
+ const std::vector<base::ScopedFD>& fds);
+
+ void HandleGetStyleForStrike(int fd,
+ base::PickleIterator iter,
+ const std::vector<base::ScopedFD>& fds);
+
+ void HandleLocaltime(int fd,
+ base::PickleIterator iter,
+ const std::vector<base::ScopedFD>& fds);
+
+ void HandleMakeSharedMemorySegment(int fd,
+ base::PickleIterator iter,
+ const std::vector<base::ScopedFD>& fds);
+
+ void HandleMatchWithFallback(int fd,
+ base::PickleIterator iter,
+ const std::vector<base::ScopedFD>& fds);
+
+ void SendRendererReply(const std::vector<base::ScopedFD>& fds,
+ const base::Pickle& reply,
+ int reply_fd);
+
+ const int lifeline_fd_;
+ const int browser_socket_;
+ std::vector<SkString> paths_;
+
+ DISALLOW_COPY_AND_ASSIGN(SandboxIPCHandler);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_SANDBOX_IPC_LINUX_H_