Closed Bug 944890 Opened 11 years ago Closed 10 years ago

B2G SMS & MMS: remove convertTimeToInt(...) which is no longer needed

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: airpingu, Assigned: airpingu)

References

Details

Attachments

(2 files, 2 obsolete files)

At bug 939302, we interpret all the timestamps as long-long numbers instead of Date objects. Eventually, all the timestamp values in the DOM, IPDL, SMS/MMS internal codes can just be passed around as long-long numbers. We should be able to remove convertTimeToInt(...) which is no longer needed anymore.
Severity: critical → minor
Why is this security-sensitive?
(In reply to Boris Zbarsky [:bz] from comment #1)
> Why is this security-sensitive?

It shouldn't be. Sorry I cloned that bug without unchecking that flag but I'm still not able to uncheck that option now. Could anyone please help me? Thanks!
Group: core-security
Attached patch Part 1, implementation (obsolete) — Splinter Review
Attachment #8393383 - Flags: review?(vyang)
Attached patch Part 2, test cases (obsolete) — Splinter Review
Attachment #8393384 - Flags: review?(vyang)
Flags: in-testsuite+
Comment on attachment 8393383 [details] [diff] [review]
Part 1, implementation

Review of attachment 8393383 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry, can't remember which bug, but I remember I was once told not to align argument names.
Attachment #8393383 - Flags: review?(vyang)
Comment on attachment 8393384 [details] [diff] [review]
Part 2, test cases

Review of attachment 8393384 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/mobilemessage/tests/test_smsservice_createsmsmessage.js
@@ -145,5 @@
>  
>  /**
> - * Test supplying the timestamp as a Date object.
> - */
> -add_test(function test_timestamp_date() {

Please rewrite this as what we have in test_invalid_timestamp_float.

@@ -168,5 @@
> -
> -/**
> - * Test that a floating point number for the timestamp is not allowed.
> - */
> -add_test(function test_invalid_timestamp_float() {

Please keep this and replace |new Date()| with |Date.now()|.  We still want to verify acceptable argument types in this script.
Attachment #8393384 - Flags: review?(vyang)
(In reply to Vicamo Yang [:vicamo][:vyang] from comment #7)
> > -add_test(function test_invalid_timestamp_float() {
> 
> Please keep this and replace |new Date()| with |Date.now()|.  We still want
> to verify acceptable argument types in this script.

Since the float/null/undefined will be automatically casted to valid unsigned long long value, I'd prefer removing these tests.
> Since the float/null/undefined will be automatically casted to valid
> unsigned long long value, I'd prefer removing these tests.

Random object like {} will also implicitly be casted to integer.
Hi Vicamo, note that I'd still prefer align the parameters for IDL and IPDL because they are just for generating codes. Also, I saw lots of examples in WebIDL/IDL aligning parameters in this way so I think it's OK to do so.
Attachment #8393383 - Attachment is obsolete: true
Attachment #8393423 - Flags: review?(vyang)
Comment on attachment 8393423 [details] [diff] [review]
Part 1, implementation, V2

Review of attachment 8393423 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you :)
Attachment #8393423 - Flags: review?(vyang) → review+
Attachment #8393424 - Flags: review?(vyang) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: