Expose BAD_TLS_INDEX and xpc_qsStringToJsval publicly

RESOLVED FIXED in mozilla12

Status

()

Core
XPConnect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

Trunk
mozilla12
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
These are used all over Gecko, and currently requires including xpcprivate.h and XPCQuickStubs.h (which aren't exported). I think it makes more sense to just put them in xpcpublic.h.

Also, this allows:

--- a/dom/indexedDB/Makefile.in
+++ b/dom/indexedDB/Makefile.in
@@ -88,17 +88,16 @@ EXPORTS_mozilla/dom/indexedDB = \
   $(NULL)
 
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/xpcom/build \
   -I$(topsrcdir)/dom/base \
   -I$(topsrcdir)/dom/src/storage \
   -I$(topsrcdir)/content/base/src \
   -I$(topsrcdir)/content/events/src \
-  -I$(topsrcdir)/js/xpconnect/src \
(Assignee)

Comment 1

6 years ago
Created attachment 582098 [details] [diff] [review]
Patch v1
Attachment #582098 - Flags: review?(bobbyholley+bmo)
Comment on attachment 582098 [details] [diff] [review]
Patch v1

>diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp

>+
>+#define BAD_TLS_INDEX (PRUintn)-1
>+

This should really be be defined in the same header as PR_NewThreadPrivateIndex. But I guess modifying NSPR is hard...


>+inline uint64_t
>+DoubleToUint64(double doubleval)
>+{
>+#ifdef XP_WIN
>+    // Note: Win32 can't handle double to uint64_t directly
>+    return static_cast<uint64_t>(static_cast<int64_t>(doubleval));
>+#else
>+    return static_cast<uint64_t>(doubleval);
>+#endif
>+}
>+
>+} // namespace xpc
>+

Makoto just fixed this over in bug 711404. Given that, we don't really need a function to do this anymore, as a simple cast will suffice. Can you wait for that bug to land, and then just kill xpc_qsDoubleToUint64 entirely?

r+ on the xpc_qsStringToJsval changes.
Attachment #582098 - Flags: review?(bobbyholley+bmo) → review+
(Assignee)

Comment 3

6 years ago
(In reply to Bobby Holley (:bholley) from comment #2)
> Comment on attachment 582098 [details] [diff] [review]
> Patch v1
> 
> >diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp
> 
> >+
> >+#define BAD_TLS_INDEX (PRUintn)-1
> >+
> 
> This should really be be defined in the same header as
> PR_NewThreadPrivateIndex. But I guess modifying NSPR is hard...

How about adding this in a #ifndef/#endif block while I try to get a patch into NSPR?

> 
> >+inline uint64_t
> >+DoubleToUint64(double doubleval)
> >+{
> >+#ifdef XP_WIN
> >+    // Note: Win32 can't handle double to uint64_t directly
> >+    return static_cast<uint64_t>(static_cast<int64_t>(doubleval));
> >+#else
> >+    return static_cast<uint64_t>(doubleval);
> >+#endif
> >+}
> >+
> >+} // namespace xpc
> >+
> 
> Makoto just fixed this over in bug 711404. Given that, we don't really need
> a function to do this anymore, as a simple cast will suffice. Can you wait
> for that bug to land, and then just kill xpc_qsDoubleToUint64 entirely?

Great.

> r+ on the xpc_qsStringToJsval changes.

Thanks.
> How about adding this in a #ifndef/#endif block while I try to get a patch
> into NSPR?

Sounds good!
(Assignee)

Comment 5

6 years ago
https://hg.mozilla.org/mozilla-central/rev/5f66d8279701
https://hg.mozilla.org/mozilla-central/rev/a16ef2789fc3
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Summary: Expose xpc_qsDoubleToUint64 and xpc_qsStringToJsval publicly → Expose BAD_TLS_INDEX and xpc_qsStringToJsval publicly
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.