-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b81ec7
commit 152d071
Showing
5 changed files
with
199 additions
and
29 deletions.
There are no files selected for viewing
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
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
29 changes: 29 additions & 0 deletions
29
chromium_src/third_party/blink/renderer/modules/storage/storage_controller.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,29 @@ | ||
/* Copyright (c) 2020 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/. */ | ||
|
||
#include "third_party/blink/renderer/modules/storage/storage_controller.h" | ||
|
||
#include "third_party/blink/public/common/features.h" | ||
#include "third_party/blink/renderer/core/frame/local_dom_window.h" | ||
#include "third_party/blink/renderer/core/frame/local_frame.h" | ||
|
||
namespace blink { | ||
|
||
// static | ||
bool StorageController::CanAccessStorageArea(LocalFrame* frame, | ||
StorageArea::StorageType type) { | ||
if (CanAccessStorageAreaWithoutEphemeral(frame, type)) | ||
return true; | ||
if (frame && frame->GetDocument() && frame->GetDocument()->domWindow() && | ||
frame->GetDocument()->domWindow()->IsCrossSiteSubframe()) | ||
return base::FeatureList::IsEnabled(features::kBraveEphemeralStorage); | ||
return false; | ||
} | ||
|
||
} // namespace blink | ||
|
||
#define CanAccessStorageArea CanAccessStorageAreaWithoutEphemeral | ||
#include "../../../../../../../third_party/blink/renderer/modules/storage/storage_controller.cc" | ||
#undef CanAccessStorageAreaWithoutEphemeral |
18 changes: 18 additions & 0 deletions
18
chromium_src/third_party/blink/renderer/modules/storage/storage_controller.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,18 @@ | ||
/* Copyright (c) 2020 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_STORAGE_CONTROLLER_H_ | ||
#define BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_STORAGE_STORAGE_CONTROLLER_H_ | ||
|
||
#define BRAVE_STORAGE_CONTROLLER_H \ | ||
public: \ | ||
static bool CanAccessStorageAreaWithoutEphemeral( \ | ||
LocalFrame* frame, StorageArea::StorageType type); | ||
|
||
#include "../../../../../../../third_party/blink/renderer/modules/storage/storage_controller.h" | ||
|
||
#undef BRAVE_STORAGE_CONTROLLER_H | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_STORAGE_STORAGE_CONTROLLER_H_ |
12 changes: 12 additions & 0 deletions
12
patches/third_party-blink-renderer-modules-storage-storage_controller.h.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/storage_controller.h b/third_party/blink/renderer/modules/storage/storage_controller.h | ||
index 554f6cbaadec5b247452b68ffe332d1210cd4a81..6d8e3adec71bbbf7782671f4d0138f30ecebac39 100644 | ||
--- a/third_party/blink/renderer/modules/storage/storage_controller.h | ||
+++ b/third_party/blink/renderer/modules/storage/storage_controller.h | ||
@@ -96,6 +96,7 @@ class MODULES_EXPORT StorageController : public mojom::blink::DomStorageClient { | ||
return task_runner_; | ||
} | ||
|
||
+ BRAVE_STORAGE_CONTROLLER_H | ||
private: | ||
void EnsureLocalStorageNamespaceCreated(); | ||
|