forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
child_process_sandbox_support_impl_mac.h
45 lines (34 loc) · 1.58 KB
/
child_process_sandbox_support_impl_mac.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2018 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_CHILD_CHILD_PROCESS_SANDBOX_SUPPORT_IMPL_MAC_H_
#define CONTENT_CHILD_CHILD_PROCESS_SANDBOX_SUPPORT_IMPL_MAC_H_
#include <CoreText/CoreText.h>
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/shared_memory_mapping.h"
#include "content/common/sandbox_support_mac.mojom.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/platform/mac/web_sandbox_support.h"
namespace content {
// Implementation of the interface used by Blink to upcall to the privileged
// process (browser) for handling requests for data that are not allowed within
// the sandbox.
class WebSandboxSupportMac : public blink::WebSandboxSupport {
public:
WebSandboxSupportMac();
~WebSandboxSupportMac() override;
// blink::WebSandboxSupport:
bool LoadFont(CTFontRef font,
base::ScopedCFTypeRef<CTFontDescriptorRef>* out_descriptor,
uint32_t* font_id) override;
SkColor GetSystemColor(blink::MacSystemColorID color_id,
blink::ColorScheme color_scheme) override;
private:
void OnGotSystemColors(base::ReadOnlySharedMemoryRegion region);
mojo::Remote<mojom::SandboxSupportMac> sandbox_support_;
base::ReadOnlySharedMemoryMapping color_map_;
DISALLOW_COPY_AND_ASSIGN(WebSandboxSupportMac);
};
} // namespace content
#endif // CONTENT_CHILD_CHILD_PROCESS_SANDBOX_SUPPORT_IMPL_MAC_H_