Merge pull request #1218 from AndreyAkinshin/master
[mono.git] / mcs / class / System.Web.Extensions / System.Web.Handlers / ScriptResourceHandler.cs
index 76a66935d405ab7588548110b7fbf8743be1ef92..721efc8657eb3d8303b0363a37de9937790a3239 100644 (file)
@@ -62,7 +62,6 @@ namespace System.Web.Handlers
                }\r
 \r
                #endregion\r
-#if NET_3_5\r
                void AppendResourceScriptContents (StringWriter sw, CompositeEntry entry)\r
                {\r
                        if (entry.Assembly == null || entry.Attribute == null || String.IsNullOrEmpty (entry.NameOrPath))\r
@@ -136,17 +135,16 @@ namespace System.Web.Handlers
 \r
                        long atime;\r
                        DateTime modifiedSince;\r
-                       bool hasCacheControl = HasCacheControl (request, request.QueryString, out atime);\r
                        bool hasIfModifiedSince = HasIfModifiedSince (context.Request, out modifiedSince);\r
                        \r
-                       if (hasCacheControl || hasIfModifiedSince) {\r
+                       if (hasIfModifiedSince) {\r
                                bool notModified = true;\r
                        \r
                                foreach (CompositeEntry entry in entries) {\r
                                        if (entry == null)\r
                                                continue;\r
                                        if (notModified) {\r
-                                               if ((hasCacheControl && entry.IsModifiedSince (atime)) || (hasIfModifiedSince && entry.IsModifiedSince (modifiedSince)))\r
+                                               if (hasIfModifiedSince && entry.IsModifiedSince (modifiedSince))\r
                                                        notModified = false;\r
                                        }\r
                                }\r
@@ -180,7 +178,6 @@ namespace System.Web.Handlers
                        if (notifyScriptLoaded)\r
                                OutputScriptLoadedNotification (response.Output);\r
                }\r
-#endif\r
                void OutputScriptLoadedNotification (TextWriter writer)\r
                {\r
                        writer.WriteLine ();\r
@@ -191,13 +188,11 @@ namespace System.Web.Handlers
                {\r
                        HttpRequest request = context.Request;\r
                        bool notifyScriptLoaded = request.QueryString ["n"] == "t";\r
-#if NET_3_5\r
                        List <CompositeEntry> compositeEntries = CompositeScriptReference.GetCompositeScriptEntries (request.RawUrl);\r
                        if (compositeEntries != null) {\r
                                SendCompositeScript (context, request, notifyScriptLoaded, compositeEntries);\r
                                return;\r
                        }\r
-#endif\r
                        EmbeddedResource res;\r
                        Assembly assembly;                      \r
                        SendEmbeddedResource (context, out res, out assembly);\r
@@ -212,18 +207,12 @@ namespace System.Web.Handlers
                                                rset = new ResourceManager (scriptResourceName, assembly).GetResourceSet (Threading.Thread.CurrentThread.CurrentUICulture, true, true);\r
                                        }\r
                                        catch (MissingManifestResourceException) {\r
-#if TARGET_JVM // GetResourceSet does not throw  MissingManifestResourceException if ressource is not exists\r
-                                       }\r
-                                       if (rset == null) {\r
-#endif\r
                                                if (scriptResourceName.EndsWith (".resources", RuntimeHelpers.StringComparison)) {\r
                                                        scriptResourceName = scriptResourceName.Substring (0, scriptResourceName.Length - 10);\r
                                                        rset = new ResourceManager (scriptResourceName, assembly).GetResourceSet (Threading.Thread.CurrentThread.CurrentUICulture, true, true);\r
                                                }\r
-#if !TARGET_JVM\r
                                                else\r
                                                        throw;\r
-#endif\r
                                        }\r
                                        if (rset == null)\r
                                                break;\r
@@ -254,7 +243,6 @@ namespace System.Web.Handlers
                        if (notifyScriptLoaded)\r
                                OutputScriptLoadedNotification (writer);\r
                }\r
-#if NET_3_5\r
                static void CheckIfResourceIsCompositeScript (string resourceName, ref bool includeTimeStamp)\r
                {\r
                        bool isCompositeScript = resourceName.StartsWith (CompositeScriptReference.COMPOSITE_SCRIPT_REFERENCE_PREFIX, StringComparison.Ordinal);\r
@@ -268,7 +256,6 @@ namespace System.Web.Handlers
                {\r
                        return false;\r
                }\r
-#endif\r
                // TODO: add value cache?\r
                static string GetScriptStringLiteral (string value)\r
                {\r