Commit c0d2e457 authored by Chris Davis's avatar Chris Davis Committed by Commit Bot

Remove early call to shell_integration::GetChromeDefaultState

This change removes the call made to determine the default browser state
in call to shell_integration::GetChromeDefaultState.  The call is
expensive on all platforms and in this case the result is never even
actually used. Removing CachedDefaultWebClientState from
BrowserProcessImpl since it is not used.

Bug: 1012357
Change-Id: Ic85f5dbdea9bd45afe2b372942069bad3136be90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845509Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Chris Davis <chrdavis@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#704843}
parent 3692f7b2
......@@ -67,6 +67,7 @@
#include "extensions/common/permissions/permission_set.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image_family.h"
#if defined(OS_WIN)
#include "chrome/browser/win/app_icon.h"
......
......@@ -19,7 +19,6 @@
#include "base/macros.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process_platform_part.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/common/buildflags.h"
#include "media/media_buildflags.h"
......@@ -266,12 +265,6 @@ class BrowserProcess {
virtual resource_coordinator::ResourceCoordinatorParts*
resource_coordinator_parts() = 0;
// Returns the default web client state of Chrome (i.e., was it the user's
// default browser) at the time a previous check was made sometime between
// process startup and now.
virtual shell_integration::DefaultWebClientState
CachedDefaultWebClientState() = 0;
private:
DISALLOW_COPY_AND_ASSIGN(BrowserProcess);
};
......
......@@ -881,11 +881,6 @@ BrowserProcessImpl::resource_coordinator_parts() {
return resource_coordinator_parts_.get();
}
shell_integration::DefaultWebClientState
BrowserProcessImpl::CachedDefaultWebClientState() {
return cached_default_web_client_state_;
}
// static
void BrowserProcessImpl::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled,
......@@ -1150,8 +1145,6 @@ void BrowserProcessImpl::PreMainMessageLoopRun() {
->Clone());
#endif
CacheDefaultWebClientState();
platform_part_->PreMainMessageLoopRun();
if (base::FeatureList::IsEnabled(network_time::kNetworkTimeServiceQuerying)) {
......@@ -1340,14 +1333,6 @@ void BrowserProcessImpl::ApplyDefaultBrowserPolicy() {
}
}
void BrowserProcessImpl::CacheDefaultWebClientState() {
#if defined(OS_CHROMEOS)
cached_default_web_client_state_ = shell_integration::IS_DEFAULT;
#elif !defined(OS_ANDROID)
cached_default_web_client_state_ = shell_integration::GetDefaultBrowser();
#endif
}
void BrowserProcessImpl::Pin() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
......
......@@ -191,8 +191,6 @@ class BrowserProcessImpl : public BrowserProcess,
resource_coordinator::TabManager* GetTabManager() override;
resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts()
override;
shell_integration::DefaultWebClientState CachedDefaultWebClientState()
override;
static void RegisterPrefs(PrefRegistrySimple* registry);
......@@ -226,8 +224,6 @@ class BrowserProcessImpl : public BrowserProcess,
void ApplyDefaultBrowserPolicy();
void CacheDefaultWebClientState();
// Methods called to control our lifetime. The browser process can be "pinned"
// to make sure it keeps running.
void Pin();
......@@ -395,9 +391,6 @@ class BrowserProcessImpl : public BrowserProcess,
std::unique_ptr<gcm::GCMDriver> gcm_driver_;
shell_integration::DefaultWebClientState cached_default_web_client_state_ =
shell_integration::UNKNOWN_DEFAULT;
std::unique_ptr<resource_coordinator::ResourceCoordinatorParts>
resource_coordinator_parts_;
......
......@@ -19,6 +19,7 @@
#include "chrome/grit/generated_resources.h"
#include "components/prefs/pref_service.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/native_theme/native_theme.h"
......
......@@ -32,6 +32,7 @@
#include "ui/display/win/screen_win.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/icon_util.h"
#include "ui/gfx/image/image_family.h"
#include "ui/views/controls/menu/native_menu_win.h"
////////////////////////////////////////////////////////////////////////////////
......
......@@ -6,6 +6,7 @@
#include <utility>
#include "base/memory/ref_counted_memory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/search/background/ntp_backgrounds.h"
......
......@@ -420,11 +420,6 @@ resource_coordinator::TabManager* TestingBrowserProcess::GetTabManager() {
return resource_coordinator_parts()->tab_manager();
}
shell_integration::DefaultWebClientState
TestingBrowserProcess::CachedDefaultWebClientState() {
return shell_integration::UNKNOWN_DEFAULT;
}
void TestingBrowserProcess::SetSharedURLLoaderFactory(
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory) {
shared_url_loader_factory_ = shared_url_loader_factory;
......
......@@ -135,8 +135,6 @@ class TestingBrowserProcess : public BrowserProcess {
resource_coordinator::TabManager* GetTabManager() override;
resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts()
override;
shell_integration::DefaultWebClientState CachedDefaultWebClientState()
override;
// Set the local state for tests. Consumer is responsible for cleaning it up
// afterwards (using ScopedTestingLocalState, for example).
......
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