Imported Upstream version 4.2.0.179

Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent 183bba2c9a
commit 6992685b86
7507 changed files with 90259 additions and 657307 deletions

View File

@@ -226,42 +226,32 @@ TEST_RESOURCE_FILES = \
Test/mainsoft/NunitWebResources/HtmlTitleCodeRender_Bug662918.aspx
RESX_DIST = resources/TranslationResources.resx
ifneq (1, $(FRAMEWORK_VERSION_MAJOR))
RESX_RES = $(RESX_DIST:.resx=.resources)
endif
NUNIT_RESOURCE_FILES = $(TEST_RESOURCE_FILES)
NUNIT_APP_CODE_FILES = $(TEST_APP_CODE_FILES)
NUNIT_APP_GLOBALRESOURCES_FILES = $(TEST_APP_GLOBALRESOURCES_FILES)
ifneq (1, $(FRAMEWORK_VERSION_MAJOR))
OTHER_RES += $(RESOURCE_FILES_2)
OTHER_LIB_MCS_FLAGS = -d:INSIDE_SYSTEM_WEB -nowarn:618 -r:System.Configuration.dll -r:Mono.Data.Sqlite.dll
endif
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
OTHER_LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
OTHER_RES += $(RESOURCE_FILES_4)
endif
LIB_REFS = System System.Core System.Drawing System.Data System.Xml System.EnterpriseServices System.Runtime.Serialization.Formatters.Soap System.ComponentModel.DataAnnotations
LIB_MCS_FLAGS = \
-unsafe \
-nowarn:612,618 \
-r:$(corlib) \
-r:System.dll \
-r:System.Core.dll \
-r:System.Drawing.dll \
-r:System.Data.dll \
-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:%)
ifneq (plainweb/,$(intermediate))
LIB_MCS_FLAGS += -define:WEBSERVICES_DEP -r:System.Web.Services.dll
LIB_REFS += System.Web.Services System.Design
LIB_MCS_FLAGS += -define:WEBSERVICES_DEP -lib:$(the_libdir_base)plaindesign
all-local: System.Web/UplevelHelper.cs resources/TranslationResources.resources

View File

@@ -63,6 +63,7 @@ namespace System.Web.Configuration
static ConfigurationProperty encoderTypeProp;
static ConfigurationProperty relaxedUrlToFileSystemMappingProp;
static ConfigurationProperty targetFrameworkProp;
static ConfigurationProperty allowDynamicModuleRegistrationProp;
static ConfigurationPropertyCollection properties;
static HttpRuntimeSection ()
@@ -141,6 +142,8 @@ namespace System.Web.Configuration
PropertyHelper.VersionConverter,
PropertyHelper.DefaultValidator,
ConfigurationPropertyOptions.None);
allowDynamicModuleRegistrationProp = new ConfigurationProperty ("allowDynamicModuleRegistration", typeof(bool), true,
ConfigurationPropertyOptions.None);
properties = new ConfigurationPropertyCollection();
properties.Add (apartmentThreadingProp);
@@ -169,6 +172,7 @@ namespace System.Web.Configuration
properties.Add (encoderTypeProp);
properties.Add (relaxedUrlToFileSystemMappingProp);
properties.Add (targetFrameworkProp);
properties.Add (allowDynamicModuleRegistrationProp);
}
public HttpRuntimeSection()
@@ -349,6 +353,11 @@ namespace System.Web.Configuration
protected internal override ConfigurationPropertyCollection Properties {
get { return properties; }
}
[ConfigurationProperty ("allowDynamicModuleRegistration", DefaultValue = "True")]
public bool AllowDynamicModuleRegistration {
get { return (bool) base [allowDynamicModuleRegistrationProp]; }
set { base [allowDynamicModuleRegistrationProp] = value; }
}
}
}

View File

@@ -104,6 +104,13 @@ namespace System.Web.Hosting {
get { return vpath_provider; }
}
public static bool InClientBuildManager {
get {
// Mono doesn't have a ClientBuildManager, so we can't be in it. Simple as that.
return false;
}
}
public static void DecrementBusyCount ()
{
Interlocked.Decrement (ref busy_count);

View File

@@ -2,19 +2,20 @@ Assembly/AssemblyInfo.cs
../../build/common/Consts.cs
../../build/common/Locale.cs
../../build/common/MonoTODOAttribute.cs
../Managed.Windows.Forms/System.Resources/ByteArrayFromResXHandler.cs
../Managed.Windows.Forms/System.Resources/ResXNullRef.cs
../Managed.Windows.Forms/System.Resources/ResXResourceReader.cs
../Managed.Windows.Forms/System.Resources/FileRefHandler.cs
../Managed.Windows.Forms/System.Resources/NullRefHandler.cs
../Managed.Windows.Forms/System.Resources/ResXResourceSet.cs
../Managed.Windows.Forms/System.Resources/InMemoryHandler.cs
../Managed.Windows.Forms/System.Resources/ResXResourceWriter.cs
../Managed.Windows.Forms/System.Resources/ResXDataNode.cs
../Managed.Windows.Forms/System.Resources/SerializedFromResXHandler.cs
../Managed.Windows.Forms/System.Resources/ResXDataNodeHandler.cs
../Managed.Windows.Forms/System.Resources/TypeConverterFromResXHandler.cs
../Managed.Windows.Forms/System.Resources/ResXFileRef.cs
../System.Windows.Forms/System.Resources/AssemblyNamesTypeResolutionService.cs
../System.Windows.Forms/System.Resources/ByteArrayFromResXHandler.cs
../System.Windows.Forms/System.Resources/ResXNullRef.cs
../System.Windows.Forms/System.Resources/ResXResourceReader.cs
../System.Windows.Forms/System.Resources/FileRefHandler.cs
../System.Windows.Forms/System.Resources/NullRefHandler.cs
../System.Windows.Forms/System.Resources/ResXResourceSet.cs
../System.Windows.Forms/System.Resources/InMemoryHandler.cs
../System.Windows.Forms/System.Resources/ResXResourceWriter.cs
../System.Windows.Forms/System.Resources/ResXDataNode.cs
../System.Windows.Forms/System.Resources/SerializedFromResXHandler.cs
../System.Windows.Forms/System.Resources/ResXDataNodeHandler.cs
../System.Windows.Forms/System.Resources/TypeConverterFromResXHandler.cs
../System.Windows.Forms/System.Resources/ResXFileRef.cs
Mono.Web.Util/ISectionSettingsMapper.cs
Mono.Web.Util/MembershipSectionMapper.cs

View File

@@ -0,0 +1,57 @@
//
// DynamicModuleManager.cs: Manager for dynamic Http Modules.
//
// Author:
// Matthias Bogad (bogad@cs.tum.edu)
//
// (C) 2015
//
using System;
using System.Collections.Generic;
namespace System.Web {
sealed class DynamicModuleManager {
const string moduleNameFormat = "__Module__{0}_{1}";
readonly List<DynamicModuleInfo> entries = new List<DynamicModuleInfo> ();
bool entriesAreReadOnly = false;
readonly object mutex = new object ();
public void Add (Type moduleType)
{
if (moduleType == null)
throw new ArgumentException ("moduleType");
if (!typeof (IHttpModule).IsAssignableFrom (moduleType))
throw new ArgumentException ("Given object does not implement IHttpModule.", "moduleType");
lock (mutex) {
if (entriesAreReadOnly)
throw new InvalidOperationException ("A module was to be added to the dynamic module list, but the list was already initialized. The dynamic module list can only be initialized once.");
entries.Add (new DynamicModuleInfo (moduleType,
string.Format (moduleNameFormat, moduleType.AssemblyQualifiedName, Guid.NewGuid ())));
}
}
public ICollection<DynamicModuleInfo> LockAndGetModules ()
{
lock (mutex) {
entriesAreReadOnly = true;
return entries;
}
}
}
struct DynamicModuleInfo {
public readonly string Name;
public readonly Type Type;
public DynamicModuleInfo (Type type, string name)
{
Name = name;
Type = type;
}
}
}

View File

@@ -4,7 +4,8 @@
// Author:
// Miguel de Icaza (miguel@novell.com)
// Gonzalo Paniagua (gonzalo@ximian.com)
//
// Matthias Bogad (bogad@cs.tum.edu)
//
//
// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
//
@@ -62,8 +63,10 @@
// Events Disposed
//
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Diagnostics;
@@ -162,6 +165,8 @@ namespace System.Web
bool removeConfigurationFromCache;
bool fullInitComplete = false;
static DynamicModuleManager dynamicModuleManeger = new DynamicModuleManager ();
//
// These are used to detect the case where the EndXXX method is invoked
// from within the BeginXXXX delegate, so we detect whether we kick the
@@ -209,6 +214,13 @@ namespace System.Web
if (context == null)
context = HttpContext.Current;
HttpModuleCollection coll = modules.LoadModules (this);
HttpModuleCollection dynMods = CreateDynamicModules ();
for (int i = 0; i < dynMods.Count; i++) {
coll.AddModule (dynMods.GetKey (i), dynMods.Get (i));
}
Interlocked.CompareExchange (ref modcoll, coll, null);
HttpContext.Current = saved;
@@ -404,7 +416,7 @@ namespace System.Web
public void AddOnAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
AcquireRequestState += new EventHandler (invoker.Invoke);
}
@@ -417,7 +429,7 @@ namespace System.Web
public void AddOnAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
AuthenticateRequest += new EventHandler (invoker.Invoke);
}
@@ -430,7 +442,7 @@ namespace System.Web
public void AddOnAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
AuthorizeRequest += new EventHandler (invoker.Invoke);
}
@@ -452,7 +464,7 @@ namespace System.Web
public void AddOnBeginRequestAsync (BeginEventHandler bh, EndEventHandler eh)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
BeginRequest += new EventHandler (invoker.Invoke);
}
@@ -474,7 +486,7 @@ namespace System.Web
public void AddOnEndRequestAsync (BeginEventHandler bh, EndEventHandler eh)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
EndRequest += new EventHandler (invoker.Invoke);
}
@@ -487,7 +499,7 @@ namespace System.Web
public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
PostRequestHandlerExecute += new EventHandler (invoker.Invoke);
}
@@ -500,7 +512,7 @@ namespace System.Web
public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
PreRequestHandlerExecute += new EventHandler (invoker.Invoke);
}
@@ -513,7 +525,7 @@ namespace System.Web
public void AddOnReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
ReleaseRequestState += new EventHandler (invoker.Invoke);
}
@@ -526,7 +538,7 @@ namespace System.Web
public void AddOnResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
ResolveRequestCache += new EventHandler (invoker.Invoke);
}
@@ -539,7 +551,7 @@ namespace System.Web
public void AddOnUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
UpdateRequestCache += new EventHandler (invoker.Invoke);
}
@@ -557,7 +569,7 @@ namespace System.Web
public void AddOnPostAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostAuthenticateRequest += new EventHandler (invoker.Invoke);
}
@@ -575,7 +587,7 @@ namespace System.Web
public void AddOnPostAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostAuthorizeRequest += new EventHandler (invoker.Invoke);
}
@@ -593,7 +605,7 @@ namespace System.Web
public void AddOnPostResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostResolveRequestCache += new EventHandler (invoker.Invoke);
}
@@ -611,7 +623,7 @@ namespace System.Web
public void AddOnPostMapRequestHandlerAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostMapRequestHandler += new EventHandler (invoker.Invoke);
}
@@ -629,7 +641,7 @@ namespace System.Web
public void AddOnPostAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostAcquireRequestState += new EventHandler (invoker.Invoke);
}
@@ -647,7 +659,7 @@ namespace System.Web
public void AddOnPostReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostReleaseRequestState += new EventHandler (invoker.Invoke);
}
@@ -665,7 +677,7 @@ namespace System.Web
public void AddOnPostUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostUpdateRequestCache += new EventHandler (invoker.Invoke);
}
@@ -674,61 +686,61 @@ namespace System.Web
//
public void AddOnAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
AcquireRequestState += new EventHandler (invoker.Invoke);
}
public void AddOnAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
AuthenticateRequest += new EventHandler (invoker.Invoke);
}
public void AddOnAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
AuthorizeRequest += new EventHandler (invoker.Invoke);
}
public void AddOnBeginRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
BeginRequest += new EventHandler (invoker.Invoke);
}
public void AddOnEndRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
EndRequest += new EventHandler (invoker.Invoke);
}
public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostRequestHandlerExecute += new EventHandler (invoker.Invoke);
}
public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PreRequestHandlerExecute += new EventHandler (invoker.Invoke);
}
public void AddOnReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
ReleaseRequestState += new EventHandler (invoker.Invoke);
}
public void AddOnResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
ResolveRequestCache += new EventHandler (invoker.Invoke);
}
public void AddOnUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
UpdateRequestCache += new EventHandler (invoker.Invoke);
}
@@ -749,7 +761,7 @@ namespace System.Web
public void AddOnLogRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state)
{
AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, state);
AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state);
LogRequest += new EventHandler (invoker.Invoke);
}
@@ -767,7 +779,7 @@ namespace System.Web
public void AddOnMapRequestHandlerAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state)
{
AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, state);
AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state);
MapRequestHandler += new EventHandler (invoker.Invoke);
}
@@ -785,7 +797,7 @@ namespace System.Web
public void AddOnPostLogRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state)
{
AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, state);
AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state);
PostLogRequest += new EventHandler (invoker.Invoke);
}
@@ -871,7 +883,7 @@ namespace System.Web
//
// If we catch an error, queue this error
//
void ProcessError (Exception e)
internal void ProcessError (Exception e)
{
bool first = context.Error == null;
context.AddError (e);
@@ -1643,7 +1655,39 @@ namespace System.Web
return true;
}
}
public static void RegisterModule (Type moduleType)
{
HttpRuntimeSection config = (HttpRuntimeSection)WebConfigurationManager.GetSection ("system.web/httpRuntime");
if (!config.AllowDynamicModuleRegistration)
throw new InvalidOperationException ("The Application has requested to register a dynamic Module, but dynamic module registration is disabled in web.config.");
dynamicModuleManeger.Add (moduleType);
}
HttpModuleCollection CreateDynamicModules ()
{
HttpModuleCollection modules = new HttpModuleCollection ();
foreach (var module in dynamicModuleManeger.LockAndGetModules ()) {
IHttpModule httpModule = CreateModuleInstance (module.Type);
httpModule.Init (this);
modules.AddModule (module.Name, httpModule);
}
return modules;
}
IHttpModule CreateModuleInstance (Type type)
{
return (IHttpModule) Activator.CreateInstance (type,
BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.CreateInstance,
null,
null,
null);
}
#region internals
internal void ClearError ()
{
@@ -1891,24 +1935,40 @@ namespace System.Web
public BeginEventHandler begin;
public EndEventHandler end;
public object data;
HttpApplication app;
AsyncCallback callback;
public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh, object d)
public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh, HttpApplication a, object d)
{
begin = bh;
end = eh;
data = d;
app = a;
callback = new AsyncCallback (doAsyncCallback);
}
public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh)
{
begin = bh;
end = eh;
}
public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh, HttpApplication app) : this(bh, eh, app, null) { }
public void Invoke (object sender, EventArgs e)
{
throw new Exception ("This is just a dummy");
IAsyncResult res;
res = begin (app, e, callback, data);
}
void doAsyncCallback (IAsyncResult res)
{
ThreadPool.QueueUserWorkItem ((object ores) => {
IAsyncResult tres = (IAsyncResult) ores;
try {
end (tres);
} catch (Exception ee) {
// I tried using ProcessError(), but we only come here frome an Invokation in PipelineDone().
// Using ProcessError, I still get a blank screen, this way, we at least log the error to console...
Console.Error.WriteLine (ee.ToString ());
}
}, res);
}
}
#endregion
}

File diff suppressed because one or more lines are too long

View File

@@ -66,4 +66,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View File

@@ -45,8 +45,6 @@ System.Web.Util/SimpleWebObjectFactory.cs
System.Web.Util/RequestValidationSource.cs
System.Web.Util/RequestValidator.cs
../System.Design/System.Data.Design/TypedDataSetGenerator.cs
../System.Web.Routing/System.Web.Routing/HttpMethodConstraint.cs
../System.Web.Routing/System.Web.Routing/IRouteConstraint.cs
../System.Web.Routing/System.Web.Routing/IRouteHandler.cs

View File

@@ -10,3 +10,4 @@ System.Web/UnvalidatedRequestValuesWrapper.cs
System.Web/TaskAsyncResult.cs
System.Web/TaskEventHandler.cs
System.Web.Security/MembershipPasswordAttribute.cs
System.Web/DynamicModuleManager.cs