Change FileSystemContext::OpenPluginPrivateFileSystem to use url::Origin
This CL update the function FileSystemContext::OpenPluginPrivateFileSystem to use url::Origin instead of GURL. Bug: 598424 Change-Id: I6d5b6326036d5e8c82eaa2e8863aa3cd664735d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2040977 Reviewed-by: Joshua Bell <jsbell@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Commit-Queue: Md. Hasanur Rashid <hasanur.r@samsung.com> Cr-Commit-Position: refs/heads/master@{#739823}
This commit is contained in:

committed by
Commit Bot

parent
72f207b892
commit
ecfe103b8f
chrome/browser/browsing_data
content/browser
storage/browser/file_system
@@ -195,8 +195,8 @@ class BrowsingDataMediaLicenseHelperTest : public testing::Test {
|
|||||||
ppapi::kPluginPrivateRootName, base::FilePath());
|
ppapi::kPluginPrivateRootName, base::FilePath());
|
||||||
EXPECT_TRUE(storage::ValidateIsolatedFileSystemId(fsid));
|
EXPECT_TRUE(storage::ValidateIsolatedFileSystemId(fsid));
|
||||||
filesystem_context_->OpenPluginPrivateFileSystem(
|
filesystem_context_->OpenPluginPrivateFileSystem(
|
||||||
origin, storage::kFileSystemTypePluginPrivate, fsid, plugin_name,
|
url::Origin::Create(origin), storage::kFileSystemTypePluginPrivate,
|
||||||
storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
|
fsid, plugin_name, storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
|
||||||
base::Bind(&BrowsingDataMediaLicenseHelperTest::OnFileSystemOpened,
|
base::Bind(&BrowsingDataMediaLicenseHelperTest::OnFileSystemOpened,
|
||||||
base::Unretained(this), await_completion.NotifyClosure()));
|
base::Unretained(this), await_completion.NotifyClosure()));
|
||||||
await_completion.BlockUntilNotified();
|
await_completion.BlockUntilNotified();
|
||||||
|
@@ -146,7 +146,7 @@ void CdmStorageImpl::Open(const std::string& file_name, OpenCallback callback) {
|
|||||||
origin().GetURL(), fsid, ppapi::kPluginPrivateRootName);
|
origin().GetURL(), fsid, ppapi::kPluginPrivateRootName);
|
||||||
|
|
||||||
file_system_context_->OpenPluginPrivateFileSystem(
|
file_system_context_->OpenPluginPrivateFileSystem(
|
||||||
origin().GetURL(), storage::kFileSystemTypePluginPrivate, fsid,
|
origin(), storage::kFileSystemTypePluginPrivate, fsid,
|
||||||
cdm_file_system_id_, storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
|
cdm_file_system_id_, storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
|
||||||
base::BindOnce(&CdmStorageImpl::OnFileSystemOpened,
|
base::BindOnce(&CdmStorageImpl::OnFileSystemOpened,
|
||||||
weak_factory_.GetWeakPtr()));
|
weak_factory_.GetWeakPtr()));
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "storage/browser/file_system/obfuscated_file_util.h"
|
#include "storage/browser/file_system/obfuscated_file_util.h"
|
||||||
#include "storage/browser/quota/special_storage_policy.h"
|
#include "storage/browser/quota/special_storage_policy.h"
|
||||||
#include "storage/common/file_system/file_system_util.h"
|
#include "storage/common/file_system/file_system_util.h"
|
||||||
|
#include "url/origin.h"
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
@@ -127,8 +128,8 @@ void PluginPrivateDataByOriginChecker::CheckFilesOnIOThread() {
|
|||||||
|
|
||||||
IncrementTaskCount();
|
IncrementTaskCount();
|
||||||
filesystem_context_->OpenPluginPrivateFileSystem(
|
filesystem_context_->OpenPluginPrivateFileSystem(
|
||||||
origin_, storage::kFileSystemTypePluginPrivate, fsid_, plugin_name_,
|
url::Origin::Create(origin_), storage::kFileSystemTypePluginPrivate,
|
||||||
storage::OPEN_FILE_SYSTEM_FAIL_IF_NONEXISTENT,
|
fsid_, plugin_name_, storage::OPEN_FILE_SYSTEM_FAIL_IF_NONEXISTENT,
|
||||||
base::BindOnce(&PluginPrivateDataByOriginChecker::OnFileSystemOpened,
|
base::BindOnce(&PluginPrivateDataByOriginChecker::OnFileSystemOpened,
|
||||||
base::Unretained(this)));
|
base::Unretained(this)));
|
||||||
}
|
}
|
||||||
|
@@ -310,8 +310,8 @@ void PepperFileSystemBrowserHost::OpenPluginPrivateFileSystem(
|
|||||||
}
|
}
|
||||||
|
|
||||||
file_system_context->OpenPluginPrivateFileSystem(
|
file_system_context->OpenPluginPrivateFileSystem(
|
||||||
origin, storage::kFileSystemTypePluginPrivate, fsid, plugin_id,
|
url::Origin::Create(origin), storage::kFileSystemTypePluginPrivate, fsid,
|
||||||
storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
|
plugin_id, storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
|
||||||
base::BindOnce(
|
base::BindOnce(
|
||||||
&PepperFileSystemBrowserHost::OpenPluginPrivateFileSystemComplete,
|
&PepperFileSystemBrowserHost::OpenPluginPrivateFileSystemComplete,
|
||||||
weak_factory_.GetWeakPtr(), reply_context, fsid));
|
weak_factory_.GetWeakPtr(), reply_context, fsid));
|
||||||
|
@@ -53,6 +53,7 @@
|
|||||||
#include "storage/browser/file_system/file_system_operation_context.h"
|
#include "storage/browser/file_system/file_system_operation_context.h"
|
||||||
#include "storage/browser/file_system/isolated_context.h"
|
#include "storage/browser/file_system/isolated_context.h"
|
||||||
#include "storage/common/file_system/file_system_util.h"
|
#include "storage/common/file_system/file_system_util.h"
|
||||||
|
#include "url/origin.h"
|
||||||
#endif // BUILDFLAG(ENABLE_PLUGINS)
|
#endif // BUILDFLAG(ENABLE_PLUGINS)
|
||||||
|
|
||||||
using net::CanonicalCookie;
|
using net::CanonicalCookie;
|
||||||
@@ -472,8 +473,8 @@ class RemovePluginPrivateDataTester {
|
|||||||
ppapi::kPluginPrivateRootName, base::FilePath());
|
ppapi::kPluginPrivateRootName, base::FilePath());
|
||||||
EXPECT_TRUE(storage::ValidateIsolatedFileSystemId(fsid));
|
EXPECT_TRUE(storage::ValidateIsolatedFileSystemId(fsid));
|
||||||
filesystem_context_->OpenPluginPrivateFileSystem(
|
filesystem_context_->OpenPluginPrivateFileSystem(
|
||||||
origin, storage::kFileSystemTypePluginPrivate, fsid, plugin_name,
|
url::Origin::Create(origin), storage::kFileSystemTypePluginPrivate,
|
||||||
storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
|
fsid, plugin_name, storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
|
||||||
base::BindOnce(&RemovePluginPrivateDataTester::OnFileSystemOpened,
|
base::BindOnce(&RemovePluginPrivateDataTester::OnFileSystemOpened,
|
||||||
base::Unretained(this), &await_completion));
|
base::Unretained(this), &await_completion));
|
||||||
await_completion.BlockUntilNotified();
|
await_completion.BlockUntilNotified();
|
||||||
|
@@ -494,7 +494,7 @@ bool FileSystemContext::CanServeURLRequest(const FileSystemURL& url) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FileSystemContext::OpenPluginPrivateFileSystem(
|
void FileSystemContext::OpenPluginPrivateFileSystem(
|
||||||
const GURL& origin_url,
|
const url::Origin& origin,
|
||||||
FileSystemType type,
|
FileSystemType type,
|
||||||
const std::string& filesystem_id,
|
const std::string& filesystem_id,
|
||||||
const std::string& plugin_id,
|
const std::string& plugin_id,
|
||||||
@@ -502,8 +502,7 @@ void FileSystemContext::OpenPluginPrivateFileSystem(
|
|||||||
StatusCallback callback) {
|
StatusCallback callback) {
|
||||||
DCHECK(plugin_private_backend_);
|
DCHECK(plugin_private_backend_);
|
||||||
plugin_private_backend_->OpenPrivateFileSystem(
|
plugin_private_backend_->OpenPrivateFileSystem(
|
||||||
url::Origin::Create(origin_url), type, filesystem_id, plugin_id, mode,
|
origin, type, filesystem_id, plugin_id, mode, std::move(callback));
|
||||||
std::move(callback));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystemContext::~FileSystemContext() {
|
FileSystemContext::~FileSystemContext() {
|
||||||
|
@@ -297,7 +297,7 @@ class COMPONENT_EXPORT(STORAGE_BROWSER) FileSystemContext
|
|||||||
|
|
||||||
// This must be used to open 'plugin private' filesystem.
|
// This must be used to open 'plugin private' filesystem.
|
||||||
// See "plugin_private_file_system_backend.h" for more details.
|
// See "plugin_private_file_system_backend.h" for more details.
|
||||||
void OpenPluginPrivateFileSystem(const GURL& origin_url,
|
void OpenPluginPrivateFileSystem(const url::Origin& origin,
|
||||||
FileSystemType type,
|
FileSystemType type,
|
||||||
const std::string& filesystem_id,
|
const std::string& filesystem_id,
|
||||||
const std::string& plugin_id,
|
const std::string& plugin_id,
|
||||||
|
Reference in New Issue
Block a user