Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 7c4b13d

Browse files
author
Eduardo Fullea
committed
Futures in MmsManager
1 parent 3076b26 commit 7c4b13d

File tree

1 file changed

+54
-66
lines changed

1 file changed

+54
-66
lines changed

index.html

Lines changed: 54 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -857,12 +857,12 @@ <h2><a>MmsManager</a> Interface</h2>
857857
</dl>
858858
</dd>
859859

860-
<dt> MessagingRequest send ()</dt>
860+
<dt> Future send ()</dt>
861861
<dd>This method issues a request to the messaging system to send an MMS
862862
message with the content and recipients included in the
863863
<code>mmsContent</code> parameter.
864-
A <code>MessagingRequest</code> object will be returned in order to notify
865-
the result of the request.
864+
A <code>Future</code> object will be returned in order to notify the result
865+
of the request.
866866
<dl class='parameters'>
867867
<dt>MmsContent mmsContent</dt>
868868
<dd>
@@ -876,12 +876,12 @@ <h2><a>MmsManager</a> Interface</h2>
876876
</dl>
877877
</dd>
878878

879-
<dt> MessagingRequest fetch ()</dt>
879+
<dt> Future fetch ()</dt>
880880
<dd>This method requests to fetch an MMS message with identifier equal to
881881
the indicated in the <code>messageID</code> parameter from the URL indicated in the
882-
MMS notification. The method returns a new <code>MessagingRequest</code>
883-
that will allow the caller to be notified about the result (success, error)
884-
of the operation.
882+
MMS notification. The method returns a new <code>Future</code> that will
883+
allow the caller to be notified about the result (success, error) of the
884+
operation.
885885
<dl class='parameters'>
886886
<dt>DOMString messageID</dt>
887887
<dd>
@@ -890,7 +890,7 @@ <h2><a>MmsManager</a> Interface</h2>
890890
</dl>
891891
</dd>
892892

893-
<dt>MessagingRequest clear ()</dt>
893+
<dt>Future clear ()</dt>
894894
<dd>This method makes a request to delete all the messages associated to the
895895
messaging service passed as parameter.
896896
<dl class='parameters'>
@@ -955,8 +955,7 @@ <h3>Steps</h3>
955955
<p> The <dfn><code>send</code></dfn> method when invoked MUST run the
956956
following steps:
957957
<ol>
958-
<li>Create a new instance of <code>MmsMessage</code> and a new instance
959-
of <code>MessagingRequest</code> and:
958+
<li>Create a new instance of <code>MmsMessage</code> and:
960959
<ol>
961960
<li>Generate a identifier for this message that is globally unique within
962961
the implementation, i.e. there cannot be any other message with the same
@@ -996,35 +995,28 @@ <h3>Steps</h3>
996995
passed in the <code>content</code> parameter to the number(s) of indicated
997996
in the <code>to</code> parameter, using the proper service as described
998997
above.
999-
<li>Set <code>readyState</code> of the <code>MessagingRequest</code>
1000-
object to 'processing'.
1001-
<li>Return the <code>MessagingRequest</code> to the caller and <a>queue a
1002-
task</a> to monitor MMS sending progress.
998+
<li><a>Queue a task</a> to monitor MMS sending progress.
1003999
</ol>
1004-
<li>If there is an error
1000+
<li>Let <var>future</var> be a new <code>Future</code> object and
1001+
<var>resolver</var> its associated <code>resolver</code>
1002+
<li>Return <var>future</var> to the caller.
1003+
<li>If an <var>error</var> occurs run these substeps and terminate these
1004+
steps
10051005
<ol>
1006-
<li>Set the <code>state</code> of the <code>MmsMessage</code> to
1007-
'error'.
10081006
<li>If a delivery report had been requested set the different elements
10091007
in the <code>deliveryStatus</code> array of the <code>MmsMessage</code>
10101008
to 'error'.
1011-
<li>Invoke the <code>onerror</code> <a class="internalDFN"
1012-
href="#dfn-eventhandler">event handlers</a> of the
1013-
<code>MessagingRequest</code> object.
1009+
<li>call <var>resolver</var>'s <code>reject(value)</code>method with
1010+
<var>error</var> as <code>value</code> argument.
10141011
</ol>
1015-
<li>When the requests has been completed:
1012+
<li>When the request has been successfully completed:
10161013
<ol>
10171014
<li>Set the <code>state</code> of the <code>MmsMessage</code> to 'sent'.
10181015
<li>Set the <code>timestamp</code> of the <code>MmsMessage</code> to the
10191016
timestamp when the MMS message was sent, i.e. the date when the M-Send.req
10201017
Protocol Data Unit was send from the MMS Client to the MMS Server.
1021-
<li>Set the <code>readyState</code> of the <code>MessagingRequest</code>
1022-
object to 'done'.
1023-
<li>Set the <code>result</code> of the <code>MessagingRequest</code>
1024-
object to the <code>MmsMessage</code> that has been sent.
1025-
<li>Invoke the <code>onsuccess</code> <a class="internalDFN"
1026-
href="#dfn-eventhandler">event handlers</a> of the
1027-
<code>MessagingRequest</code>.
1018+
<li>Call <var>resolver</var>'s <code>accept(value)</code>method with
1019+
the sent <code>MmsMessage</code> as <code>value</code> argument.
10281020
<li><a>Queue a task</a> to <a>fire an event</a> named
10291021
<code>sent</code> with the <code>message</code> attribute set to the sent
10301022
<code>MmsMessage</code>.
@@ -1132,26 +1124,25 @@ <h3>Steps</h3>
11321124
corresponding MMS notification due to the fetch mode being manual. When this
11331125
method is invoked the User Agent MUST run the following steps:
11341126
<ol>
1135-
<li>Create a new <code>MessagingRequest</code> object
1136-
<li>If the <code>messageID</code> parameter passed in the request matches with an
1137-
MMS message that has already been fetched, or to an SMS message go to step
1138-
5.1, otherwise make a request to the system to fetch the MMS message.
1139-
<li>Set the <code>readyState</code> of the <code>MessagingRequest</code>
1140-
object to 'processing' and return the <code>MessagingRequest</code> to the
1141-
caller.
1142-
<li>If there is an error invoke the <code>onerror</code> <a>event
1143-
handler</a> of the <code>MessagingRequest</code> object.
1144-
<li>When the request has been completed:
1127+
<li>If the <code>messageID</code> parameter passed in the request matches
1128+
with an MMS message that has already been fetched, or to an SMS message go
1129+
to next step, otherwise make a request to the system to fetch the MMS
1130+
message.
1131+
<li>Let <var>future</var> be a new <code>Future</code> object and
1132+
<var>resolver</var> its associated <code>resolver</code>
1133+
<li>Return <var>future</var> to the caller.
1134+
<li>If an <var>error</var> occurs call <var>resolver</var>'s
1135+
<code>reject(value)</code>method with <var>error</var> as
1136+
<code>value</code> argument.
1137+
<li>When the request has been successfully completed:
11451138
<ol>
1146-
<li>Run the <a class="internalDFN" href="#dfn-fill-mms-message">steps for filling the
1147-
MmsMessage object with the data contained in the MMS message</a>.
1148-
<li>Set the <code>readyState</code> of the
1149-
<code>MessagingRequest</code> object to 'done'.
1150-
<li>Set the <code>result</code> of the <code>MessagingRequest</code>
1151-
object to 'true'.
1152-
<li>Invoke the <code>onsuccess</code> <a class="internalDFN"
1153-
href="#dfn-eventhandler">event handlers</a> of the
1154-
<code>MessagingRequest</code>.
1139+
<li>Run the <a class="internalDFN" href="#dfn-fill-mms-message">steps for
1140+
filling the MmsMessage object with the data contained in the MMS
1141+
message</a>.
1142+
<li>Let <var>message</var> be the <code>MmsMessage</code> that has been
1143+
fetched.
1144+
<li>Call <var>resolver</var>'s <code>accept(value)</code>method with
1145+
<var>message</var> as <code>value</code> argument.
11551146
</ol>
11561147
</ol>
11571148

@@ -1175,11 +1166,10 @@ <h3>Steps</h3>
11751166
}
11761167
</pre>
11771168

1178-
1179-
<p>The User Agent MAY fire additional <code>ProgressEvents</code>
1180-
[[!PROGRESS-EVENTS]] on the <code>MessagingRequest</code> object associated to
1181-
the sending and fetching of an MMS message, in order to report on the progress
1182-
of such operations.
1169+
<div class='note'>
1170+
It is FFS how to report the progress of the sending and fetching of an MMS
1171+
message.
1172+
</div>
11831173

11841174
<p>Upon a delivery report of a previously sent MMS message being received, the
11851175
<a>user agent</a> MUST
@@ -1207,23 +1197,21 @@ <h3>Steps</h3>
12071197
<li>Make a request to the system to delete all the messages associated to
12081198
the messaging service with identifier equal to the <code>serviceID</code>
12091199
parameter.
1210-
<li>Create a new <code>MessagingRequest</code> object and set
1211-
<code>readyState</code> of the <code>MessagingRequest</code> object to
1212-
'processing' and return the <code>MessagingRequest</code> to the caller.
1213-
<li>If there is an error invoke the <code>onerror</code> <a>event
1214-
handler</a> of the <code>MessagingRequest</code> object.
1215-
<li>When the request has been completed:
1200+
<li>Let <var>future</var> be a new <code>Future</code> object and
1201+
<var>resolver</var> its associated <code>resolver</code>
1202+
<li>Return <var>future</var> to the caller.
1203+
<li>If an <var>error</var> occurs call <var>resolver</var>'s
1204+
<code>reject(value)</code>method with <var>error</var> as
1205+
<code>value</code> argument.
1206+
<li>When the request has been successfully completed:
12161207
<ol>
1217-
<li>Set the <code>readyState</code> of the
1218-
<code>MessagingRequest</code> object to 'done'.
1219-
<li>Set the <code>result</code> of the <code>MessagingRequest</code>
1220-
object to 'true'.
1221-
<li>Invoke the <code>onsuccess</code> <a class="internalDFN"
1222-
href="#dfn-eventhandler">event handlers</a> of the
1223-
<code>MessagingRequest</code>.
1208+
<li>Let <var>serviceID</var> be the <code>serviceID</code> parameter
1209+
passed in the request
1210+
<li>Call <var>resolver</var>'s <code>accept(value)</code>method with
1211+
<var>serviceID</var> as <code>value</code> argument.
12241212
</ol>
12251213
</ol>
1226-
</section>
1214+
</section>
12271215

12281216
<section>
12291217
<h2>Event handlers</h2>

0 commit comments

Comments
 (0)