-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix localStorage support in 1p-ES mode.
- Loading branch information
Showing
4 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
chromium_src/third_party/blink/renderer/modules/storage/cached_storage_area.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* Copyright (c) 2021 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#define BRAVE_CACHED_STORAGE_AREA_ENSURE_LOADED \ | ||
if (remote_area_.is_bound() && !remote_area_.is_connected()) { \ | ||
ResetConnection(); \ | ||
registered_disconnect_handler_ = false; \ | ||
} \ | ||
\ | ||
if (!registered_disconnect_handler_ && remote_area_.is_bound() && \ | ||
remote_area_.is_connected()) { \ | ||
remote_area_.set_disconnect_handler( \ | ||
base::BindOnce([](CachedStorageArea* area) { area->map_.reset(); }, \ | ||
base::Unretained(this))); \ | ||
registered_disconnect_handler_ = true; \ | ||
} | ||
|
||
#include "../../../../../../../third_party/blink/renderer/modules/storage/cached_storage_area.cc" | ||
|
||
#undef BRAVE_CACHED_STORAGE_AREA_ENSURE_LOADED |
17 changes: 17 additions & 0 deletions
17
chromium_src/third_party/blink/renderer/modules/storage/cached_storage_area.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Copyright (c) 2021 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_STORAGE_CACHED_STORAGE_AREA_H_ | ||
#define BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_STORAGE_CACHED_STORAGE_AREA_H_ | ||
|
||
#define pending_mutations_by_key_ \ | ||
pending_mutations_by_key_; \ | ||
bool registered_disconnect_handler_ = false | ||
|
||
#include "../../../../../../../third_party/blink/renderer/modules/storage/cached_storage_area.h" | ||
|
||
#undef pending_mutations_by_key_ | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_STORAGE_CACHED_STORAGE_AREA_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
patches/third_party-blink-renderer-modules-storage-cached_storage_area.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/third_party/blink/renderer/modules/storage/cached_storage_area.cc b/third_party/blink/renderer/modules/storage/cached_storage_area.cc | ||
index 9a3840e551985c7072e160fb950e606703a1d2aa..30b032269d4f2bfccc1d10c525f5265993945b17 100644 | ||
--- a/third_party/blink/renderer/modules/storage/cached_storage_area.cc | ||
+++ b/third_party/blink/renderer/modules/storage/cached_storage_area.cc | ||
@@ -556,6 +556,7 @@ void CachedStorageArea::MaybeApplyNonLocalMutationForKey( | ||
} | ||
|
||
void CachedStorageArea::EnsureLoaded() { | ||
+ BRAVE_CACHED_STORAGE_AREA_ENSURE_LOADED | ||
if (map_) | ||
return; | ||
|