Clean up System.Net.Http build a bit for browser (#38775)
authorMarek Safar <marek.safar@gmail.com>
Sat, 4 Jul 2020 07:49:23 +0000 (09:49 +0200)
committerGitHub <noreply@github.com>
Sat, 4 Jul 2020 07:49:23 +0000 (09:49 +0200)
src/libraries/System.Net.Http/src/System.Net.Http.csproj
src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/SystemProxyInfo.Browser.cs
src/libraries/System.Net.Http/src/System/Net/Http/ByteArrayContent.cs

index a5138aa..fee004f 100644 (file)
     <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs">
       <Link>Common\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs</Link>
     </Compile>
-  </ItemGroup>    
+  </ItemGroup>
   <!-- Linux specific files -->
   <ItemGroup Condition="'$(TargetsLinux)' == 'true' ">
     <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs"
     <Compile Include="$(CommonPath)System\Net\Security\CertificateValidation.Unix.cs"
              Link="Common\System\Net\Security\CertificateValidation.Unix.cs" />
   </ItemGroup>
+  <ItemGroup Condition=" '$(TargetsBrowser)' == 'true'">
+    <Compile Include="$(CommonPath)\System\StringExtensions.cs"
+             Link="Common\System\StringExtensions.cs" />
+    <Compile Include="$(CommonPath)\System\Net\HttpStatusDescription.cs"
+             Link="Common\System\Net\HttpStatusDescription.cs" />
+    <Compile Include="$(CommonPath)System\Text\ValueStringBuilder.cs"
+             Link="Common\System\Text\ValueStringBuilder.cs" />
+    <Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
+             Link="System\System\Threading\Tasks\TaskToApm.cs" />
+    <Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
+    <Compile Include="System\Net\Http\BrowserHttpHandler\SystemProxyInfo.Browser.cs" />
+    <Compile Include="System\Net\Http\BrowserHttpHandler\SocketsHttpHandler.cs" />
+    <Compile Include="System\Net\Http\BrowserHttpHandler\BrowserHttpHandler.cs" />
+  </ItemGroup>
   <ItemGroup>
     <Reference Include="Microsoft.Win32.Primitives" />
     <Reference Include="System.Collections" />
   <ItemGroup>
     <None Include="Resources\SR.resx" />
   </ItemGroup>
-  <!-- Browser specific implementation -->
-  <ItemGroup Condition=" '$(TargetsBrowser)' == 'true'">
-    <Compile Include="$(CommonPath)\System\CharArrayHelpers.cs"
-             Link="Common\System\CharArrayHelpers.cs" />
-    <Compile Include="$(CommonPath)\System\StringExtensions.cs"
-             Link="Common\System\StringExtensions.cs" />
-    <Compile Include="$(CommonPath)\System\Net\HttpKnownHeaderNames.cs"
-             Link="Common\System\Net\HttpKnownHeaderNames.cs" />
-    <Compile Include="$(CommonPath)\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs"
-             Link="Common\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs" />
-    <Compile Include="$(CommonPath)\System\Net\HttpStatusDescription.cs"
-             Link="Common\System\Net\HttpStatusDescription.cs" />
-    <Compile Include="$(CommonPath)\System\Net\SecurityProtocol.cs"
-             Link="Common\System\Net\SecurityProtocol.cs" />
-    <Compile Include="$(CommonPath)\System\Net\UriScheme.cs"
-             Link="Common\System\Net\UriScheme.cs" />
-    <Compile Include="$(CommonPath)\System\Net\Http\HttpHandlerDefaults.cs"
-             Link="Common\System\Net\Http\HttpHandlerDefaults.cs" />
-    <Compile Include="$(CommonPath)System\Text\ValueStringBuilder.cs"
-             Link="Common\System\Text\ValueStringBuilder.cs" />
-    <Compile Include="$(CommonPath)\System\Net\Security\CertificateHelper.cs"
-             Link="Common\System\Net\Security\CertificateHelper.cs" />
-    <Compile Include="$(CommonPath)\System\Net\Security\CertificateHelper.Unix.cs"
-             Link="Common\System\Net\Security\CertificateHelper.Unix.cs" />
-    <Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
-             Link="System\System\Threading\Tasks\TaskToApm.cs" />
-    <Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
-    <Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.cs" />
-    <Compile Include="System\Net\Http\BrowserHttpHandler\SystemProxyInfo.Browser.cs" />
-    <Compile Include="System\Net\Http\BrowserHttpHandler\SocketsHttpHandler.cs" />
-    <Compile Include="System\Net\Http\BrowserHttpHandler\BrowserHttpHandler.cs" />
-  </ItemGroup>
   <ItemGroup Condition=" '$(TargetsBrowser)' == 'true'">
     <ProjectReference Include="..\..\System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj" />
-  </ItemGroup>  
+  </ItemGroup>
 </Project>
index 24fffcd..1f7ee2d 100644 (file)
@@ -6,10 +6,6 @@ namespace System.Net.Http
 {
     internal static partial class SystemProxyInfo
     {
-        // On Browser we do not support proxy.
-        public static IWebProxy ConstructSystemProxy()
-        {
-            return new HttpNoProxy();
-        }
+        public static IWebProxy Proxy => new HttpNoProxy();
     }
 }
index c1c7f59..0aa38ab 100644 (file)
@@ -23,7 +23,6 @@ namespace System.Net.Http
             }
 
             _content = content;
-            _offset = 0;
             _count = content.Length;
         }