Add UnsupportedOSPlatformAttribute to ProtectedBrowserStorage APIs (#24800)

This commit is contained in:
Pranav K 2020-08-13 02:28:46 -07:00 committed by GitHub
parent b8f906f0b8
commit fa2d86e5b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Concurrent;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.DataProtection;
@ -11,9 +12,11 @@ using Microsoft.JSInterop;
namespace Microsoft.AspNetCore.Components.Web.Extensions
{
/// <summary>
/// Provides mechanisms for storing and retrieving data in the browser storage.
/// </summary>
[UnsupportedOSPlatform("browser")]
public abstract class ProtectedBrowserStorage
{
private readonly string _storeName;

View File

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.Versioning;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.JSInterop;
@ -15,6 +16,7 @@ namespace Microsoft.AspNetCore.Components.Web.Extensions
///
/// See: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
/// </summary>
[UnsupportedOSPlatform("browser")]
public class ProtectedLocalStorage : ProtectedBrowserStorage
{
/// <summary>

View File

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.Versioning;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.JSInterop;
@ -15,6 +16,7 @@ namespace Microsoft.AspNetCore.Components.Web.Extensions
///
/// See: https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
/// </summary>
[UnsupportedOSPlatform("browser")]
public class ProtectedSessionStorage : ProtectedBrowserStorage
{
/// <summary>