You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2017/04/16 05:53:23 UTC

[01/12] git commit: [flex-asjs] [refs/heads/develop] - use header constants

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 159abcc9c -> 9e4b62d43


use header constants


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/318bdf2a
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/318bdf2a
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/318bdf2a

Branch: refs/heads/develop
Commit: 318bdf2a8cb4e0527fe9a2150b56e44a0be8cf1a
Parents: 159abcc
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 10:39:18 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 10:39:18 2017 +1000

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/net/BinaryUploader.as | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/318bdf2a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/BinaryUploader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/BinaryUploader.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/BinaryUploader.as
index 035f753..31854c4 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/BinaryUploader.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/BinaryUploader.as
@@ -589,8 +589,8 @@ package org.apache.flex.net
                 }
                 
                 if (binaryData) {
-                    element.setRequestHeader('Content-length', binaryData.length.toString());
-                    element.setRequestHeader('Connection', 'close');
+                    element.setRequestHeader(HTTPHeader.CONTENT_LENGTH, binaryData.length.toString());
+                    element.setRequestHeader(HTTPHeader.CONNECTION, 'close');
                     element.send(binaryData);
                 } else {
                     element.send();
@@ -641,9 +641,9 @@ package org.apache.flex.net
          *  @productversion FlexJS 0.0
          */        
         COMPILE::SWF
-        protected function completeHandler(event:flash.events.Event):void
-        {
-            dispatchEvent(new Event(event.type));
+        protected function completeHandler(event:flash.events.Event):void
+        {
+            dispatchEvent(new Event(event.type));
         }
         
         /**
@@ -655,10 +655,10 @@ package org.apache.flex.net
             var element:XMLHttpRequest = this.element as XMLHttpRequest;
             if (element.readyState === 2) {
                 _status = element.status;
-                dispatchEvent('httpResponseStatus');
-                dispatchEvent('httpStatus');
+                dispatchEvent(HTTPConstants.RESPONSE_STATUS);
+                dispatchEvent(HTTPConstants.STATUS);
             } else if (element.readyState === 4) {
-                dispatchEvent('complete');
+                dispatchEvent(HTTPConstants.COMPLETE);
             }
         }
         


[12/12] git commit: [flex-asjs] [refs/heads/develop] - Added bead to pass authorisation credentials on in JS HTTP requests

Posted by jm...@apache.org.
Added bead to pass authorisation credentials on in JS HTTP requests


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9e4b62d4
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9e4b62d4
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9e4b62d4

Branch: refs/heads/develop
Commit: 9e4b62d435e3f3166ce710e551c6e78100f88df6
Parents: 65320f9
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 15:41:15 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 15:41:15 2017 +1000

----------------------------------------------------------------------
 .../flex/net/beads/CORSCredentialsBead.as       | 79 ++++++++++++++++++++
 1 file changed, 79 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9e4b62d4/frameworks/projects/Network/src/main/flex/org/apache/flex/net/beads/CORSCredentialsBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/beads/CORSCredentialsBead.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/beads/CORSCredentialsBead.as
new file mode 100644
index 0000000..6a44c90
--- /dev/null
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/beads/CORSCredentialsBead.as
@@ -0,0 +1,79 @@
+package org.apache.flex.net.beads {
+import org.apache.flex.core.IBead;
+import org.apache.flex.core.IStrand;
+import org.apache.flex.events.Event;
+import org.apache.flex.events.IEventDispatcher;
+
+COMPILE::SWF
+public class CORSCredentialsBead {
+    public function CORSCredentialsBead(withCredentials:Boolean = false) {
+        trace("Only needed for JavaScript HTTP Server calls");
+    }
+}
+
+/**
+ *  Bead to allow passing on user authentication information in a XMLHttpRequest request.
+ *
+ *  If you don't use this bead any cross domain calls that require user authentication
+ *  (via say basic authentication or cookies) will fail.
+ *
+ *  @productversion FlexJS 0.8
+ */
+COMPILE::JS
+public class CORSCredentialsBead implements IBead {
+
+    public function CORSCredentialsBead(withCredentials:Boolean = false) {
+        this.withCredentials = withCredentials;
+    }
+
+    private var _strand:IStrand;
+
+    /**
+     *  Listen for a pre and post send event to modify if user credentials are passed.
+     *
+     *  @productversion FlexJS 0.8
+     */
+    public function set strand(value:IStrand):void {
+        _strand = value;
+
+        IEventDispatcher(_strand).addEventListener("preSend", preSendHandler);
+        IEventDispatcher(_strand).addEventListener("postSend", postSendHandler);
+    }
+
+    /**
+     *  Modify the HTTP request to pass credentials.
+     *
+     *  @productversion FlexJS 0.8
+     */
+    protected function preSendHandler(event:Event):void {
+        (event.target.element as XMLHttpRequest).withCredentials = withCredentials;
+    }
+
+    /**
+     *  Clean up event listeners.
+     *
+     *  @productversion FlexJS 0.8
+     */
+    protected function postSendHandler(event:Event):void {
+        IEventDispatcher(_strand).removeEventListener("preSend", preSendHandler);
+        IEventDispatcher(_strand).removeEventListener("postSend", preSendHandler);
+    }
+
+    private var _withCredentials:Boolean = false;
+
+    /**
+     *  Pass the user credentials or not.
+     *
+     *  @productversion FlexJS 0.8
+     */
+    public function get withCredentials():Boolean
+    {
+        return _withCredentials;
+    }
+
+    public function set withCredentials(value:Boolean):void
+    {
+        _withCredentials = value;
+    }
+}
+}


[04/12] git commit: [flex-asjs] [refs/heads/develop] - add some comment and missing semicolon

Posted by jm...@apache.org.
add some comment and missing semicolon


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/fe1ff661
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/fe1ff661
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/fe1ff661

Branch: refs/heads/develop
Commit: fe1ff661a4831ce0c00454fce9df478716b24f39
Parents: 242fb73
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 10:40:28 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 10:40:28 2017 +1000

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/net/HTTPUtils.as   | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fe1ff661/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPUtils.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPUtils.as
index fab6fdc..e38c566 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPUtils.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPUtils.as
@@ -20,9 +20,26 @@ package org.apache.flex.net
 {
     public class HTTPUtils
     {
+        /**
+         *  HTTP utility methods.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
         public function HTTPUtils()
         {
         }
+
+        /**
+         *  Encode URL variables.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
 		public static function encodeUrlVariables(data:Object):String
         {
             if(!data)
@@ -37,7 +54,7 @@ package org.apache.flex.net
                 b.push("&");
             }
             if(b.length)
-                b.pop()
+                b.pop();
             return b.join("");
         }
 		


[10/12] git commit: [flex-asjs] [refs/heads/develop] - add pre and post send events

Posted by jm...@apache.org.
add pre and post send events


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/25d67e11
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/25d67e11
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/25d67e11

Branch: refs/heads/develop
Commit: 25d67e117275f40e5844d2d039a775e2f3995cfc
Parents: 3fa62e7
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 13:22:08 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 13:22:08 2017 +1000

----------------------------------------------------------------------
 .../Network/src/main/flex/org/apache/flex/net/HTTPService.as   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/25d67e11/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
index fdb387f..ea3b7b3 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
@@ -536,7 +536,9 @@ package org.apache.flex.net
                 for each (var bead:IBead in beads)
                     addBead(bead);
             }
-            
+
+            dispatchEvent(new Event("preSend"));
+
             COMPILE::SWF
             {
                 if (!urlLoader)
@@ -631,6 +633,8 @@ package org.apache.flex.net
                 }
 
             }
+
+            dispatchEvent(new Event("postSend"));
         }
         
         /**


[11/12] flex-asjs git commit: doesn’t seem to work as JS only as get errors in compiling AS project

Posted by jm...@apache.org.
doesn\u2019t seem to work as JS only as get errors in compiling AS project


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/65320f94
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/65320f94
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/65320f94

Branch: refs/heads/develop
Commit: 65320f9470652c5ffe1ae71cc6c5524408642c52
Parents: 25d67e1
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 15:35:19 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 15:35:19 2017 +1000

----------------------------------------------------------------------
 frameworks/projects/Network/src/main/flex/NetworkClasses.as    | 6 +-----
 .../projects/Network/src/main/resources/basic-manifest.xml     | 1 +
 2 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65320f94/frameworks/projects/Network/src/main/flex/NetworkClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/NetworkClasses.as b/frameworks/projects/Network/src/main/flex/NetworkClasses.as
index e4cd570..ed88471 100644
--- a/frameworks/projects/Network/src/main/flex/NetworkClasses.as
+++ b/frameworks/projects/Network/src/main/flex/NetworkClasses.as
@@ -28,11 +28,7 @@ package
 internal class NetworkClasses
 {	
     import org.apache.flex.net.URLBinaryLoader; URLBinaryLoader;
-	import org.apache.flex.net.HTTPConstants; HTTPConstants;
-
-    COMPILE::JS {
-        import org.apache.flex.net.beads.CORSCredentialsBead; CORSCredentialsBead;
-    }
+    import org.apache.flex.net.HTTPConstants; HTTPConstants;
 }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65320f94/frameworks/projects/Network/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/resources/basic-manifest.xml b/frameworks/projects/Network/src/main/resources/basic-manifest.xml
index 235b09d..46f2ad9 100644
--- a/frameworks/projects/Network/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/Network/src/main/resources/basic-manifest.xml
@@ -23,5 +23,6 @@
 
     <component id="HTTPService" class="org.apache.flex.net.HTTPService"/>
     <component id="BinaryUploader" class="org.apache.flex.net.BinaryUploader"/>
+    <component id="CORSCredentialsBead" class="org.apache.flex.net.beads.CORSCredentialsBead"/>
 
 </componentPackage>


[03/12] git commit: [flex-asjs] [refs/heads/develop] - remove blank line

Posted by jm...@apache.org.
remove blank line


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/242fb730
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/242fb730
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/242fb730

Branch: refs/heads/develop
Commit: 242fb730d054212c20735dea35b2785be5d944f2
Parents: 4d09ccf
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 10:40:04 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 10:40:04 2017 +1000

----------------------------------------------------------------------
 .../Network/src/main/flex/org/apache/flex/net/HTTPService.as        | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/242fb730/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
index 3a9968c..fdb387f 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
@@ -618,7 +618,6 @@ package org.apache.flex.net
                     }
                 }
                 
-
                 if (_method !== HTTPConstants.GET &&
                     !sawContentType && contentData) {
                     element.setRequestHeader(


[02/12] git commit: [flex-asjs] [refs/heads/develop] - add constants currently used by code

Posted by jm...@apache.org.
add constants currently used by code


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/4d09ccf5
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4d09ccf5
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4d09ccf5

Branch: refs/heads/develop
Commit: 4d09ccf5abd481f7ef6a01f95ed8072a75da073d
Parents: 318bdf2
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 10:39:47 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 10:39:47 2017 +1000

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/net/HTTPHeader.as | 23 +++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4d09ccf5/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPHeader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPHeader.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPHeader.as
index 05c8760..17fc7ae 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPHeader.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPHeader.as
@@ -30,7 +30,7 @@ package org.apache.flex.net
 	{
         /**
          *  The Content-type header.
-         *  
+         *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
@@ -38,6 +38,27 @@ package org.apache.flex.net
          */
 		public static const CONTENT_TYPE:String = "Content-type";
 
+		/**
+		 *  The Content-length header.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public static const CONTENT_LENGTH:String = "Content-length";
+
+
+		/**
+		 *  The Connection header.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public static const CONNECTION:String = "Connection";
+
         /**
          *  Constructor.
          *  


[09/12] git commit: [flex-asjs] [refs/heads/develop] - add JS only CORSCredentialsBead

Posted by jm...@apache.org.
add JS only CORSCredentialsBead


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3fa62e72
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3fa62e72
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3fa62e72

Branch: refs/heads/develop
Commit: 3fa62e72959b6fb09e02e707d628bf29c07221ba
Parents: 350e1f0
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 13:21:47 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 13:21:47 2017 +1000

----------------------------------------------------------------------
 frameworks/projects/Network/src/main/flex/NetworkClasses.as | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3fa62e72/frameworks/projects/Network/src/main/flex/NetworkClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/NetworkClasses.as b/frameworks/projects/Network/src/main/flex/NetworkClasses.as
index a649df0..e4cd570 100644
--- a/frameworks/projects/Network/src/main/flex/NetworkClasses.as
+++ b/frameworks/projects/Network/src/main/flex/NetworkClasses.as
@@ -22,13 +22,17 @@ package
 /**
  *  @private
  *  This class is used to link additional classes into rpc.swc
- *  beyond those that are found by dependecy analysis starting
+ *  beyond those that are found by dependency analysis starting
  *  from the classes specified in manifest.xml.
  */
 internal class NetworkClasses
 {	
     import org.apache.flex.net.URLBinaryLoader; URLBinaryLoader;
 	import org.apache.flex.net.HTTPConstants; HTTPConstants;
+
+    COMPILE::JS {
+        import org.apache.flex.net.beads.CORSCredentialsBead; CORSCredentialsBead;
+    }
 }
 
 }


[06/12] git commit: [flex-asjs] [refs/heads/develop] - fill in missing comments

Posted by jm...@apache.org.
fill in missing comments


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c57d7754
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c57d7754
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c57d7754

Branch: refs/heads/develop
Commit: c57d7754009607ed8eae3eebc1edc5a69a1fe12c
Parents: 18d62de
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 10:41:19 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 10:41:19 2017 +1000

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/net/URLRequest.as | 30 ++++++++++++++++++--
 1 file changed, 27 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c57d7754/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLRequest.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLRequest.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLRequest.as
index 389531f..3c39f50 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLRequest.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLRequest.as
@@ -71,7 +71,15 @@ package org.apache.flex.net
 		 */	
 		public var method:String = HTTPConstants.GET;
 		private var _requestHeaders:Array;
-        
+
+		/**
+		 *   Set the URL request string.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         public function URLRequest(url:String = null)
         {
             super();
@@ -81,12 +89,28 @@ package org.apache.flex.net
             }
             this.requestHeaders = [];
         }
-        
+
+		/**
+		 *   Set the URL request headers.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         public function get requestHeaders():Array
         {
             return _requestHeaders;
         }
-        
+
+		/**
+		 *   Get the URL request headers.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         public function set requestHeaders(value:Array) : void
         {
 			_requestHeaders = value;


[08/12] git commit: [flex-asjs] [refs/heads/develop] - use header constants, improve variable names, add missing comments

Posted by jm...@apache.org.
use header constants, improve variable names, add missing comments


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/350e1f07
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/350e1f07
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/350e1f07

Branch: refs/heads/develop
Commit: 350e1f07aafd372aecd0be5b903a750125935ce6
Parents: 198ae7c
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 10:42:22 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 10:42:22 2017 +1000

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/net/URLStream.as  | 135 +++++++++++++++----
 1 file changed, 109 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/350e1f07/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLStream.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLStream.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLStream.as
index 2ec3c85..be3a9d6 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLStream.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLStream.as
@@ -79,15 +79,15 @@ package org.apache.flex.net
         public function get response():BinaryData
         {
             COMPILE::JS
-                {
+			{
                     return new BinaryData(xhr.response as ArrayBuffer);
-                }
-                COMPILE::SWF
-                {
-                    var ba:ByteArray = new ByteArray();
-                    flashUrlStream.readBytes(ba);
-                    return new BinaryData(ba);
-                }
+			}
+			COMPILE::SWF
+			{
+				var ba:ByteArray = new ByteArray();
+				flashUrlStream.readBytes(ba);
+				return new BinaryData(ba);
+			}
         }
 
         public function load(urlRequest:org.apache.flex.net.URLRequest):void
@@ -124,7 +124,7 @@ package org.apache.flex.net
 				var contentSet:Boolean = false;
 				for each (var requestHeader:org.apache.flex.net.URLRequestHeader in urlRequest.requestHeaders)
 				{
-					if(requestHeader.name.toLowerCase() == "content-type")
+					if(requestHeader.name.toLowerCase() == HTTPHeader.CONTENT_TYPE.toLocaleLowerCase())
 					{
 						contentSet = true;
 						req.contentType = requestHeader.value;
@@ -133,7 +133,7 @@ package org.apache.flex.net
 				}
 				if(!contentSet)
 				{
-					req.requestHeaders.push(new flash.net.URLRequestHeader("Content-type", urlRequest.contentType));
+					req.requestHeaders.push(new flash.net.URLRequestHeader(HTTPHeader.CONTENT_TYPE, urlRequest.contentType));
 					
 				}
 				if (urlRequest.data)
@@ -152,12 +152,29 @@ package org.apache.flex.net
                 flashUrlStream.load(req);
             }
         }
+
+		/**
+		 *  HTTP status changed (Flash only).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         COMPILE::SWF
-		private function flash_status(ev:HTTPStatusEvent):void
+		private function flash_status(event:HTTPStatusEvent):void
 		{
-			setStatus(ev.status);
+			setStatus(event.status);
 		}
-		
+
+		/**
+		 *  IO error occurred (Flash only).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         COMPILE::SWF 
         protected function flash_onIoError(event:IOErrorEvent):void
         {
@@ -168,16 +185,32 @@ package org.apache.flex.net
 				onError(this);
 			cleanupCallbacks();
         }
-		
+
+		/**
+		 *  Security error occurred (Flash only).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
 		COMPILE::SWF
-		private function flash_onSecurityError(ev:flash.events.Event):void
+		private function flash_onSecurityError(event:flash.events.Event):void
 		{
 			dispatchEvent(new DetailEvent(HTTPConstants.COMMUNICATION_ERROR,false,false,HTTPConstants.SECURITY_ERROR));
 			if(onError)
 				onError(this);
 			cleanupCallbacks();
 		}
-            
+
+		/**
+		 *  Upload complete (Flash only).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         COMPILE::SWF
         protected function flash_complete(event:flash.events.Event):void
         {
@@ -186,32 +219,57 @@ package org.apache.flex.net
 				onComplete(this);
 			cleanupCallbacks();
         }
+
+		/**
+		 *  Upload is progressing (Flash only).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         COMPILE::SWF
-        protected function flash_progress(ev:flash.events.ProgressEvent):void
+        protected function flash_progress(event:flash.events.ProgressEvent):void
         {
             var progEv:org.apache.flex.events.ProgressEvent = new org.apache.flex.events.ProgressEvent(org.apache.flex.events.ProgressEvent.PROGRESS);
 			
-			progEv.current = bytesLoaded = ev.bytesLoaded;
-			progEv.total = bytesTotal = ev.bytesTotal;
+			progEv.current = bytesLoaded = event.bytesLoaded;
+			progEv.total = bytesTotal = event.bytesTotal;
             dispatchEvent(progEv);
 			if(onProgress)
 				onProgress(this);
         }
-        
+
+		/**
+		 *  Upload is progressing (JS only).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         COMPILE::JS
-        private function xhr_progress(e:Object):void 
+        private function xhr_progress(error:Object):void
         {
 			var progEv:ProgressEvent = new ProgressEvent(ProgressEvent.PROGRESS);
-			progEv.current = bytesLoaded = e.loaded;
-			progEv.total = bytesTotal = e.total;
+			progEv.current = bytesLoaded = error.loaded;
+			progEv.total = bytesTotal = error.total;
 			
             dispatchEvent(progEv);
 			if(onProgress)
 				onProgress(this);
         }
-        
+
+		/**
+		 *  HTTP status change (JS only).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         COMPILE::JS
-        private function xhr_onreadystatechange(e:*):void
+        private function xhr_onreadystatechange(error:*):void
         {
 			setStatus(xhr.status);
 			//we only need to deal with the status when it's done.
@@ -245,7 +303,15 @@ package org.apache.flex.net
 			}
 			cleanupCallbacks();
         }
-		
+
+		/**
+		 *  Set the HTTP request status.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
 		private function setStatus(value:int):void
 		{
 			if(value != requestStatus)
@@ -257,6 +323,14 @@ package org.apache.flex.net
 			}
 		}
 
+		/**
+		 *  Abort an connection.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         public function close():void
         {
             COMPILE::SWF
@@ -294,6 +368,14 @@ package org.apache.flex.net
 		 */        
 		public var endian:String = Endian.BIG_ENDIAN;
 
+		/**
+		 *  Cleanup all callbacks.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
 		private function cleanupCallbacks():void
 		{
 			onComplete = null;
@@ -301,6 +383,7 @@ package org.apache.flex.net
 			onProgress = null;
 			onStatus = null;
 		}
+
 		/**
 		 *  Callback for complete event.
 		 *  


[07/12] git commit: [flex-asjs] [refs/heads/develop] - fill in missing comments

Posted by jm...@apache.org.
fill in missing comments


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/198ae7c8
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/198ae7c8
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/198ae7c8

Branch: refs/heads/develop
Commit: 198ae7c8952224f4944648965812075eab6adffa
Parents: c57d775
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 10:41:38 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 10:41:38 2017 +1000

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/net/URLRequestHeader.as   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/198ae7c8/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLRequestHeader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLRequestHeader.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLRequestHeader.as
index 9680764..be129f2 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLRequestHeader.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLRequestHeader.as
@@ -50,7 +50,14 @@ package org.apache.flex.net
         public var value:String;
 		
 		
-        
+		/**
+		 *  Set the name and value of a URL request header.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
         public function URLRequestHeader(name:String, value:String)
         {
 			this.name = name;


[05/12] git commit: [flex-asjs] [refs/heads/develop] - fix spelling errors and add missing semicolon

Posted by jm...@apache.org.
fix spelling errors and add missing semicolon


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/18d62de1
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/18d62de1
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/18d62de1

Branch: refs/heads/develop
Commit: 18d62de1202587bc53b4f850ed9f23725e596d6a
Parents: fe1ff66
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 16 10:41:01 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 16 10:41:01 2017 +1000

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/net/URLBinaryLoader.as     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/18d62de1/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as
index 5785c62..326ccbe 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as
@@ -72,7 +72,7 @@ package org.apache.flex.net
         public var bytesLoaded:uint = 0;
         
 		/**
-		 *  The total number of bytes (if avaailable).
+		 *  The total number of bytes (if available).
 		 *  
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
@@ -143,7 +143,7 @@ package org.apache.flex.net
         }
         
 		/**
-		 *  Cancels the URL request
+		 *  Cancels the URL request.
 		 *  
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
@@ -153,7 +153,7 @@ package org.apache.flex.net
         public function close():void
         {
             stream.close();
-			//TODO do we need a callback for camceling?
+			//TODO do we need a callback for canceling?
         }
         
         private function completeHandler(event:Event):void
@@ -178,7 +178,7 @@ package org.apache.flex.net
         
         private function progressHandler(event:ProgressEvent):void
         {
-            this.bytesLoaded = event.current
+            this.bytesLoaded = event.current;
             this.bytesTotal = event.total;
             dispatchEvent(event);
 			if(onProgress)