瀏覽代碼

refactoring

svn path=/trunk/mcs/; revision=93658
Igor Zelmanovich 18 年之前
父節點
當前提交
de966a4039

+ 10 - 0
mcs/class/System.Web/System.Web.Phantom/Stubs.cs

@@ -35,3 +35,13 @@ namespace System.Web.J2EE
 		}
 	}
 }
+
+namespace System.Web
+{
+
+	public static class FlagEnd
+	{
+		public static readonly object Value = new object ();
+	}
+
+}

+ 1 - 1
mcs/class/System.Web/System.Web.UI/Page.cs

@@ -1272,7 +1272,7 @@ public partial class Page : TemplateControl, IHttpHandler
 			HandleException (ex);
 #else
 		} catch (ThreadAbortException taex) {
-			if (context.Response.FlagEnd == taex.ExceptionState)
+			if (FlagEnd.Value == taex.ExceptionState)
 				Thread.ResetAbort ();
 			else
 				throw;

+ 1 - 1
mcs/class/System.Web/System.Web.UI/Page.jvm.cs

@@ -318,7 +318,7 @@ namespace System.Web.UI
 		void HandleException (Exception ex) {
 			try {
 				if (ex is ThreadAbortException) {
-					if (_context.Response.FlagEnd == ((ThreadAbortException) ex).ExceptionState) {
+					if (FlagEnd.Value == ((ThreadAbortException) ex).ExceptionState) {
 						Thread.ResetAbort ();
 						return;
 					}

+ 2 - 2
mcs/class/System.Web/System.Web/HttpApplication.cs

@@ -666,7 +666,7 @@ namespace System.Web {
 						Error (this, EventArgs.Empty);
 					} catch (ThreadAbortException taex){
 						context.ClearError ();
-						if (context.Response.FlagEnd == taex.ExceptionState)
+						if (FlagEnd.Value == taex.ExceptionState)
 							// This happens on Redirect() or End()
 							Thread.ResetAbort ();
 						else
@@ -706,7 +706,7 @@ namespace System.Web {
 					ProcessError (new HttpException ("The request timed out."));
 				else {
 					context.ClearError ();
-					if (context.Response.FlagEnd != obj)
+					if (FlagEnd.Value != obj)
 						context.AddError (taex);
 				}
 

+ 9 - 6
mcs/class/System.Web/System.Web/HttpResponse.cs

@@ -95,11 +95,6 @@ namespace System.Web {
 		//
 		string app_path_mod;
 		
-		//
-		// Passed as flags
-		//
-		internal object FlagEnd = new object ();
-
 #if NET_2_0
 		bool is_request_being_redirected;
 		Encoding headerEncoding;
@@ -586,7 +581,7 @@ namespace System.Web {
 				return;
 			
 			if (context.TimeoutPossible) {
-				Thread.CurrentThread.Abort (FlagEnd);
+				Thread.CurrentThread.Abort (FlagEnd.Value);
 			} else {
 				// If this is called from an async event, signal the completion
 				// but don't throw.
@@ -1058,5 +1053,13 @@ namespace System.Web {
 			output_stream = null;
 		}
 	}
+
+#if TARGET_J2EE
+	public 
+#endif	
+	static class FlagEnd
+	{
+		public static readonly object Value = new object ();
+	}
 }