Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Web / Security / FileAuthorizationModule.cs
index 63c2efee1a58ee1b09c94f1e22d4580728155358..7eb437ea86e65e2027dc16960e11b21f9973401e 100644 (file)
@@ -254,7 +254,7 @@ namespace System.Web.Security {
 
             freeDescriptor = false;
             string                          oCacheKey   = CacheInternal.PrefixFileSecurity + fileName;
-            FileSecurityDescriptorWrapper   oSecDesc    = HttpRuntime.CacheInternal.Get(oCacheKey) as FileSecurityDescriptorWrapper;
+            FileSecurityDescriptorWrapper   oSecDesc    = HttpRuntime.Cache.InternalCache.Get(oCacheKey) as FileSecurityDescriptorWrapper;
 
             // If it's not present in the cache, then create it and add to the cache
             if (oSecDesc == null) {
@@ -267,8 +267,11 @@ namespace System.Web.Security {
                         Debug.Trace("FAM", "GetFileSecurityDescriptorWrapper: inserting into cache with dependency on " + cacheDependencyPath);
                         CacheDependency dependency = new CacheDependency(0, cacheDependencyPath);
                         TimeSpan slidingExp = CachedPathData.UrlMetadataSlidingExpiration;
-                        HttpRuntime.CacheInternal.UtcInsert(oCacheKey, oSecDesc, dependency, Cache.NoAbsoluteExpiration, slidingExp,
-                                                            CacheItemPriority.Default, new CacheItemRemovedCallback(oSecDesc.OnCacheItemRemoved));
+                        HttpRuntime.Cache.InternalCache.Insert(oCacheKey, oSecDesc, new CacheInsertOptions() {
+                                                                                    Dependencies = dependency,
+                                                                                    SlidingExpiration = slidingExp,
+                                                                                    OnRemovedCallback = new CacheItemRemovedCallback(oSecDesc.OnCacheItemRemoved)
+                                                                                });
                     } catch (Exception e){
                         Debug.Trace("internal", e.ToString());
                         freeDescriptor = true;
@@ -303,7 +306,7 @@ namespace System.Web.Security {
 
             oCacheKey = CacheInternal.PrefixFileSecurity + context.Request.PhysicalPathInternal;
 
-            sec = HttpRuntime.CacheInternal.Get(oCacheKey);
+            sec = HttpRuntime.Cache.InternalCache.Get(oCacheKey);
 
             // If it's not present in the cache, then return true
             if (sec == null || !(sec is FileSecurityDescriptorWrapper))