Commit 4726a173 authored by Lukasz Anforowicz's avatar Lukasz Anforowicz Committed by Commit Bot

DCHECK(browser_context) in most methods of ContentBrowserClient.

ContentBrowserClients assume that |browser_context| client is not null
(e.g. HeadlessContentBrowserClient::DoesSiteRequireDedicatedProcess and
ChromeContentBrowserClientExtensionsPart::DoesSiteRequireDedicatedProcess).
To avoid surprises, this CL adds DCHECK(browser_context) to most methods
of ContentBrowserClients, so that the assumption is documented and
verified during //content-layer tests.

Bug: 787576
Change-Id: I115ab53bb64cebe50b5993a39b3e153e3054b1b3
Reviewed-on: https://chromium-review.googlesource.com/c/1276559Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599752}
parent d3ed4e64
...@@ -18,6 +18,7 @@ namespace content { ...@@ -18,6 +18,7 @@ namespace content {
BrowsingInstance::BrowsingInstance(BrowserContext* browser_context) BrowsingInstance::BrowsingInstance(BrowserContext* browser_context)
: browser_context_(browser_context), : browser_context_(browser_context),
active_contents_count_(0u) { active_contents_count_(0u) {
DCHECK(browser_context);
} }
bool BrowsingInstance::HasSiteInstance(const GURL& url) { bool BrowsingInstance::HasSiteInstance(const GURL& url) {
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "content/browser/bad_message.h" #include "content/browser/bad_message.h"
#include "content/browser/isolated_origin_util.h" #include "content/browser/isolated_origin_util.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/site_instance_impl.h" #include "content/browser/site_instance_impl.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
...@@ -1174,8 +1175,16 @@ void ChildProcessSecurityPolicyImpl::LockToOrigin(int child_id, ...@@ -1174,8 +1175,16 @@ void ChildProcessSecurityPolicyImpl::LockToOrigin(int child_id,
// call GetOriginLock or CheckOriginLock from any thread). // call GetOriginLock or CheckOriginLock from any thread).
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
// "gurl" can be currently empty in some cases, such as file://blah. #if DCHECK_IS_ON()
DCHECK_EQ(SiteInstanceImpl::DetermineProcessLockURL(nullptr, gurl), gurl); // Sanity-check that the |gurl| argument can be used as a lock.
RenderProcessHost* rph = RenderProcessHostImpl::FromID(child_id);
if (rph) { // |rph| can be null in unittests.
DCHECK_EQ(SiteInstanceImpl::DetermineProcessLockURL(
rph->GetBrowserContext(), gurl),
gurl);
}
#endif
base::AutoLock lock(lock_); base::AutoLock lock(lock_);
auto state = security_state_.find(child_id); auto state = security_state_.find(child_id);
DCHECK(state != security_state_.end()); DCHECK(state != security_state_.end());
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "content/browser/frame_host/navigation_entry_impl.h" #include "content/browser/frame_host/navigation_entry_impl.h"
#include <utility>
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
...@@ -13,6 +15,8 @@ ...@@ -13,6 +15,8 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "content/browser/site_instance_impl.h" #include "content/browser/site_instance_impl.h"
#include "content/public/browser/ssl_status.h" #include "content/public/browser/ssl_status.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
using base::ASCIIToUTF16; using base::ASCIIToUTF16;
...@@ -54,7 +58,7 @@ class NavigationEntryTest : public testing::Test { ...@@ -54,7 +58,7 @@ class NavigationEntryTest : public testing::Test {
void SetUp() override { void SetUp() override {
entry1_.reset(new NavigationEntryImpl); entry1_.reset(new NavigationEntryImpl);
instance_ = SiteInstanceImpl::Create(nullptr); instance_ = SiteInstanceImpl::Create(&browser_context_);
entry2_.reset(new NavigationEntryImpl( entry2_.reset(new NavigationEntryImpl(
instance_, GURL("test:url"), instance_, GURL("test:url"),
Referrer(GURL("from"), blink::kWebReferrerPolicyDefault), Referrer(GURL("from"), blink::kWebReferrerPolicyDefault),
...@@ -69,6 +73,10 @@ class NavigationEntryTest : public testing::Test { ...@@ -69,6 +73,10 @@ class NavigationEntryTest : public testing::Test {
std::unique_ptr<NavigationEntryImpl> entry2_; std::unique_ptr<NavigationEntryImpl> entry2_;
// SiteInstances are deleted when their NavigationEntries are gone. // SiteInstances are deleted when their NavigationEntries are gone.
scoped_refptr<SiteInstanceImpl> instance_; scoped_refptr<SiteInstanceImpl> instance_;
private:
TestBrowserThreadBundle thread_bundle_;
TestBrowserContext browser_context_;
}; };
// Test unique ID accessors // Test unique ID accessors
......
...@@ -261,6 +261,7 @@ void SetupOnUIThread(base::WeakPtr<ServiceWorkerProcessManager> process_manager, ...@@ -261,6 +261,7 @@ void SetupOnUIThread(base::WeakPtr<ServiceWorkerProcessManager> process_manager,
// TODO(crbug.com/862854): Support changes to RendererPreferences while the // TODO(crbug.com/862854): Support changes to RendererPreferences while the
// worker is running. // worker is running.
DCHECK(process_manager->browser_context() || process_manager->IsShutdown());
GetContentClient()->browser()->UpdateRendererPreferencesForWorker( GetContentClient()->browser()->UpdateRendererPreferencesForWorker(
process_manager->browser_context(), &params->renderer_preferences); process_manager->browser_context(), &params->renderer_preferences);
......
...@@ -29,6 +29,7 @@ ServiceWorkerProcessManager::ServiceWorkerProcessManager( ...@@ -29,6 +29,7 @@ ServiceWorkerProcessManager::ServiceWorkerProcessManager(
new_process_id_for_test_(ChildProcessHost::kInvalidUniqueID), new_process_id_for_test_(ChildProcessHost::kInvalidUniqueID),
weak_this_factory_(this) { weak_this_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(browser_context);
weak_this_ = weak_this_factory_.GetWeakPtr(); weak_this_ = weak_this_factory_.GetWeakPtr();
} }
......
...@@ -59,6 +59,7 @@ SiteInstanceImpl::~SiteInstanceImpl() { ...@@ -59,6 +59,7 @@ SiteInstanceImpl::~SiteInstanceImpl() {
// static // static
scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::Create( scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::Create(
BrowserContext* browser_context) { BrowserContext* browser_context) {
DCHECK(browser_context);
return base::WrapRefCounted( return base::WrapRefCounted(
new SiteInstanceImpl(new BrowsingInstance(browser_context))); new SiteInstanceImpl(new BrowsingInstance(browser_context)));
} }
...@@ -67,6 +68,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::Create( ...@@ -67,6 +68,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::Create(
scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForURL( scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForURL(
BrowserContext* browser_context, BrowserContext* browser_context,
const GURL& url) { const GURL& url) {
DCHECK(browser_context);
// This will create a new SiteInstance and BrowsingInstance. // This will create a new SiteInstance and BrowsingInstance.
scoped_refptr<BrowsingInstance> instance( scoped_refptr<BrowsingInstance> instance(
new BrowsingInstance(browser_context)); new BrowsingInstance(browser_context));
...@@ -314,6 +316,7 @@ BrowserContext* SiteInstanceImpl::GetBrowserContext() const { ...@@ -314,6 +316,7 @@ BrowserContext* SiteInstanceImpl::GetBrowserContext() const {
// static // static
scoped_refptr<SiteInstance> SiteInstance::Create( scoped_refptr<SiteInstance> SiteInstance::Create(
BrowserContext* browser_context) { BrowserContext* browser_context) {
DCHECK(browser_context);
return SiteInstanceImpl::Create(browser_context); return SiteInstanceImpl::Create(browser_context);
} }
...@@ -321,6 +324,7 @@ scoped_refptr<SiteInstance> SiteInstance::Create( ...@@ -321,6 +324,7 @@ scoped_refptr<SiteInstance> SiteInstance::Create(
scoped_refptr<SiteInstance> SiteInstance::CreateForURL( scoped_refptr<SiteInstance> SiteInstance::CreateForURL(
BrowserContext* browser_context, BrowserContext* browser_context,
const GURL& url) { const GURL& url) {
DCHECK(browser_context);
return SiteInstanceImpl::CreateForURL(browser_context, url); return SiteInstanceImpl::CreateForURL(browser_context, url);
} }
...@@ -341,6 +345,8 @@ bool SiteInstanceImpl::IsSameWebSite(BrowserContext* browser_context, ...@@ -341,6 +345,8 @@ bool SiteInstanceImpl::IsSameWebSite(BrowserContext* browser_context,
const GURL& real_src_url, const GURL& real_src_url,
const GURL& real_dest_url, const GURL& real_dest_url,
bool should_compare_effective_urls) { bool should_compare_effective_urls) {
DCHECK(browser_context);
GURL src_url = GURL src_url =
should_compare_effective_urls should_compare_effective_urls
? SiteInstanceImpl::GetEffectiveURL(browser_context, real_src_url) ? SiteInstanceImpl::GetEffectiveURL(browser_context, real_src_url)
...@@ -555,6 +561,8 @@ bool SiteInstanceImpl::HasEffectiveURL(BrowserContext* browser_context, ...@@ -555,6 +561,8 @@ bool SiteInstanceImpl::HasEffectiveURL(BrowserContext* browser_context,
bool SiteInstanceImpl::DoesSiteRequireDedicatedProcess( bool SiteInstanceImpl::DoesSiteRequireDedicatedProcess(
BrowserContext* browser_context, BrowserContext* browser_context,
const GURL& url) { const GURL& url) {
DCHECK(browser_context);
// If --site-per-process is enabled, site isolation is enabled everywhere. // If --site-per-process is enabled, site isolation is enabled everywhere.
if (SiteIsolationPolicy::UseDedicatedProcessesForAllSites()) if (SiteIsolationPolicy::UseDedicatedProcessesForAllSites())
return true; return true;
...@@ -590,6 +598,8 @@ bool SiteInstanceImpl::DoesSiteRequireDedicatedProcess( ...@@ -590,6 +598,8 @@ bool SiteInstanceImpl::DoesSiteRequireDedicatedProcess(
// static // static
bool SiteInstanceImpl::ShouldLockToOrigin(BrowserContext* browser_context, bool SiteInstanceImpl::ShouldLockToOrigin(BrowserContext* browser_context,
GURL site_url) { GURL site_url) {
DCHECK(browser_context);
// Don't lock to origin in --single-process mode, since this mode puts // Don't lock to origin in --single-process mode, since this mode puts
// cross-site pages into the same process. // cross-site pages into the same process.
if (RenderProcessHost::run_renderer_in_process()) if (RenderProcessHost::run_renderer_in_process())
......
...@@ -78,6 +78,7 @@ bool ContentBrowserClient::AllowGpuLaunchRetryOnIOThread() { ...@@ -78,6 +78,7 @@ bool ContentBrowserClient::AllowGpuLaunchRetryOnIOThread() {
GURL ContentBrowserClient::GetEffectiveURL(BrowserContext* browser_context, GURL ContentBrowserClient::GetEffectiveURL(BrowserContext* browser_context,
const GURL& url) { const GURL& url) {
DCHECK(browser_context);
return url; return url;
} }
...@@ -87,6 +88,7 @@ bool ContentBrowserClient::ShouldCompareEffectiveURLsForSiteInstanceSelection( ...@@ -87,6 +88,7 @@ bool ContentBrowserClient::ShouldCompareEffectiveURLsForSiteInstanceSelection(
bool is_main_frame, bool is_main_frame,
const GURL& candidate_url, const GURL& candidate_url,
const GURL& destination_url) { const GURL& destination_url) {
DCHECK(browser_context);
return true; return true;
} }
...@@ -96,6 +98,7 @@ bool ContentBrowserClient::ShouldUseMobileFlingCurve() const { ...@@ -96,6 +98,7 @@ bool ContentBrowserClient::ShouldUseMobileFlingCurve() const {
bool ContentBrowserClient::ShouldUseProcessPerSite( bool ContentBrowserClient::ShouldUseProcessPerSite(
BrowserContext* browser_context, const GURL& effective_url) { BrowserContext* browser_context, const GURL& effective_url) {
DCHECK(browser_context);
return false; return false;
} }
...@@ -108,11 +111,13 @@ bool ContentBrowserClient::ShouldUseSpareRenderProcessHost( ...@@ -108,11 +111,13 @@ bool ContentBrowserClient::ShouldUseSpareRenderProcessHost(
bool ContentBrowserClient::DoesSiteRequireDedicatedProcess( bool ContentBrowserClient::DoesSiteRequireDedicatedProcess(
BrowserContext* browser_context, BrowserContext* browser_context,
const GURL& effective_site_url) { const GURL& effective_site_url) {
DCHECK(browser_context);
return false; return false;
} }
bool ContentBrowserClient::ShouldLockToOrigin(BrowserContext* browser_context, bool ContentBrowserClient::ShouldLockToOrigin(BrowserContext* browser_context,
const GURL& effective_url) { const GURL& effective_url) {
DCHECK(browser_context);
return true; return true;
} }
...@@ -165,6 +170,7 @@ bool ContentBrowserClient::ShouldAllowOpenURL(SiteInstance* site_instance, ...@@ -165,6 +170,7 @@ bool ContentBrowserClient::ShouldAllowOpenURL(SiteInstance* site_instance,
bool ContentBrowserClient::IsURLAcceptableForWebUI( bool ContentBrowserClient::IsURLAcceptableForWebUI(
BrowserContext* browser_context, BrowserContext* browser_context,
const GURL& url) { const GURL& url) {
DCHECK(browser_context);
return false; return false;
} }
...@@ -185,6 +191,7 @@ bool ContentBrowserClient::MayReuseHost(RenderProcessHost* process_host) { ...@@ -185,6 +191,7 @@ bool ContentBrowserClient::MayReuseHost(RenderProcessHost* process_host) {
bool ContentBrowserClient::ShouldTryToUseExistingProcessHost( bool ContentBrowserClient::ShouldTryToUseExistingProcessHost(
BrowserContext* browser_context, const GURL& url) { BrowserContext* browser_context, const GURL& url) {
DCHECK(browser_context);
return false; return false;
} }
...@@ -247,6 +254,7 @@ std::string ContentBrowserClient::GetApplicationLocale() { ...@@ -247,6 +254,7 @@ std::string ContentBrowserClient::GetApplicationLocale() {
} }
std::string ContentBrowserClient::GetAcceptLangs(BrowserContext* context) { std::string ContentBrowserClient::GetAcceptLangs(BrowserContext* context) {
DCHECK(context);
return std::string(); return std::string();
} }
...@@ -282,16 +290,20 @@ bool ContentBrowserClient::AllowSharedWorker( ...@@ -282,16 +290,20 @@ bool ContentBrowserClient::AllowSharedWorker(
BrowserContext* context, BrowserContext* context,
int render_process_id, int render_process_id,
int render_frame_id) { int render_frame_id) {
DCHECK(context);
return true; return true;
} }
bool ContentBrowserClient::IsDataSaverEnabled(BrowserContext* context) { bool ContentBrowserClient::IsDataSaverEnabled(BrowserContext* context) {
DCHECK(context);
return false; return false;
} }
void ContentBrowserClient::UpdateRendererPreferencesForWorker( void ContentBrowserClient::UpdateRendererPreferencesForWorker(
BrowserContext* browser_context, BrowserContext* browser_context,
RendererPreferences* out_prefs) {} RendererPreferences* out_prefs) {
// |browser_context| may be null (e.g. during shutdown of a service worker).
}
bool ContentBrowserClient::AllowGetCookie(const GURL& url, bool ContentBrowserClient::AllowGetCookie(const GURL& url,
const GURL& first_party, const GURL& first_party,
...@@ -346,6 +358,7 @@ ContentBrowserClient::AllowWebBluetooth( ...@@ -346,6 +358,7 @@ ContentBrowserClient::AllowWebBluetooth(
content::BrowserContext* browser_context, content::BrowserContext* browser_context,
const url::Origin& requesting_origin, const url::Origin& requesting_origin,
const url::Origin& embedding_origin) { const url::Origin& embedding_origin) {
DCHECK(browser_context);
return AllowWebBluetoothResult::ALLOW; return AllowWebBluetoothResult::ALLOW;
} }
...@@ -361,6 +374,8 @@ void ContentBrowserClient::GetQuotaSettings( ...@@ -361,6 +374,8 @@ void ContentBrowserClient::GetQuotaSettings(
BrowserContext* context, BrowserContext* context,
StoragePartition* partition, StoragePartition* partition,
storage::OptionalQuotaSettingsCallback callback) { storage::OptionalQuotaSettingsCallback callback) {
DCHECK(context);
// By default, no quota is provided, embedders should override. // By default, no quota is provided, embedders should override.
std::move(callback).Run(storage::GetNoQuotaSettings()); std::move(callback).Run(storage::GetNoQuotaSettings());
} }
...@@ -412,12 +427,15 @@ bool ContentBrowserClient::ShouldUseGmsCoreGeolocationProvider() { ...@@ -412,12 +427,15 @@ bool ContentBrowserClient::ShouldUseGmsCoreGeolocationProvider() {
std::string ContentBrowserClient::GetStoragePartitionIdForSite( std::string ContentBrowserClient::GetStoragePartitionIdForSite(
BrowserContext* browser_context, BrowserContext* browser_context,
const GURL& site) { const GURL& site) {
DCHECK(browser_context);
return std::string(); return std::string();
} }
bool ContentBrowserClient::IsValidStoragePartitionId( bool ContentBrowserClient::IsValidStoragePartitionId(
BrowserContext* browser_context, BrowserContext* browser_context,
const std::string& partition_id) { const std::string& partition_id) {
DCHECK(browser_context);
// Since the GetStoragePartitionIdForChildProcess() only generates empty // Since the GetStoragePartitionIdForChildProcess() only generates empty
// strings, we should only ever see empty strings coming back. // strings, we should only ever see empty strings coming back.
return partition_id.empty(); return partition_id.empty();
...@@ -430,6 +448,8 @@ void ContentBrowserClient::GetStoragePartitionConfigForSite( ...@@ -430,6 +448,8 @@ void ContentBrowserClient::GetStoragePartitionConfigForSite(
std::string* partition_domain, std::string* partition_domain,
std::string* partition_name, std::string* partition_name,
bool* in_memory) { bool* in_memory) {
DCHECK(browser_context);
partition_domain->clear(); partition_domain->clear();
partition_name->clear(); partition_name->clear();
*in_memory = false; *in_memory = false;
...@@ -497,17 +517,20 @@ bool ContentBrowserClient::AllowPepperSocketAPI( ...@@ -497,17 +517,20 @@ bool ContentBrowserClient::AllowPepperSocketAPI(
const GURL& url, const GURL& url,
bool private_api, bool private_api,
const SocketPermissionRequest* params) { const SocketPermissionRequest* params) {
DCHECK(browser_context);
return false; return false;
} }
bool ContentBrowserClient::IsPepperVpnProviderAPIAllowed( bool ContentBrowserClient::IsPepperVpnProviderAPIAllowed(
BrowserContext* browser_context, BrowserContext* browser_context,
const GURL& url) { const GURL& url) {
DCHECK(browser_context);
return false; return false;
} }
std::unique_ptr<VpnServiceProxy> ContentBrowserClient::GetVpnServiceProxy( std::unique_ptr<VpnServiceProxy> ContentBrowserClient::GetVpnServiceProxy(
BrowserContext* browser_context) { BrowserContext* browser_context) {
DCHECK(browser_context);
return nullptr; return nullptr;
} }
...@@ -527,17 +550,22 @@ TracingDelegate* ContentBrowserClient::GetTracingDelegate() { ...@@ -527,17 +550,22 @@ TracingDelegate* ContentBrowserClient::GetTracingDelegate() {
bool ContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle( bool ContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle(
BrowserContext* browser_context, BrowserContext* browser_context,
const GURL& url) { const GURL& url) {
DCHECK(browser_context);
return false; return false;
} }
bool ContentBrowserClient::IsPluginAllowedToUseDevChannelAPIs( bool ContentBrowserClient::IsPluginAllowedToUseDevChannelAPIs(
BrowserContext* browser_context, BrowserContext* browser_context,
const GURL& url) { const GURL& url) {
// |browser_context| may be null (e.g. when called from
// PpapiPluginProcessHost::PpapiPluginProcessHost).
return false; return false;
} }
std::string ContentBrowserClient::GetServiceUserIdForBrowserContext( std::string ContentBrowserClient::GetServiceUserIdForBrowserContext(
BrowserContext* browser_context) { BrowserContext* browser_context) {
DCHECK(browser_context);
return base::GenerateGUID(); return base::GenerateGUID();
} }
...@@ -564,6 +592,7 @@ void ContentBrowserClient::OpenURL( ...@@ -564,6 +592,7 @@ void ContentBrowserClient::OpenURL(
content::BrowserContext* browser_context, content::BrowserContext* browser_context,
const content::OpenURLParams& params, const content::OpenURLParams& params,
const base::Callback<void(content::WebContents*)>& callback) { const base::Callback<void(content::WebContents*)>& callback) {
DCHECK(browser_context);
callback.Run(nullptr); callback.Run(nullptr);
} }
...@@ -676,6 +705,7 @@ bool ContentBrowserClient::WillCreateURLLoaderFactory( ...@@ -676,6 +705,7 @@ bool ContentBrowserClient::WillCreateURLLoaderFactory(
const url::Origin& request_initiator, const url::Origin& request_initiator,
network::mojom::URLLoaderFactoryRequest* factory_request, network::mojom::URLLoaderFactoryRequest* factory_request,
bool* bypass_redirect_checks) { bool* bypass_redirect_checks) {
DCHECK(browser_context);
return false; return false;
} }
...@@ -698,6 +728,7 @@ network::mojom::NetworkContextPtr ContentBrowserClient::CreateNetworkContext( ...@@ -698,6 +728,7 @@ network::mojom::NetworkContextPtr ContentBrowserClient::CreateNetworkContext(
BrowserContext* context, BrowserContext* context,
bool in_memory, bool in_memory,
const base::FilePath& relative_partition_path) { const base::FilePath& relative_partition_path) {
DCHECK(context);
if (!base::FeatureList::IsEnabled(network::features::kNetworkService)) if (!base::FeatureList::IsEnabled(network::features::kNetworkService))
return nullptr; return nullptr;
...@@ -746,6 +777,7 @@ bool ContentBrowserClient::ShowPaymentHandlerWindow( ...@@ -746,6 +777,7 @@ bool ContentBrowserClient::ShowPaymentHandlerWindow(
content::BrowserContext* browser_context, content::BrowserContext* browser_context,
const GURL& url, const GURL& url,
base::OnceCallback<void(bool, int, int)> callback) { base::OnceCallback<void(bool, int, int)> callback) {
DCHECK(browser_context);
return false; return false;
} }
...@@ -806,7 +838,9 @@ bool ContentBrowserClient::IsSafeRedirectTarget(const GURL& url, ...@@ -806,7 +838,9 @@ bool ContentBrowserClient::IsSafeRedirectTarget(const GURL& url,
void ContentBrowserClient::RegisterRendererPreferenceWatcherForWorkers( void ContentBrowserClient::RegisterRendererPreferenceWatcherForWorkers(
BrowserContext* browser_context, BrowserContext* browser_context,
mojom::RendererPreferenceWatcherPtr watcher) {} mojom::RendererPreferenceWatcherPtr watcher) {
// |browser_context| may be null (e.g. during shutdown of a service worker).
}
base::Optional<std::string> ContentBrowserClient::GetOriginPolicyErrorPage( base::Optional<std::string> ContentBrowserClient::GetOriginPolicyErrorPage(
OriginPolicyErrorReason error_reason, OriginPolicyErrorReason error_reason,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment