chore: refactor persisting permission granted to serial ports (#31181)

This commit is contained in:
John Kleinschmidt 2021-10-06 16:18:00 -04:00 committed by GitHub
parent 21c6b33ebe
commit d6de243837
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 155 additions and 131 deletions

View file

@ -8,7 +8,6 @@
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "base/memory/weak_ptr.h"
#include "chrome/browser/predictors/preconnect_manager.h"
@ -47,9 +46,6 @@ class ResolveProxyHelper;
class WebViewManager;
class ProtocolRegistry;
// Preference keys for device apis
extern const char kSerialGrantedDevicesPref[];
class ElectronBrowserContext : public content::BrowserContext {
public:
// partition_id => browser_context
@ -146,19 +142,6 @@ class ElectronBrowserContext : public content::BrowserContext {
network::mojom::SSLConfigPtr GetSSLConfig();
void SetSSLConfigClient(mojo::Remote<network::mojom::SSLConfigClient> client);
// Grants |origin| access to |object| by writing it into the browser context.
// To be used in place of ObjectPermissionContextBase::GrantObjectPermission.
void GrantObjectPermission(const url::Origin& origin,
base::Value object,
const std::string& pref_key);
// Returns the list of objects that |origin| has been granted permission to
// access. To be used in place of
// ObjectPermissionContextBase::GetGrantedObjects.
std::vector<std::unique_ptr<base::Value>> GetGrantedObjects(
const url::Origin& origin,
const std::string& pref_key);
~ElectronBrowserContext() override;
private: