Skip to content

Commit

Permalink
Remove content::ResourceContext implementation for Cast.
Browse files Browse the repository at this point in the history
None of the content::ResourceContext subclasses actually have any code,
so can just use content::ResourceContext directly instead. Not a huge
step in getting rid of the class, but provides some regression
protection before it can be removed.

Bug: 908955
Change-Id: I950dde99f4b0b096a8d2de84f4e189e9c60c6e9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4929158
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1208957}
  • Loading branch information
Matt Menke authored and Chromium LUCI CQ committed Oct 12, 2023
1 parent 490dd69 commit 49427de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
13 changes: 1 addition & 12 deletions chromecast/browser/cast_browser_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,8 @@ namespace {
const void* const kDownloadManagerDelegateKey = &kDownloadManagerDelegateKey;
} // namespace

class CastBrowserContext::CastResourceContext
: public content::ResourceContext {
public:
CastResourceContext() {}

CastResourceContext(const CastResourceContext&) = delete;
CastResourceContext& operator=(const CastResourceContext&) = delete;

~CastResourceContext() override {}
};

CastBrowserContext::CastBrowserContext()
: resource_context_(new CastResourceContext) {
: resource_context_(new content::ResourceContext()) {
profile_metrics::SetBrowserProfileType(
this, profile_metrics::BrowserProfileType::kRegular);
InitWhileIOAllowed();
Expand Down
5 changes: 2 additions & 3 deletions chromecast/browser/cast_browser_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "base/files/file_path.h"
#include "components/keyed_service/core/simple_factory_key.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/resource_context.h"

namespace chromecast {
namespace shell {
Expand Down Expand Up @@ -52,14 +53,12 @@ class CastBrowserContext final : public content::BrowserContext {
GetReduceAcceptLanguageControllerDelegate() override;

private:
class CastResourceContext;

// Performs initialization of the CastBrowserContext while IO is still
// allowed on the current thread.
void InitWhileIOAllowed();

base::FilePath path_;
std::unique_ptr<CastResourceContext> resource_context_;
std::unique_ptr<content::ResourceContext> resource_context_;
std::unique_ptr<content::PermissionControllerDelegate> permission_manager_;
std::unique_ptr<SimpleFactoryKey> simple_factory_key_;
};
Expand Down

0 comments on commit 49427de

Please sign in to comment.