Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -46,15 +46,9 @@ using System.Web.UI;
[assembly: AssemblyTitle("System.Web.dll")]
[assembly: AssemblyDescription("System.Web.dll")]
#if !NET_4_0
[assembly: AssemblyConfiguration("Development version")]
#endif
[assembly: AssemblyCompany (Consts.MonoCompany)]
[assembly: AssemblyProduct (Consts.MonoProduct)]
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
#if !NET_4_0
[assembly: AssemblyTrademark("")]
#endif
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: AssemblyDefaultAlias("System.Web.dll")]
@@ -67,7 +61,6 @@ using System.Web.UI;
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
#if NET_4_0
[assembly: AssemblyFileVersion (Consts.FxVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
[assembly: Dependency ("System", LoadHint.Always)]
@@ -86,7 +79,6 @@ using System.Web.UI;
[assembly: TypeForwardedTo (typeof (System.Web.Security.MembershipProvider))]
[assembly: InternalsVisibleTo ("Microsoft.Web.Infrastructure, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
#endif
[assembly: InternalsVisibleTo ("System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
@@ -138,9 +130,7 @@ using System.Web.UI;
[assembly: WebResource ("computer.gif", "image/gif")]
[assembly: WebResource ("TreeView.js", "text/javascript")]
[assembly: WebResource ("Menu.js", "text/javascript")]
#if NET_4_0
[assembly: WebResource ("MenuModern.js", "text/javascript")]
#endif
[assembly: WebResource ("GridView.js", "text/javascript")]
[assembly: WebResource ("webform.js", "text/javascript")]
[assembly: WebResource ("WebUIValidation_2.0.js", "text/javascript")]

View File

@@ -255,6 +255,7 @@ LIB_MCS_FLAGS = \
-r:System.Xml.dll \
-r:System.EnterpriseServices.dll \
-r:System.Runtime.Serialization.Formatters.Soap \
-r:System.ComponentModel.DataAnnotations.dll \
$(OTHER_LIB_MCS_FLAGS) \
$(RESX_RES:%=/resource:%) \
$(OTHER_RES:%=/resource:%)
@@ -271,10 +272,6 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,159
$(foreach file,$(NUNIT_APP_CODE_FILES),$(shell echo $(file) | sed -e 's;\(.*\)/\(.*\);/resource:\1/\2,App_Code/\2 ;g')) \
$(foreach file,$(NUNIT_APP_GLOBALRESOURCES_FILES),$(shell echo $(file) | sed -e 's;\(.*\)/\(.*\);/resource:\1/\2,App_GlobalResources/\2 ;g'))
ifeq (net_2_0, $(PROFILE))
TEST_MCS_FLAGS += -r:System.Web.Extensions.dll -d:TEST
endif
EXTRA_DISTFILES = \
$(RESOURCE_FILES_4) \
$(RESOURCE_FILES_2) \
@@ -447,4 +444,4 @@ ifneq ($(PROFILE),basic)
csproj-local:
$(MAKE) csproj-local intermediate=plainweb/
endif
endif
endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections.Generic;
@@ -38,4 +37,3 @@ namespace Mono.Web.Util
object MapSection (object section, List <SettingsMappingWhat> whats);
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections.Generic;
using System.Configuration;
@@ -162,4 +161,3 @@ namespace Mono.Web.Util
}
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections.Generic;
using System.Configuration;
@@ -162,4 +161,3 @@ namespace Mono.Web.Util
}
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -109,4 +108,3 @@ namespace Mono.Web.Util
}
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
@@ -183,4 +182,3 @@ namespace Mono.Web.Util
}
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections.Generic;
using System.Xml;
@@ -114,4 +113,3 @@ namespace Mono.Web.Util
}
}
}
#endif

View File

@@ -0,0 +1,479 @@
// SplitOrderedList.cs
//
// Copyright (c) 2010 Jérémie "Garuma" Laval
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//
using System;
using System.Threading;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace System.Collections.Concurrent
{
internal class SplitOrderedList<TKey, T>
{
class Node
{
public bool Marked;
public ulong Key;
public TKey SubKey;
public T Data;
public Node Next;
public Node Init (ulong key, TKey subKey, T data)
{
this.Key = key;
this.SubKey = subKey;
this.Data = data;
this.Marked = false;
this.Next = null;
return this;
}
// Used to create dummy node
public Node Init (ulong key)
{
this.Key = key;
this.Data = default (T);
this.Next = null;
this.Marked = false;
this.SubKey = default (TKey);
return this;
}
// Used to create marked node
public Node Init (Node wrapped)
{
this.Marked = true;
this.Next = wrapped;
this.Key = 0;
this.Data = default (T);
this.SubKey = default (TKey);
return this;
}
}
const int MaxLoad = 5;
const uint BucketSize = 512;
Node head;
Node tail;
Node[] buckets = new Node [BucketSize];
int count;
int size = 2;
SimpleRwLock slim = new SimpleRwLock ();
readonly IEqualityComparer<TKey> comparer;
public SplitOrderedList (IEqualityComparer<TKey> comparer)
{
this.comparer = comparer;
head = new Node ().Init (0);
tail = new Node ().Init (ulong.MaxValue);
head.Next = tail;
SetBucket (0, head);
}
public int Count {
get {
return count;
}
}
public T InsertOrUpdate (uint key, TKey subKey, Func<T> addGetter, Func<T, T> updateGetter)
{
Node current;
bool result = InsertInternal (key, subKey, default (T), addGetter, out current);
if (result)
return current.Data;
// FIXME: this should have a CAS-like behavior
return current.Data = updateGetter (current.Data);
}
public T InsertOrUpdate (uint key, TKey subKey, T addValue, T updateValue)
{
Node current;
if (InsertInternal (key, subKey, addValue, null, out current))
return current.Data;
// FIXME: this should have a CAS-like behavior
return current.Data = updateValue;
}
public bool Insert (uint key, TKey subKey, T data)
{
Node current;
return InsertInternal (key, subKey, data, null, out current);
}
public T InsertOrGet (uint key, TKey subKey, T data, Func<T> dataCreator)
{
Node current;
InsertInternal (key, subKey, data, dataCreator, out current);
return current.Data;
}
bool InsertInternal (uint key, TKey subKey, T data, Func<T> dataCreator, out Node current)
{
Node node = new Node ().Init (ComputeRegularKey (key), subKey, data);
uint b = key % (uint)size;
Node bucket;
if ((bucket = GetBucket (b)) == null)
bucket = InitializeBucket (b);
if (!ListInsert (node, bucket, out current, dataCreator))
return false;
int csize = size;
if (Interlocked.Increment (ref count) / csize > MaxLoad && (csize & 0x40000000) == 0)
Interlocked.CompareExchange (ref size, 2 * csize, csize);
current = node;
return true;
}
public bool Find (uint key, TKey subKey, out T data)
{
Node node;
uint b = key % (uint)size;
data = default (T);
Node bucket;
if ((bucket = GetBucket (b)) == null)
bucket = InitializeBucket (b);
if (!ListFind (ComputeRegularKey (key), subKey, bucket, out node))
return false;
data = node.Data;
return !node.Marked;
}
public bool CompareExchange (uint key, TKey subKey, T data, Func<T, bool> check)
{
Node node;
uint b = key % (uint)size;
Node bucket;
if ((bucket = GetBucket (b)) == null)
bucket = InitializeBucket (b);
if (!ListFind (ComputeRegularKey (key), subKey, bucket, out node))
return false;
if (!check (node.Data))
return false;
node.Data = data;
return true;
}
public bool Delete (uint key, TKey subKey, out T data)
{
uint b = key % (uint)size;
Node bucket;
if ((bucket = GetBucket (b)) == null)
bucket = InitializeBucket (b);
if (!ListDelete (bucket, ComputeRegularKey (key), subKey, out data))
return false;
Interlocked.Decrement (ref count);
return true;
}
public IEnumerator<T> GetEnumerator ()
{
Node node = head.Next;
while (node != tail) {
while (node.Marked || (node.Key & 1) == 0) {
node = node.Next;
if (node == tail)
yield break;
}
yield return node.Data;
node = node.Next;
}
}
Node InitializeBucket (uint b)
{
Node current;
uint parent = GetParent (b);
Node bucket;
if ((bucket = GetBucket (parent)) == null)
bucket = InitializeBucket (parent);
Node dummy = new Node ().Init (ComputeDummyKey (b));
if (!ListInsert (dummy, bucket, out current, null))
return current;
return SetBucket (b, dummy);
}
// Turn v's MSB off
static uint GetParent (uint v)
{
uint t, tt;
// Find MSB position in v
var pos = (tt = v >> 16) > 0 ?
(t = tt >> 8) > 0 ? 24 + logTable[t] : 16 + logTable[tt] :
(t = v >> 8) > 0 ? 8 + logTable[t] : logTable[v];
return (uint)(v & ~(1 << pos));
}
// Reverse integer bits and make sure LSB is set
static ulong ComputeRegularKey (uint key)
{
return ComputeDummyKey (key) | 1;
}
// Reverse integer bits
static ulong ComputeDummyKey (uint key)
{
return ((ulong)(((uint)reverseTable[key & 0xff] << 24) |
((uint)reverseTable[(key >> 8) & 0xff] << 16) |
((uint)reverseTable[(key >> 16) & 0xff] << 8) |
((uint)reverseTable[(key >> 24) & 0xff]))) << 1;
}
// Bucket storage is abstracted in a simple two-layer tree to avoid too much memory resize
Node GetBucket (uint index)
{
if (index >= buckets.Length)
return null;
return buckets[index];
}
Node SetBucket (uint index, Node node)
{
try {
slim.EnterReadLock ();
CheckSegment (index, true);
Interlocked.CompareExchange (ref buckets[index], node, null);
return buckets[index];
} finally {
slim.ExitReadLock ();
}
}
// When we run out of space for bucket storage, we use a lock-based array resize
void CheckSegment (uint segment, bool readLockTaken)
{
if (segment < buckets.Length)
return;
if (readLockTaken)
slim.ExitReadLock ();
try {
slim.EnterWriteLock ();
while (segment >= buckets.Length)
Array.Resize (ref buckets, buckets.Length * 2);
} finally {
slim.ExitWriteLock ();
}
if (readLockTaken)
slim.EnterReadLock ();
}
Node ListSearch (ulong key, TKey subKey, ref Node left, Node h)
{
Node leftNodeNext = null, rightNode = null;
do {
Node t = h;
Node tNext = t.Next;
do {
if (!tNext.Marked) {
left = t;
leftNodeNext = tNext;
}
t = tNext.Marked ? tNext.Next : tNext;
if (t == tail)
break;
tNext = t.Next;
} while (tNext.Marked || t.Key < key || (tNext.Key == key && !comparer.Equals (subKey, t.SubKey)));
rightNode = t;
if (leftNodeNext == rightNode) {
if (rightNode != tail && rightNode.Next.Marked)
continue;
else
return rightNode;
}
if (Interlocked.CompareExchange (ref left.Next, rightNode, leftNodeNext) == leftNodeNext) {
if (rightNode != tail && rightNode.Next.Marked)
continue;
else
return rightNode;
}
} while (true);
}
bool ListDelete (Node startPoint, ulong key, TKey subKey, out T data)
{
Node rightNode = null, rightNodeNext = null, leftNode = null;
data = default (T);
Node markedNode = null;
do {
rightNode = ListSearch (key, subKey, ref leftNode, startPoint);
if (rightNode == tail || rightNode.Key != key || !comparer.Equals (subKey, rightNode.SubKey))
return false;
data = rightNode.Data;
rightNodeNext = rightNode.Next;
if (!rightNodeNext.Marked) {
if (markedNode == null)
markedNode = new Node ();
markedNode.Init (rightNodeNext);
if (Interlocked.CompareExchange (ref rightNode.Next, markedNode, rightNodeNext) == rightNodeNext)
break;
}
} while (true);
if (Interlocked.CompareExchange (ref leftNode.Next, rightNodeNext, rightNode) != rightNode)
ListSearch (rightNode.Key, subKey, ref leftNode, startPoint);
return true;
}
bool ListInsert (Node newNode, Node startPoint, out Node current, Func<T> dataCreator)
{
ulong key = newNode.Key;
Node rightNode = null, leftNode = null;
do {
rightNode = current = ListSearch (key, newNode.SubKey, ref leftNode, startPoint);
if (rightNode != tail && rightNode.Key == key && comparer.Equals (newNode.SubKey, rightNode.SubKey))
return false;
newNode.Next = rightNode;
if (dataCreator != null)
newNode.Data = dataCreator ();
if (Interlocked.CompareExchange (ref leftNode.Next, newNode, rightNode) == rightNode)
return true;
} while (true);
}
bool ListFind (ulong key, TKey subKey, Node startPoint, out Node data)
{
Node rightNode = null, leftNode = null;
data = null;
rightNode = ListSearch (key, subKey, ref leftNode, startPoint);
data = rightNode;
return rightNode != tail && rightNode.Key == key && comparer.Equals (subKey, rightNode.SubKey);
}
static readonly byte[] reverseTable = {
0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254, 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241, 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249, 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245, 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253, 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243, 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251, 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247, 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255
};
static readonly byte[] logTable = {
0xFF, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
};
struct SimpleRwLock
{
const int RwWait = 1;
const int RwWrite = 2;
const int RwRead = 4;
int rwlock;
public void EnterReadLock ()
{
SpinWait sw = new SpinWait ();
do {
while ((rwlock & (RwWrite | RwWait)) > 0)
sw.SpinOnce ();
if ((Interlocked.Add (ref rwlock, RwRead) & (RwWait | RwWait)) == 0)
return;
Interlocked.Add (ref rwlock, -RwRead);
} while (true);
}
public void ExitReadLock ()
{
Interlocked.Add (ref rwlock, -RwRead);
}
public void EnterWriteLock ()
{
SpinWait sw = new SpinWait ();
do {
int state = rwlock;
if (state < RwWrite) {
if (Interlocked.CompareExchange (ref rwlock, RwWrite, state) == state)
return;
state = rwlock;
}
// We register our interest in taking the Write lock (if upgradeable it's already done)
while ((state & RwWait) == 0 && Interlocked.CompareExchange (ref rwlock, state | RwWait, state) != state)
state = rwlock;
// Before falling to sleep
while (rwlock > RwWait)
sw.SpinOnce ();
} while (true);
}
public void ExitWriteLock ()
{
Interlocked.Add (ref rwlock, -RwWrite);
}
}
}
}

View File

@@ -56,11 +56,7 @@ namespace System.Web.Caching
remove { events.RemoveHandler (dependencyChangedEvent, value); }
}
#if NET_4_0
protected
#else
public
#endif
CacheDependency (): this (null, null, null, DateTime.Now)
{
}

View File

@@ -39,9 +39,7 @@ using System.Web.Util;
namespace System.Web.Caching
{
#if NET_4_0
[Serializable]
#endif
sealed class CachedVaryBy
{
string[] prms;

View File

@@ -50,20 +50,12 @@ namespace System.Web.Caching
Dictionary <string, string> keysCache;
Dictionary <string, string> entriesToInvalidate;
#if !NET_4_0
OutputCacheProvider provider;
internal OutputCacheProvider InternalProvider {
get { return provider; }
}
#endif
public OutputCacheModule ()
{
}
OutputCacheProvider FindCacheProvider (HttpApplication app)
{
#if NET_4_0
HttpContext ctx = HttpContext.Current;
if (app == null) {
app = ctx != null ? ctx.ApplicationInstance : null;
@@ -81,12 +73,6 @@ namespace System.Web.Caching
throw new ProviderException (String.Format ("OutputCacheProvider named '{0}' cannot be found.", providerName));
return ret;
#else
if (provider == null)
provider = new InMemoryOutputCacheProvider ();
return provider;
#endif
}
public void Dispose ()

View File

@@ -30,9 +30,7 @@ using System.Configuration.Provider;
namespace System.Web.Caching
{
#if NET_4_0
public
#endif
abstract class OutputCacheProvider : ProviderBase
{
protected OutputCacheProvider ()

View File

@@ -56,7 +56,6 @@ namespace System.Web.Caching
throw new ArgumentNullException ("tableName");
}
#if NET_4_0
[MonoTODO ("Needs more testing - especially the return value and database+table lookup.")]
public static CacheDependency CreateOutputCacheDependency (string dependency)
{
@@ -100,7 +99,6 @@ For SQL Server 7.0 and SQL Server 2000, the valid format is ""database:tablename
For dependencies that use SQL Server 9.0 notifications, specify the value 'CommandNotification'.", dependency);
}
#endif
protected override void DependencyDispose ()
{

View File

@@ -47,16 +47,8 @@ namespace System.Web.Compilation
{
class AppResourcesAssemblyBuilder
{
#if NET_4_5
static string framework_version = "4.5";
static string profile_path = "net_4_5";
#elif NET_4_0
static string framework_version = "4.0";
static string profile_path = "net_4_0";
#else
static string framework_version = "2.0";
static string profile_path = "net_2_0";
#endif
CompilationSection config;
CompilerInfo ci;
CodeDomProvider _provider;
@@ -266,11 +258,7 @@ namespace System.Web.Compilation
info.FileName = monoPath;
return alPath + " ";
} else {
#if NET_4_0
info.FileName = "al";
#else
info.FileName = "al2";
#endif
return String.Empty;
}
}

View File

@@ -945,9 +945,7 @@ namespace System.Web.Compilation
case TagType.DataBinding:
case TagType.CodeRenderExpression:
case TagType.CodeRender:
#if NET_4_0
case TagType.CodeRenderEncode:
#endif
if (isApplication)
throw new ParseException (location, "Invalid content for application file.");
@@ -1450,9 +1448,7 @@ namespace System.Web.Compilation
return CodeConstructType.ExpressionSnippet;
case TagType.CodeRender:
#if NET_4_0
case TagType.CodeRenderEncode:
#endif
return CodeConstructType.CodeSnippet;
case TagType.DataBinding:
@@ -1485,10 +1481,8 @@ namespace System.Web.Compilation
b = new CodeRenderBuilder (code, true, location);
else if (tagtype == TagType.DataBinding)
b = new DataBindingBuilder (code, location);
#if NET_4_0
else if (tagtype == TagType.CodeRenderEncode)
b = new CodeRenderBuilder (code, true, location, true);
#endif
else
throw new HttpException ("Should never happen");
@@ -1593,11 +1587,9 @@ namespace System.Web.Compilation
case TagType.CodeRenderExpression:
builder.AppendSubBuilder (new CodeRenderBuilder (tagid, true, location));
break;
#if NET_4_0
case TagType.CodeRenderEncode:
builder.AppendSubBuilder (new CodeRenderBuilder (tagid, true, location, true));
break;
#endif
case TagType.DataBinding:
builder.AppendSubBuilder (new DataBindingBuilder (tagid, location));
break;

View File

@@ -597,14 +597,10 @@ namespace System.Web.Compilation
tokenizer.ExpectAttrValue = old;
bool varname;
bool databinding;
#if NET_4_0
bool codeRenderEncode;
#endif
varname = Eat ('=');
databinding = !varname && Eat ('#');
#if NET_4_0
codeRenderEncode = !databinding && !varname && Eat (':');
#endif
string odds = tokenizer.Odds;
tokenizer.Verbatim = true;
@@ -624,10 +620,8 @@ namespace System.Web.Compilation
tagtype = TagType.DataBinding;
else if (varname)
tagtype = TagType.CodeRenderExpression;
#if NET_4_0
else if (codeRenderEncode)
tagtype = TagType.CodeRenderEncode;
#endif
else
tagtype = TagType.CodeRender;
}

View File

@@ -47,9 +47,7 @@ using System.Web.Caching;
using System.Web.Configuration;
using System.Web.Hosting;
using System.Web.Util;
#if NET_4_0
using System.Runtime.Versioning;
#endif
namespace System.Web.Compilation
{
@@ -81,13 +79,11 @@ namespace System.Web.Compilation
static int buildCount;
static bool is_precompiled;
static bool allowReferencedAssembliesCaching;
#if NET_4_0
static List <Assembly> dynamicallyRegisteredAssemblies;
static bool? batchCompilationEnabled;
static FrameworkName targetFramework;
static bool preStartMethodsDone;
static bool preStartMethodsRunning;
#endif
//static bool updatable; unused
static Dictionary<string, PreCompilationData> precompiled;
@@ -112,7 +108,6 @@ namespace System.Web.Compilation
remove { events.RemoveHandler (buildManagerRemoveEntryEvent, value); }
}
#if NET_4_0
internal static bool CompilingTopLevelAssemblies {
get; set;
}
@@ -149,13 +144,10 @@ namespace System.Web.Compilation
return targetFramework;
}
}
#endif
internal static bool BatchMode {
get {
#if NET_4_0
if (batchCompilationEnabled != null)
return (bool)batchCompilationEnabled;
#endif
if (!hosted)
return false; // Fix for bug #380985
@@ -198,13 +190,11 @@ namespace System.Web.Compilation
if (is_precompiled)
is_precompiled = LoadPrecompilationInfo (precomp_name);
}
#if NET_4_0
internal static void AssertPreStartMethodsRunning ()
{
if (!BuildManager.PreStartMethodsRunning)
throw new InvalidOperationException ("This method must be called during the application's pre-start initialization stage.");
}
#endif
// Deal with precompiled sites deployed in a different virtual path
static void FixVirtualPaths ()
{
@@ -535,7 +525,6 @@ namespace System.Web.Compilation
codeDomProviders.Add (type, ret);
return ret;
}
#if NET_4_0
internal static void CallPreStartMethods ()
{
if (preStartMethodsDone)
@@ -698,7 +687,6 @@ namespace System.Web.Compilation
return new SimpleWebObjectFactory (type);
}
#endif
public static object CreateInstanceFromVirtualPath (string virtualPath, Type requiredBaseType)
{
return CreateInstanceFromVirtualPath (GetAbsoluteVirtualPath (virtualPath), requiredBaseType);
@@ -887,13 +875,11 @@ namespace System.Web.Compilation
{
return null; // null is ok here until we store the dependency set in the Cache.
}
#if NET_4_0
[MonoTODO ("Not implemented, always returns null")]
public static BuildDependencySet GetCachedBuildDependencySet (HttpContext context, string virtualPath, bool ensureIsUpToDate)
{
return null; // null is ok here until we store the dependency set in the Cache.
}
#endif
static BuildManagerCacheItem GetCachedItem (string vp)
{
try {
@@ -1104,11 +1090,9 @@ namespace System.Web.Compilation
foreach (string assLocation in WebConfigurationManager.ExtraAssemblies)
LoadAssembly (assLocation, configReferencedAssemblies);
#if NET_4_0
if (dynamicallyRegisteredAssemblies != null)
foreach (Assembly registeredAssembly in dynamicallyRegisteredAssemblies)
configReferencedAssemblies.Add (registeredAssembly);
#endif
// Precompiled sites unconditionally load all assemblies from bin/ (fix for
// bug #502016)
if (is_precompiled || addAssembliesInBin) {

View File

@@ -45,9 +45,7 @@ namespace System.Web.Compilation
{
public abstract class BuildProvider
{
#if NET_4_0
static Dictionary <string, Type> registeredBuildProviderTypes;
#endif
ArrayList ref_assemblies;
ICollection vpath_deps;
@@ -136,7 +134,6 @@ namespace System.Web.Compilation
// MS also throws a NullReferenceException here when not hosted.
return VirtualPathProvider.OpenFile (virtualPath);
}
#if NET_4_0
public static void RegisterBuildProvider (string extension, Type providerType)
{
if (String.IsNullOrEmpty (extension))
@@ -181,7 +178,6 @@ namespace System.Web.Compilation
return Activator.CreateInstance (type, null) as global::System.Web.Compilation.BuildProvider;
}
#endif
public virtual CompilerType CodeCompilerType {
get { return null; } // Documented to return null
}

View File

@@ -344,14 +344,12 @@ namespace System.Web.Compilation
CodeMethodInvokeExpression expr = new CodeMethodInvokeExpression (thisRef, "InitializeCulture");
method.Statements.Add (AddLinePragma (new CodeExpressionStatement (expr), directiveLocation));
}
#if NET_4_0
protected override void AddStatementsToInitMethodBottom (ControlBuilder builder, CodeMemberMethod method)
{
ILocation directiveLocation = pageParser.DirectiveLocation;
AssignPropertyWithExpression <string> (method, "MetaDescription", pageParser.MetaDescription, directiveLocation);
AssignPropertyWithExpression <string> (method, "MetaKeywords", pageParser.MetaKeywords, directiveLocation);
}
#endif
protected override void PrependStatementsToFrameworkInitialize (CodeMemberMethod method)
{
base.PrependStatementsToFrameworkInitialize (method);

Some files were not shown because too many files have changed in this diff Show More