summaryrefslogtreecommitdiff
path: root/chromium/content/browser/dom_storage
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/dom_storage')
-rw-r--r--chromium/content/browser/dom_storage/dom_storage_context_wrapper.cc9
-rw-r--r--chromium/content/browser/dom_storage/dom_storage_context_wrapper_unittest.cc12
-rw-r--r--chromium/content/browser/dom_storage/session_storage_namespace_impl.cc5
3 files changed, 13 insertions, 13 deletions
diff --git a/chromium/content/browser/dom_storage/dom_storage_context_wrapper.cc b/chromium/content/browser/dom_storage/dom_storage_context_wrapper.cc
index 119d7cd3a24..19a83ec8132 100644
--- a/chromium/content/browser/dom_storage/dom_storage_context_wrapper.cc
+++ b/chromium/content/browser/dom_storage/dom_storage_context_wrapper.cc
@@ -94,8 +94,8 @@ class DOMStorageContextWrapper::StoragePolicyObserver
if (!context_wrapper_)
return;
- base::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE,
base::BindOnce(&DOMStorageContextWrapper::OnStoragePolicyChanged,
context_wrapper_));
}
@@ -127,9 +127,10 @@ DOMStorageContextWrapper::DOMStorageContextWrapper(
StoragePartitionImpl* partition,
storage::SpecialStoragePolicy* special_storage_policy)
: partition_(partition), storage_policy_(special_storage_policy) {
- memory_pressure_listener_.reset(new base::MemoryPressureListener(
+ memory_pressure_listener_ = std::make_unique<base::MemoryPressureListener>(
+ FROM_HERE,
base::BindRepeating(&DOMStorageContextWrapper::OnMemoryPressure,
- base::Unretained(this))));
+ base::Unretained(this)));
MaybeBindSessionStorageControl();
MaybeBindLocalStorageControl();
diff --git a/chromium/content/browser/dom_storage/dom_storage_context_wrapper_unittest.cc b/chromium/content/browser/dom_storage/dom_storage_context_wrapper_unittest.cc
index b2fd15c94ed..04b9a352fe9 100644
--- a/chromium/content/browser/dom_storage/dom_storage_context_wrapper_unittest.cc
+++ b/chromium/content/browser/dom_storage/dom_storage_context_wrapper_unittest.cc
@@ -10,6 +10,7 @@
#include "base/guid.h"
#include "base/run_loop.h"
#include "content/browser/child_process_security_policy_impl.h"
+#include "content/browser/site_instance_impl.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "mojo/public/cpp/bindings/message.h"
@@ -36,12 +37,11 @@ class DOMStorageContextWrapperTest : public testing::Test {
security_policy->AddIsolatedOrigins(
{test_origin1_, test_origin2_},
ChildProcessSecurityPolicy::IsolatedOriginSource::TEST);
- security_policy->LockToOrigin(IsolationContext(&browser_context_),
- kTestProcessIdOrigin1,
- test_origin1_.GetURL());
- security_policy->LockToOrigin(IsolationContext(&browser_context_),
- kTestProcessIdOrigin2,
- test_origin2_.GetURL());
+ IsolationContext isolation_context(&browser_context_);
+ security_policy->LockProcessForTesting(
+ isolation_context, kTestProcessIdOrigin1, test_origin1_.GetURL());
+ security_policy->LockProcessForTesting(
+ isolation_context, kTestProcessIdOrigin2, test_origin2_.GetURL());
}
void TearDown() override {
diff --git a/chromium/content/browser/dom_storage/session_storage_namespace_impl.cc b/chromium/content/browser/dom_storage/session_storage_namespace_impl.cc
index bc18031e6be..1d01ca2f661 100644
--- a/chromium/content/browser/dom_storage/session_storage_namespace_impl.cc
+++ b/chromium/content/browser/dom_storage/session_storage_namespace_impl.cc
@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/memory/ptr_util.h"
-#include "base/task/post_task.h"
#include "components/services/storage/public/mojom/session_storage_control.mojom.h"
#include "content/browser/dom_storage/dom_storage_context_wrapper.h"
#include "content/public/browser/browser_task_traits.h"
@@ -102,8 +101,8 @@ SessionStorageNamespaceImpl::~SessionStorageNamespaceImpl() {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
// If this fails to post then that's fine, as the mojo state should
// already be destructed.
- base::PostTask(FROM_HERE, {BrowserThread::UI},
- deleteNamespaceRunner.Release());
+ GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ deleteNamespaceRunner.Release());
}
}