OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // http://code.google.com/p/chromium/wiki/LinuxSandboxIPC | 5 // http://code.google.com/p/chromium/wiki/LinuxSandboxIPC |
6 | 6 |
7 #ifndef CONTENT_BROWSER_RENDERER_HOST_SANDBOX_IPC_H_ | 7 #ifndef CONTENT_BROWSER_RENDERER_HOST_SANDBOX_IPC_H_ |
8 #define CONTENT_BROWSER_RENDERER_HOST_SANDBOX_IPC_H_ | 8 #define CONTENT_BROWSER_RENDERER_HOST_SANDBOX_IPC_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/files/scoped_file.h" | 12 #include "base/files/scoped_file.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/pickle.h" | 14 #include "base/pickle.h" |
15 #include "base/threading/simple_thread.h" | 15 #include "base/threading/simple_thread.h" |
16 #include "content/child/blink_platform_impl.h" | 16 #include "content/child/blink_platform_impl.h" |
17 #include "skia/ext/skia_utils_base.h" | 17 #include "skia/ext/skia_utils_base.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 class SandboxIPCHandler : public base::DelegateSimpleThread::Delegate { | 21 class SandboxIPCHandler : public base::DelegateSimpleThread::Delegate { |
22 public: | 22 public: |
23 // lifeline_fd: the read end of a pipe which the main thread holds | 23 // lifeline_fd: the read end of a pipe which the main thread holds |
24 // the other end of. | 24 // the other end of. |
25 // browser_socket: the browser's end of the sandbox IPC socketpair. | 25 // browser_socket: the browser's end of the sandbox IPC socketpair. |
26 SandboxIPCHandler(int lifeline_fd, int browser_socket); | 26 SandboxIPCHandler(int lifeline_fd, int browser_socket); |
27 virtual ~SandboxIPCHandler(); | 27 virtual ~SandboxIPCHandler(); |
28 | 28 |
29 virtual void Run() OVERRIDE; | 29 virtual void Run() override; |
30 | 30 |
31 private: | 31 private: |
32 void EnsureWebKitInitialized(); | 32 void EnsureWebKitInitialized(); |
33 | 33 |
34 int FindOrAddPath(const SkString& path); | 34 int FindOrAddPath(const SkString& path); |
35 | 35 |
36 void HandleRequestFromRenderer(int fd); | 36 void HandleRequestFromRenderer(int fd); |
37 | 37 |
38 void HandleFontMatchRequest(int fd, | 38 void HandleFontMatchRequest(int fd, |
39 const Pickle& pickle, | 39 const Pickle& pickle, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 const int browser_socket_; | 78 const int browser_socket_; |
79 scoped_ptr<BlinkPlatformImpl> blink_platform_impl_; | 79 scoped_ptr<BlinkPlatformImpl> blink_platform_impl_; |
80 SkTDArray<SkString*> paths_; | 80 SkTDArray<SkString*> paths_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(SandboxIPCHandler); | 82 DISALLOW_COPY_AND_ASSIGN(SandboxIPCHandler); |
83 }; | 83 }; |
84 | 84 |
85 } // namespace content | 85 } // namespace content |
86 | 86 |
87 #endif // CONTENT_BROWSER_RENDERER_HOST_SANDBOX_IPC_H_ | 87 #endif // CONTENT_BROWSER_RENDERER_HOST_SANDBOX_IPC_H_ |
OLD | NEW |