2019-03-22 23:11:51 +01:00
|
|
|
// Copyright (c) 2011 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.
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2019-03-22 23:11:51 +01:00
|
|
|
#ifndef CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_
|
2012-04-03 03:34:16 +02:00
|
|
|
#pragma once
|
|
|
|
|
2019-10-01 15:55:16 +02:00
|
|
|
#include <set>
|
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
#include "include/cef_request_context_handler.h"
|
2015-10-17 02:44:00 +02:00
|
|
|
#include "libcef/browser/chrome_profile_stub.h"
|
2019-10-01 15:55:16 +02:00
|
|
|
#include "libcef/browser/request_context_handler_map.h"
|
2015-02-14 00:17:08 +01:00
|
|
|
#include "libcef/browser/resource_context.h"
|
|
|
|
|
2020-03-19 16:34:15 +01:00
|
|
|
#include "base/callback.h"
|
2019-03-22 23:11:51 +01:00
|
|
|
#include "base/files/file_path.h"
|
|
|
|
#include "base/memory/ref_counted.h"
|
2020-03-19 16:34:15 +01:00
|
|
|
#include "base/memory/weak_ptr.h"
|
2019-07-17 20:47:27 +02:00
|
|
|
#include "chrome/browser/download/download_prefs.h"
|
2019-10-01 15:55:16 +02:00
|
|
|
#include "chrome/common/plugin.mojom.h"
|
2019-03-22 23:11:51 +01:00
|
|
|
#include "components/proxy_config/pref_proxy_config_tracker.h"
|
|
|
|
#include "components/visitedlink/browser/visitedlink_delegate.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "content/public/browser/browser_context.h"
|
2015-02-14 00:17:08 +01:00
|
|
|
#include "content/public/browser/browser_thread.h"
|
2013-03-12 21:23:24 +01:00
|
|
|
#include "content/public/browser/content_browser_client.h"
|
2019-10-01 15:55:16 +02:00
|
|
|
#include "url/origin.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
/*
|
|
|
|
// Classes used in request processing (network, storage, service, etc.):
|
|
|
|
//
|
|
|
|
// WC = WebContents
|
|
|
|
// Content API representation of a browser. Created by BHI or the system (for
|
2019-03-22 23:11:51 +01:00
|
|
|
// popups) and owned by BHI. Keeps a pointer to BC.
|
2015-02-14 00:17:08 +01:00
|
|
|
//
|
|
|
|
// BHI = CefBrowserHostImpl
|
|
|
|
// Implements the CefBrowser and CefBrowserHost interfaces which are exposed
|
|
|
|
// to clients. References an RCI instance. Owns a WC. Life span is controlled
|
|
|
|
// by client references and CefContentBrowserClient.
|
|
|
|
//
|
|
|
|
// RCI = CefRequestContextImpl
|
|
|
|
// Implements the CefRequestContext interface which is exposed to clients.
|
2019-03-22 23:11:51 +01:00
|
|
|
// References the isolated BC.
|
2015-02-14 00:17:08 +01:00
|
|
|
//
|
2019-03-22 23:11:51 +01:00
|
|
|
// BC = CefBrowserContext
|
2015-03-02 21:25:14 +01:00
|
|
|
// Entry point from WC when using an isolated RCI. Owns the RC and creates the
|
2017-02-14 23:27:19 +01:00
|
|
|
// SPI indirectly. Owned by CefBrowserMainParts for the global context or RCI
|
|
|
|
// for non-global contexts.
|
2015-02-14 00:17:08 +01:00
|
|
|
//
|
2016-08-24 11:28:52 +02:00
|
|
|
// SPI = content::StoragePartitionImpl
|
|
|
|
// Owns storage-related objects like Quota, IndexedDB, Cache, etc. Created by
|
2019-03-22 23:11:51 +01:00
|
|
|
// StoragePartitionImplMap::Get(). Provides access to the URCG. Life span is
|
|
|
|
// controlled indirectly by BC.
|
2015-02-14 00:17:08 +01:00
|
|
|
//
|
|
|
|
// RC = CefResourceContext
|
2019-07-29 23:27:12 +02:00
|
|
|
// Acts as a bridge for resource loading. Network request life span is tied to
|
|
|
|
// this object. Must be destroyed before the associated URCG. Life span is
|
2019-03-22 23:11:51 +01:00
|
|
|
// controlled by BC.
|
2015-02-14 00:17:08 +01:00
|
|
|
//
|
|
|
|
//
|
|
|
|
// Relationship diagram:
|
|
|
|
// ref = reference (CefRefPtr/scoped_refptr)
|
2017-02-14 23:27:19 +01:00
|
|
|
// own = ownership (std::unique_ptr)
|
2015-02-14 00:17:08 +01:00
|
|
|
// ptr = raw pointer
|
|
|
|
//
|
2019-07-29 23:27:12 +02:00
|
|
|
// CefBrowserMainParts
|
|
|
|
// |
|
|
|
|
// own
|
|
|
|
// v
|
|
|
|
// BHI -own-> WC -ptr-> BC -own-> SPI
|
2015-02-14 00:17:08 +01:00
|
|
|
//
|
2019-07-29 23:27:12 +02:00
|
|
|
// BHI -ref-> RCI -own-> BC -own-> RC
|
2015-02-14 00:17:08 +01:00
|
|
|
//
|
|
|
|
//
|
|
|
|
// How shutdown works:
|
|
|
|
// 1. CefBrowserHostImpl is destroyed on any thread due to browser close,
|
|
|
|
// ref release, etc.
|
2017-02-14 23:27:19 +01:00
|
|
|
// 2. CefRequestContextImpl is destroyed (possibly asynchronously) on the UI
|
|
|
|
// thread due to CefBrowserHostImpl destruction, ref release, etc.
|
2019-03-22 23:11:51 +01:00
|
|
|
// 3. CefBrowserContext is destroyed on the UI thread due to
|
|
|
|
// CefRequestContextImpl destruction or deletion in
|
|
|
|
// CefBrowserMainParts::PostMainMessageLoopRun().
|
2015-02-14 00:17:08 +01:00
|
|
|
// 4. CefResourceContext is destroyed asynchronously on the IO thread due to
|
2019-03-22 23:11:51 +01:00
|
|
|
// CefBrowserContext destruction. This cancels/destroys any pending
|
2019-07-29 23:27:12 +02:00
|
|
|
// network requests.
|
2015-02-14 00:17:08 +01:00
|
|
|
*/
|
|
|
|
|
2019-03-22 23:11:51 +01:00
|
|
|
class CefDownloadManagerDelegate;
|
2020-03-19 16:34:15 +01:00
|
|
|
class CefMediaRouterManager;
|
2017-05-04 23:53:27 +02:00
|
|
|
class CefRequestContextImpl;
|
2019-03-22 23:11:51 +01:00
|
|
|
class CefSSLHostStateDelegate;
|
|
|
|
class CefVisitedLinkListener;
|
2015-09-09 16:05:39 +02:00
|
|
|
class HostContentSettingsMap;
|
|
|
|
class PrefService;
|
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
namespace extensions {
|
|
|
|
class CefExtensionSystem;
|
|
|
|
}
|
|
|
|
|
2019-03-22 23:11:51 +01:00
|
|
|
namespace visitedlink {
|
2020-02-10 18:10:17 +01:00
|
|
|
class VisitedLinkWriter;
|
2019-03-22 23:11:51 +01:00
|
|
|
}
|
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
// Main entry point for configuring behavior on a per-browser basis. An instance
|
|
|
|
// of this class is passed to WebContents::Create in CefBrowserHostImpl::
|
2015-03-02 21:25:14 +01:00
|
|
|
// CreateInternal. Only accessed on the UI thread unless otherwise indicated.
|
2019-03-22 23:11:51 +01:00
|
|
|
class CefBrowserContext : public ChromeProfileStub,
|
|
|
|
public visitedlink::VisitedLinkDelegate {
|
2012-04-03 03:34:16 +02:00
|
|
|
public:
|
2019-03-22 23:11:51 +01:00
|
|
|
explicit CefBrowserContext(const CefRequestContextSettings& settings);
|
|
|
|
|
|
|
|
// Returns the existing instance, if any, associated with the specified
|
|
|
|
// |cache_path|.
|
|
|
|
static CefBrowserContext* GetForCachePath(const base::FilePath& cache_path);
|
|
|
|
|
2019-10-01 15:55:16 +02:00
|
|
|
// Returns the existing instance, if any, associated with the specified IDs.
|
|
|
|
// See comments on IsAssociatedContext() for usage.
|
|
|
|
static CefBrowserContext* GetForIDs(int render_process_id,
|
|
|
|
int render_frame_id,
|
|
|
|
int frame_tree_node_id,
|
|
|
|
bool require_frame_match);
|
|
|
|
|
2019-03-22 23:11:51 +01:00
|
|
|
// Returns the underlying CefBrowserContext if any.
|
|
|
|
static CefBrowserContext* GetForContext(content::BrowserContext* context);
|
|
|
|
|
|
|
|
// Returns all existing CefBrowserContext.
|
|
|
|
static std::vector<CefBrowserContext*> GetAll();
|
2015-02-14 00:17:08 +01:00
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
// Must be called immediately after this object is created.
|
2019-03-22 23:11:51 +01:00
|
|
|
void Initialize();
|
|
|
|
|
|
|
|
// Track associated CefRequestContextImpl objects. This object will delete
|
|
|
|
// itself when the count reaches zero.
|
|
|
|
void AddCefRequestContext(CefRequestContextImpl* context);
|
|
|
|
void RemoveCefRequestContext(CefRequestContextImpl* context);
|
2015-07-16 23:40:01 +02:00
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
// BrowserContext methods.
|
|
|
|
content::ResourceContext* GetResourceContext() override;
|
2019-02-01 17:42:40 +01:00
|
|
|
content::ClientHintsControllerDelegate* GetClientHintsControllerDelegate()
|
|
|
|
override;
|
2019-02-01 20:40:18 +01:00
|
|
|
void SetCorsOriginAccessListForOrigin(
|
|
|
|
const url::Origin& source_origin,
|
|
|
|
std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns,
|
|
|
|
std::vector<network::mojom::CorsOriginPatternPtr> block_patterns,
|
|
|
|
base::OnceClosure closure) override;
|
2019-09-04 17:13:32 +02:00
|
|
|
base::FilePath GetPath() override;
|
2019-03-22 23:11:51 +01:00
|
|
|
base::FilePath GetPath() const override;
|
|
|
|
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
|
|
|
|
const base::FilePath& partition_path) override;
|
|
|
|
bool IsOffTheRecord() const override;
|
|
|
|
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
|
|
|
|
content::BrowserPluginGuestManager* GetGuestManager() override;
|
|
|
|
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
|
|
|
|
content::PushMessagingService* GetPushMessagingService() override;
|
2019-11-12 17:11:44 +01:00
|
|
|
content::StorageNotificationService* GetStorageNotificationService() override;
|
2019-03-22 23:11:51 +01:00
|
|
|
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
|
|
|
|
content::PermissionControllerDelegate* GetPermissionControllerDelegate()
|
|
|
|
override;
|
|
|
|
content::BackgroundFetchDelegate* GetBackgroundFetchDelegate() override;
|
|
|
|
content::BackgroundSyncController* GetBackgroundSyncController() override;
|
|
|
|
content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate()
|
|
|
|
override;
|
2015-02-14 00:17:08 +01:00
|
|
|
|
2015-10-17 02:44:00 +02:00
|
|
|
// Profile methods.
|
|
|
|
ChromeZoomLevelPrefs* GetZoomLevelPrefs() override;
|
2018-07-24 00:32:02 +02:00
|
|
|
scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override;
|
2019-03-22 23:11:51 +01:00
|
|
|
PrefService* GetPrefs() override;
|
|
|
|
bool AllowsBrowserWindows() const override { return false; }
|
|
|
|
const PrefService* GetPrefs() const override;
|
2019-06-05 16:15:45 +02:00
|
|
|
ProfileKey* GetProfileKey() const override;
|
2019-07-16 19:59:21 +02:00
|
|
|
policy::SchemaRegistryService* GetPolicySchemaRegistryService() override;
|
|
|
|
policy::UserCloudPolicyManager* GetUserCloudPolicyManager() override;
|
|
|
|
policy::ProfilePolicyConnector* GetProfilePolicyConnector() override;
|
|
|
|
const policy::ProfilePolicyConnector* GetProfilePolicyConnector()
|
|
|
|
const override;
|
2019-03-22 23:11:51 +01:00
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
// Values checked in ProfileNetworkContextService::CreateNetworkContextParams
|
|
|
|
// when creating the NetworkContext.
|
2019-07-25 21:27:15 +02:00
|
|
|
bool ShouldRestoreOldSessionCookies() override {
|
|
|
|
return should_persist_session_cookies_;
|
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
bool ShouldPersistSessionCookies() override {
|
|
|
|
return should_persist_session_cookies_;
|
|
|
|
}
|
2019-05-03 00:23:57 +02:00
|
|
|
base::Optional<std::vector<std::string>> GetCookieableSchemes() override {
|
2019-04-24 04:50:25 +02:00
|
|
|
return cookieable_schemes_;
|
|
|
|
}
|
|
|
|
|
2019-03-22 23:11:51 +01:00
|
|
|
// visitedlink::VisitedLinkDelegate methods.
|
|
|
|
void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override;
|
2015-10-17 02:44:00 +02:00
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
// Returns the settings associated with this object. Safe to call from any
|
|
|
|
// thread.
|
2019-03-22 23:11:51 +01:00
|
|
|
const CefRequestContextSettings& GetSettings() const;
|
2015-03-02 21:25:14 +01:00
|
|
|
|
2015-09-09 16:05:39 +02:00
|
|
|
// Settings for plugins and extensions.
|
2019-03-22 23:11:51 +01:00
|
|
|
HostContentSettingsMap* GetHostContentSettingsMap();
|
2015-09-09 16:05:39 +02:00
|
|
|
|
2016-01-12 01:19:51 +01:00
|
|
|
// Called from CefBrowserHostImpl::DidNavigateAnyFrame to update the table of
|
|
|
|
// visited links.
|
2019-03-22 23:11:51 +01:00
|
|
|
void AddVisitedURLs(const std::vector<GURL>& urls);
|
2016-01-12 01:19:51 +01:00
|
|
|
|
2019-03-24 00:40:32 +01:00
|
|
|
// Called from CefRequestContextImpl::OnRenderFrameCreated.
|
|
|
|
void OnRenderFrameCreated(CefRequestContextImpl* request_context,
|
|
|
|
int render_process_id,
|
|
|
|
int render_frame_id,
|
2019-04-24 04:50:25 +02:00
|
|
|
int frame_tree_node_id,
|
2019-03-24 00:40:32 +01:00
|
|
|
bool is_main_frame,
|
|
|
|
bool is_guest_view);
|
|
|
|
|
|
|
|
// Called from CefRequestContextImpl::OnRenderFrameDeleted.
|
|
|
|
void OnRenderFrameDeleted(CefRequestContextImpl* request_context,
|
|
|
|
int render_process_id,
|
2016-10-17 20:14:44 +02:00
|
|
|
int render_frame_id,
|
2019-04-24 04:50:25 +02:00
|
|
|
int frame_tree_node_id,
|
2016-10-17 20:14:44 +02:00
|
|
|
bool is_main_frame,
|
|
|
|
bool is_guest_view);
|
|
|
|
|
2019-10-01 15:55:16 +02:00
|
|
|
// Returns the handler that matches the specified IDs. Pass -1 for unknown
|
|
|
|
// values. If |require_frame_match| is true only exact matches will be
|
|
|
|
// returned. If |require_frame_match| is false, and there is not an exact
|
|
|
|
// match, then the first handler for the same |render_process_id| will be
|
|
|
|
// returned.
|
|
|
|
CefRefPtr<CefRequestContextHandler> GetHandler(
|
|
|
|
int render_process_id,
|
|
|
|
int render_frame_id,
|
|
|
|
int frame_tree_node_id,
|
|
|
|
bool require_frame_match) const;
|
|
|
|
|
|
|
|
// Returns true if this context is associated with the specified IDs. Pass -1
|
|
|
|
// for unknown values. If |require_frame_match| is true only exact matches
|
|
|
|
// will qualify. If |require_frame_match| is false, and there is not an exact
|
|
|
|
// match, then any match for |render_process_id| will qualify.
|
|
|
|
bool IsAssociatedContext(int render_process_id,
|
|
|
|
int render_frame_id,
|
|
|
|
int frame_tree_node_id,
|
|
|
|
bool require_frame_match) const;
|
|
|
|
|
|
|
|
// Remember the plugin load decision for plugin status requests that arrive
|
|
|
|
// via CefPluginServiceFilter::IsPluginAvailable.
|
|
|
|
void AddPluginLoadDecision(int render_process_id,
|
|
|
|
const base::FilePath& plugin_path,
|
|
|
|
bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
chrome::mojom::PluginStatus status);
|
|
|
|
bool HasPluginLoadDecision(int render_process_id,
|
|
|
|
const base::FilePath& plugin_path,
|
|
|
|
bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
chrome::mojom::PluginStatus* status) const;
|
|
|
|
|
|
|
|
// Clear the plugin load decisions associated with |render_process_id|, or all
|
|
|
|
// plugin load decisions if |render_process_id| is -1.
|
|
|
|
void ClearPluginLoadDecision(int render_process_id);
|
2016-10-17 20:14:44 +02:00
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
// Called from CefRequestContextImpl methods of the same name.
|
|
|
|
void RegisterSchemeHandlerFactory(const std::string& scheme_name,
|
|
|
|
const std::string& domain_name,
|
|
|
|
CefRefPtr<CefSchemeHandlerFactory> factory);
|
|
|
|
void ClearSchemeHandlerFactories();
|
|
|
|
|
2019-05-18 19:41:14 +02:00
|
|
|
network::mojom::NetworkContext* GetNetworkContext();
|
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
void set_should_persist_session_cookies(bool value) {
|
|
|
|
should_persist_session_cookies_ = value;
|
|
|
|
}
|
2019-05-03 00:23:57 +02:00
|
|
|
void set_cookieable_schemes(
|
|
|
|
base::Optional<std::vector<std::string>> schemes) {
|
2019-04-24 04:50:25 +02:00
|
|
|
cookieable_schemes_ = schemes;
|
|
|
|
}
|
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
CefResourceContext* resource_context() const {
|
2015-07-16 23:40:01 +02:00
|
|
|
return resource_context_.get();
|
|
|
|
}
|
|
|
|
extensions::CefExtensionSystem* extension_system() const {
|
|
|
|
return extension_system_;
|
2015-02-14 00:17:08 +01:00
|
|
|
}
|
|
|
|
|
2019-07-17 20:47:27 +02:00
|
|
|
// Called from DownloadPrefs::FromBrowserContext.
|
|
|
|
DownloadPrefs* GetDownloadPrefs();
|
|
|
|
|
|
|
|
// Returns true if this context supports print preview.
|
|
|
|
bool IsPrintPreviewSupported() const;
|
|
|
|
|
2020-03-19 16:34:15 +01:00
|
|
|
CefMediaRouterManager* GetMediaRouterManager();
|
|
|
|
|
|
|
|
// Returns the BrowserContext, or nullptr if the BrowserContext has already
|
|
|
|
// been destroyed.
|
|
|
|
using Getter = base::RepeatingCallback<CefBrowserContext*()>;
|
|
|
|
Getter getter() const { return getter_; }
|
|
|
|
|
2019-03-22 23:11:51 +01:00
|
|
|
private:
|
|
|
|
// Allow deletion via std::unique_ptr().
|
|
|
|
friend std::default_delete<CefBrowserContext>;
|
2015-02-14 00:17:08 +01:00
|
|
|
|
|
|
|
~CefBrowserContext() override;
|
|
|
|
|
2019-03-22 23:11:51 +01:00
|
|
|
// Members initialized during construction are safe to access from any thread.
|
|
|
|
CefRequestContextSettings settings_;
|
|
|
|
base::FilePath cache_path_;
|
2017-04-20 21:28:17 +02:00
|
|
|
|
2019-03-22 23:11:51 +01:00
|
|
|
// CefRequestContextImpl objects referencing this object.
|
|
|
|
std::set<CefRequestContextImpl*> request_context_set_;
|
2015-10-17 02:44:00 +02:00
|
|
|
|
2019-03-22 23:11:51 +01:00
|
|
|
std::unique_ptr<PrefService> pref_service_;
|
|
|
|
std::unique_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
|
|
|
|
|
|
|
|
std::unique_ptr<CefDownloadManagerDelegate> download_manager_delegate_;
|
|
|
|
std::unique_ptr<CefSSLHostStateDelegate> ssl_host_state_delegate_;
|
|
|
|
scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
|
2020-02-10 18:10:17 +01:00
|
|
|
std::unique_ptr<visitedlink::VisitedLinkWriter> visitedlink_master_;
|
2019-03-22 23:11:51 +01:00
|
|
|
// |visitedlink_listener_| is owned by visitedlink_master_.
|
|
|
|
CefVisitedLinkListener* visitedlink_listener_;
|
2019-04-24 04:50:25 +02:00
|
|
|
bool should_persist_session_cookies_ = false;
|
2019-05-03 00:23:57 +02:00
|
|
|
base::Optional<std::vector<std::string>> cookieable_schemes_;
|
2016-08-31 13:25:56 +02:00
|
|
|
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefResourceContext> resource_context_;
|
2015-02-14 00:17:08 +01:00
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
// Owned by the KeyedService system.
|
2019-03-22 23:11:51 +01:00
|
|
|
extensions::CefExtensionSystem* extension_system_ = nullptr;
|
2015-07-16 23:40:01 +02:00
|
|
|
|
2019-06-05 16:15:45 +02:00
|
|
|
// The key to index KeyedService instances created by
|
|
|
|
// SimpleKeyedServiceFactory.
|
|
|
|
std::unique_ptr<ProfileKey> key_;
|
|
|
|
|
2019-07-17 20:47:27 +02:00
|
|
|
std::unique_ptr<DownloadPrefs> download_prefs_;
|
|
|
|
|
2020-03-19 16:34:15 +01:00
|
|
|
std::unique_ptr<CefMediaRouterManager> media_router_manager_;
|
|
|
|
|
2019-10-01 15:55:16 +02:00
|
|
|
// Map IDs to CefRequestContextHandler objects.
|
|
|
|
CefRequestContextHandlerMap handler_map_;
|
|
|
|
|
|
|
|
// Map (render_process_id, plugin_path, is_main_frame, main_frame_origin) to
|
|
|
|
// plugin load decision.
|
|
|
|
typedef std::map<
|
|
|
|
std::pair<std::pair<int, base::FilePath>, std::pair<bool, url::Origin>>,
|
|
|
|
chrome::mojom::PluginStatus>
|
|
|
|
PluginLoadDecisionMap;
|
|
|
|
PluginLoadDecisionMap plugin_load_decision_map_;
|
|
|
|
|
|
|
|
// Set of (render_process_id, render_frame_id) associated with this context.
|
|
|
|
typedef std::set<std::pair<int, int>> RenderIdSet;
|
|
|
|
RenderIdSet render_id_set_;
|
|
|
|
|
|
|
|
// Set of frame_tree_node_id associated with this context. Keeping this list
|
|
|
|
// is necessary because, when navigating the main frame, a new (pre-commit)
|
|
|
|
// network request will be created before the RenderFrameHost. Consequently we
|
|
|
|
// can't rely on valid render IDs. See https://crbug.com/776884 for
|
|
|
|
// background.
|
|
|
|
typedef std::set<int> NodeIdSet;
|
|
|
|
NodeIdSet node_id_set_;
|
|
|
|
|
2020-03-19 16:34:15 +01:00
|
|
|
Getter getter_;
|
|
|
|
base::WeakPtrFactory<CefBrowserContext> weak_ptr_factory_;
|
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefBrowserContext);
|
2012-04-03 03:34:16 +02:00
|
|
|
};
|
|
|
|
|
2019-03-22 23:11:51 +01:00
|
|
|
#endif // CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_
|