fix: prevent navigator.fonts.query() from crashing (#30930)
* fix: prevent navigator.fonts.query() from crashing * refactor: use base::PostTask instead
This commit is contained in:
parent
9eaa9de3b4
commit
c8e4cc29c0
5 changed files with 82 additions and 0 deletions
28
shell/browser/font/electron_font_access_delegate.h
Normal file
28
shell/browser/font/electron_font_access_delegate.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) 2021 Microsoft, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef SHELL_BROWSER_FONT_ELECTRON_FONT_ACCESS_DELEGATE_H_
|
||||
#define SHELL_BROWSER_FONT_ELECTRON_FONT_ACCESS_DELEGATE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "content/public/browser/font_access_chooser.h"
|
||||
#include "content/public/browser/font_access_delegate.h"
|
||||
|
||||
class ElectronFontAccessDelegate : public content::FontAccessDelegate {
|
||||
public:
|
||||
ElectronFontAccessDelegate();
|
||||
~ElectronFontAccessDelegate() override;
|
||||
|
||||
std::unique_ptr<content::FontAccessChooser> RunChooser(
|
||||
content::RenderFrameHost* frame,
|
||||
const std::vector<std::string>& selection,
|
||||
content::FontAccessChooser::Callback callback) override;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ElectronFontAccessDelegate);
|
||||
};
|
||||
|
||||
#endif // SHELL_BROWSER_FONT_ELECTRON_FONT_ACCESS_DELEGATE_H_
|
Loading…
Add table
Add a link
Reference in a new issue