refactor: move SpecialStoragePolicy from brightray to atom (#13944)
This commit is contained in:
parent
fc730cc705
commit
7253c7f843
8 changed files with 25 additions and 23 deletions
|
@ -11,7 +11,6 @@
|
|||
#include "brightray/browser/brightray_paths.h"
|
||||
#include "brightray/browser/browser_client.h"
|
||||
#include "brightray/browser/inspectable_web_contents_impl.h"
|
||||
#include "brightray/browser/special_storage_policy.h"
|
||||
#include "brightray/browser/zoom_level_delegate.h"
|
||||
#include "brightray/common/application_info.h"
|
||||
#include "components/prefs/json_pref_store.h"
|
||||
|
@ -55,7 +54,6 @@ scoped_refptr<BrowserContext> BrowserContext::Get(const std::string& partition,
|
|||
|
||||
BrowserContext::BrowserContext(const std::string& partition, bool in_memory)
|
||||
: in_memory_(in_memory),
|
||||
storage_policy_(new SpecialStoragePolicy),
|
||||
weak_factory_(this) {
|
||||
if (!PathService::Get(DIR_USER_DATA, &path_)) {
|
||||
PathService::Get(DIR_APP_DATA, &path_);
|
||||
|
@ -160,10 +158,6 @@ content::BrowserPluginGuestManager* BrowserContext::GetGuestManager() {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
storage::SpecialStoragePolicy* BrowserContext::GetSpecialStoragePolicy() {
|
||||
return storage_policy_.get();
|
||||
}
|
||||
|
||||
content::PushMessagingService* BrowserContext::GetPushMessagingService() {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -17,10 +17,6 @@
|
|||
class PrefRegistrySimple;
|
||||
class PrefService;
|
||||
|
||||
namespace storage {
|
||||
class SpecialStoragePolicy;
|
||||
}
|
||||
|
||||
namespace brightray {
|
||||
|
||||
class BrowserContext;
|
||||
|
@ -52,7 +48,6 @@ class BrowserContext
|
|||
content::ResourceContext* GetResourceContext() override;
|
||||
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
|
||||
content::BrowserPluginGuestManager* GetGuestManager() override;
|
||||
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
|
||||
content::PushMessagingService* GetPushMessagingService() override;
|
||||
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
|
||||
content::BackgroundFetchDelegate* GetBackgroundFetchDelegate() override;
|
||||
|
@ -121,7 +116,6 @@ class BrowserContext
|
|||
base::FilePath path_;
|
||||
bool in_memory_;
|
||||
|
||||
scoped_refptr<storage::SpecialStoragePolicy> storage_policy_;
|
||||
std::unique_ptr<PrefService> prefs_;
|
||||
std::unique_ptr<MediaDeviceIDSalt> media_device_id_salt_;
|
||||
// Self-destructing class responsible for creating URLRequestContextGetter
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
#include "brightray/browser/special_storage_policy.h"
|
||||
|
||||
namespace brightray {
|
||||
|
||||
SpecialStoragePolicy::SpecialStoragePolicy() {}
|
||||
|
||||
SpecialStoragePolicy::~SpecialStoragePolicy() {}
|
||||
|
||||
bool SpecialStoragePolicy::IsStorageProtected(const GURL& origin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::IsStorageDurable(const GURL& origin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::HasSessionOnlyOrigins() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::ShouldDeleteCookieOnExit(const GURL& origin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace brightray
|
|
@ -1,31 +0,0 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
#ifndef BRIGHTRAY_BROWSER_SPECIAL_STORAGE_POLICY_H_
|
||||
#define BRIGHTRAY_BROWSER_SPECIAL_STORAGE_POLICY_H_
|
||||
|
||||
#include "storage/browser/quota/special_storage_policy.h"
|
||||
|
||||
namespace brightray {
|
||||
|
||||
class SpecialStoragePolicy : public storage::SpecialStoragePolicy {
|
||||
public:
|
||||
SpecialStoragePolicy();
|
||||
|
||||
// storage::SpecialStoragePolicy implementation.
|
||||
bool IsStorageProtected(const GURL& origin) override;
|
||||
bool IsStorageUnlimited(const GURL& origin) override;
|
||||
bool IsStorageDurable(const GURL& origin) override;
|
||||
bool HasIsolatedStorage(const GURL& origin) override;
|
||||
bool IsStorageSessionOnly(const GURL& origin) override;
|
||||
bool HasSessionOnlyOrigins() override;
|
||||
bool ShouldDeleteCookieOnExit(const GURL& origin) override;
|
||||
|
||||
protected:
|
||||
~SpecialStoragePolicy() override;
|
||||
};
|
||||
|
||||
} // namespace brightray
|
||||
|
||||
#endif // BRIGHTRAY_BROWSER_SPECIAL_STORAGE_POLICY_H_
|
Loading…
Add table
Add a link
Reference in a new issue