Commit 13842dda authored by Mythri Alle's avatar Mythri Alle Committed by Commit Bot

Remove GetCachePath from BrowserContext.

We used to use GetCachePath as a means to control the parameters of the
code caching. To disable code caching embedder returned an empty path.
Now, we replaced this with a better interface with
GeneratedCodeCacheSettings [cl]. We no longer need GetCachePath interface
for BrowserContext

[cl]: https://chromium-review.googlesource.com/c/chromium/src/+/1213093

BUG: chromium:867552
Change-Id: Ifc7993548fa73d8713b935a7cb8cc5876ff3d431
Reviewed-on: https://chromium-review.googlesource.com/c/1301973
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarEric Seckler <eseckler@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607214}
parent c09cd246
......@@ -213,10 +213,6 @@ base::FilePath AwBrowserContext::GetPath() const {
return context_storage_path_;
}
base::FilePath AwBrowserContext::GetCachePath() const {
return GetCacheDir();
}
bool AwBrowserContext::IsOffTheRecord() const {
// Android WebView does not support off the record profile yet.
return false;
......
......@@ -95,7 +95,6 @@ class AwBrowserContext : public content::BrowserContext,
// content::BrowserContext implementation.
base::FilePath GetPath() const override;
base::FilePath GetCachePath() const override;
bool IsOffTheRecord() const override;
content::ResourceContext* GetResourceContext() override;
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
......
......@@ -14,6 +14,7 @@
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/suggestions/image_decoder_impl.h"
#include "chrome/common/chrome_paths_internal.h"
#include "components/image_fetcher/core/cache/image_cache.h"
#include "components/image_fetcher/core/cache/image_data_store_disk.h"
#include "components/image_fetcher/core/cache/image_metadata_store_leveldb.h"
......@@ -40,7 +41,9 @@ std::unique_ptr<ImageDecoder> CreateImageDecoderImpl() {
// static
base::FilePath CachedImageFetcherServiceFactory::GetCachePath(
Profile* profile) {
return profile->GetCachePath().Append(kImageCacheSubdir);
base::FilePath cache_path;
chrome::GetUserCacheDirectory(profile->GetPath(), &cache_path);
return cache_path.Append(kImageCacheSubdir);
}
// static
......
......@@ -275,10 +275,6 @@ base::FilePath OffTheRecordProfileImpl::GetPath() const {
return profile_->GetPath();
}
base::FilePath OffTheRecordProfileImpl::GetCachePath() const {
return profile_->GetCachePath();
}
#if !defined(OS_ANDROID)
std::unique_ptr<content::ZoomLevelDelegate>
OffTheRecordProfileImpl::CreateZoomLevelDelegate(
......
......@@ -90,7 +90,6 @@ class OffTheRecordProfileImpl : public Profile {
// content::BrowserContext implementation:
base::FilePath GetPath() const override;
base::FilePath GetCachePath() const override;
#if !defined(OS_ANDROID)
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
const base::FilePath& partition_path) override;
......
......@@ -628,12 +628,13 @@ void ProfileImpl::DoFinalInit() {
media_device_id_salt_ = new MediaDeviceIDSalt(prefs_.get());
base::FilePath base_cache_path;
// It would be nice to use PathService for fetching this directory, but
// the cache directory depends on the profile directory, which isn't available
// to PathService.
chrome::GetUserCacheDirectory(path_, &base_cache_path_);
chrome::GetUserCacheDirectory(path_, &base_cache_path);
// Always create the cache directory asynchronously.
CreateProfileDirectory(io_task_runner_.get(), base_cache_path_, false);
CreateProfileDirectory(io_task_runner_.get(), base_cache_path, false);
// Initialize components that depend on the current value.
UpdateSupervisedUserIdInStorage();
......@@ -658,7 +659,7 @@ void ProfileImpl::DoFinalInit() {
}
#endif // BUILDFLAG(ENABLE_BACKGROUND_MODE)
base::FilePath media_cache_path = base_cache_path_;
base::FilePath media_cache_path = base_cache_path;
int media_cache_max_size;
GetMediaCacheParameters(&media_cache_path, &media_cache_max_size);
media_cache_path = GetMediaCachePath(media_cache_path);
......@@ -818,10 +819,6 @@ base::FilePath ProfileImpl::GetPath() const {
return path_;
}
base::FilePath ProfileImpl::GetCachePath() const {
return base_cache_path_;
}
scoped_refptr<base::SequencedTaskRunner> ProfileImpl::GetIOTaskRunner() {
return io_task_runner_;
}
......
......@@ -78,7 +78,6 @@ class ProfileImpl : public Profile {
const base::FilePath& partition_path) override;
#endif
base::FilePath GetPath() const override;
base::FilePath GetCachePath() const override;
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
content::ResourceContext* GetResourceContext() override;
content::BrowserPluginGuestManager* GetGuestManager() override;
......@@ -208,7 +207,6 @@ class ProfileImpl : public Profile {
PrefChangeRegistrar pref_change_registrar_;
base::FilePath path_;
base::FilePath base_cache_path_;
// Task runner used for file access in the profile path.
scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
......
......@@ -617,12 +617,6 @@ base::FilePath TestingProfile::GetPath() const {
return profile_path_;
}
base::FilePath TestingProfile::GetCachePath() const {
base::FilePath cache_path;
chrome::GetUserCacheDirectory(profile_path_, &cache_path);
return cache_path;
}
#if !defined(OS_ANDROID)
std::unique_ptr<content::ZoomLevelDelegate>
TestingProfile::CreateZoomLevelDelegate(const base::FilePath& partition_path) {
......
......@@ -241,7 +241,6 @@ class TestingProfile : public Profile {
// content::BrowserContext
base::FilePath GetPath() const override;
base::FilePath GetCachePath() const override;
#if !defined(OS_ANDROID)
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
const base::FilePath& partition_path) override;
......
......@@ -94,10 +94,6 @@ base::FilePath CastBrowserContext::GetPath() const {
return path_;
}
base::FilePath CastBrowserContext::GetCachePath() const {
return base::FilePath();
}
bool CastBrowserContext::IsOffTheRecord() const {
return false;
}
......
......@@ -30,7 +30,6 @@ class CastBrowserContext final : public content::BrowserContext {
const base::FilePath& partition_path) override;
#endif // !defined(OS_ANDROID)
base::FilePath GetPath() const override;
base::FilePath GetCachePath() const override;
bool IsOffTheRecord() const override;
content::ResourceContext* GetResourceContext() override;
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
......
......@@ -259,9 +259,6 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
// Returns the path of the directory where this context's data is stored.
virtual base::FilePath GetPath() const = 0;
// Returns the path of the directory where the code is cached.
virtual base::FilePath GetCachePath() const = 0;
// Return whether this context is incognito. Default is false.
virtual bool IsOffTheRecord() const = 0;
......
......@@ -97,10 +97,6 @@ base::FilePath TestBrowserContext::GetPath() const {
return browser_context_dir_.GetPath();
}
base::FilePath TestBrowserContext::GetCachePath() const {
return browser_context_dir_.GetPath();
}
#if !defined(OS_ANDROID)
std::unique_ptr<ZoomLevelDelegate> TestBrowserContext::CreateZoomLevelDelegate(
const base::FilePath& partition_path) {
......
......@@ -45,7 +45,6 @@ class TestBrowserContext : public BrowserContext {
// BrowserContext implementation.
base::FilePath GetPath() const override;
base::FilePath GetCachePath() const override;
#if !defined(OS_ANDROID)
std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate(
const base::FilePath& partition_path) override;
......
......@@ -146,10 +146,6 @@ base::FilePath ShellBrowserContext::GetPath() const {
return path_;
}
base::FilePath ShellBrowserContext::GetCachePath() const {
return path_;
}
bool ShellBrowserContext::IsOffTheRecord() const {
return off_the_record_;
}
......
......@@ -47,7 +47,6 @@ class ShellBrowserContext : public BrowserContext {
// BrowserContext implementation.
base::FilePath GetPath() const override;
base::FilePath GetCachePath() const override;
#if !defined(OS_ANDROID)
std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate(
const base::FilePath& partition_path) override;
......
......@@ -30,8 +30,6 @@ class PrefsTestBrowserContext : public content::TestBrowserContext {
return path.AppendASCII("shell_prefs");
}
base::FilePath GetCachePath() const override { return GetPath(); }
private:
DISALLOW_COPY_AND_ASSIGN(PrefsTestBrowserContext);
};
......
......@@ -164,10 +164,6 @@ base::FilePath HeadlessBrowserContextImpl::GetPath() const {
return path_;
}
base::FilePath HeadlessBrowserContextImpl::GetCachePath() const {
return path_;
}
bool HeadlessBrowserContextImpl::IsOffTheRecord() const {
return context_options_->incognito_mode();
}
......
......@@ -60,7 +60,6 @@ class HEADLESS_EXPORT HeadlessBrowserContextImpl final
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
const base::FilePath& partition_path) override;
base::FilePath GetPath() const override;
base::FilePath GetCachePath() const override;
bool IsOffTheRecord() const override;
content::ResourceContext* GetResourceContext() override;
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
......
......@@ -95,11 +95,6 @@ base::FilePath WebRunnerBrowserContext::GetPath() const {
return data_dir_path_;
}
base::FilePath WebRunnerBrowserContext::GetCachePath() const {
NOTIMPLEMENTED();
return base::FilePath();
}
bool WebRunnerBrowserContext::IsOffTheRecord() const {
return data_dir_path_.empty();
}
......
......@@ -27,7 +27,6 @@ class WebRunnerBrowserContext : public content::BrowserContext {
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
const base::FilePath& partition_path) override;
base::FilePath GetPath() const override;
base::FilePath GetCachePath() const override;
bool IsOffTheRecord() const override;
content::ResourceContext* GetResourceContext() override;
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
......
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