refactor: minor electron browser context cleanup (#42815)
* refactor: make DevicePermissionMap private to electron::ElectronBrowserContext refactor: make PartitionPath private to electron::ElectronBrowserContext Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: remove unused forward declarations of v8 classes Co-authored-by: Charles Kerr <charles@charleskerr.com> * chore: forward declare gin::Arguments Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: use unique_ptr operator bool Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
50864bcd08
commit
7353fa88cd
2 changed files with 17 additions and 22 deletions
|
@ -21,7 +21,6 @@
|
|||
#include "content/public/browser/resource_context.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "electron/shell/browser/media/media_device_id_salt.h"
|
||||
#include "gin/arguments.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
#include "services/network/public/mojom/url_loader_factory.mojom.h"
|
||||
|
@ -30,6 +29,10 @@
|
|||
class PrefService;
|
||||
class ValueMapPrefStore;
|
||||
|
||||
namespace gin {
|
||||
class Arguments;
|
||||
}
|
||||
|
||||
namespace network {
|
||||
class SharedURLLoaderFactory;
|
||||
}
|
||||
|
@ -44,19 +47,8 @@ class ElectronExtensionSystem;
|
|||
}
|
||||
#endif
|
||||
|
||||
namespace v8 {
|
||||
template <typename T>
|
||||
class Local;
|
||||
class Isolate;
|
||||
class Value;
|
||||
} // namespace v8
|
||||
|
||||
namespace electron {
|
||||
|
||||
using DevicePermissionMap =
|
||||
std::map<blink::PermissionType,
|
||||
std::map<url::Origin, std::vector<std::unique_ptr<base::Value>>>>;
|
||||
|
||||
class ElectronDownloadManagerDelegate;
|
||||
class ElectronPermissionManager;
|
||||
class CookieChangeNotifier;
|
||||
|
@ -69,10 +61,6 @@ using DisplayMediaResponseCallbackJs =
|
|||
using DisplayMediaRequestHandler =
|
||||
base::RepeatingCallback<void(const content::MediaStreamRequest&,
|
||||
DisplayMediaResponseCallbackJs)>;
|
||||
using PartitionOrPath =
|
||||
std::variant<std::reference_wrapper<const std::string>,
|
||||
std::reference_wrapper<const base::FilePath>>;
|
||||
|
||||
class ElectronBrowserContext : public content::BrowserContext {
|
||||
public:
|
||||
// disable copy
|
||||
|
@ -207,6 +195,14 @@ class ElectronBrowserContext : public content::BrowserContext {
|
|||
blink::PermissionType permissionType);
|
||||
|
||||
private:
|
||||
using DevicePermissionMap = std::map<
|
||||
blink::PermissionType,
|
||||
std::map<url::Origin, std::vector<std::unique_ptr<base::Value>>>>;
|
||||
|
||||
using PartitionOrPath =
|
||||
std::variant<std::reference_wrapper<const std::string>,
|
||||
std::reference_wrapper<const base::FilePath>>;
|
||||
|
||||
ElectronBrowserContext(const PartitionOrPath partition_location,
|
||||
bool in_memory,
|
||||
base::Value::Dict options);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue