Closed
Bug 1287623
Opened 9 years ago
Closed 9 years ago
Use StaticRefPtr<> in more places
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla50
| Tracking | Status | |
|---|---|---|
| firefox50 | --- | fixed |
People
(Reporter: mccr8, Assigned: mccr8)
Details
Attachments
(5 files)
|
3.45 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
|
3.64 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
|
4.11 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
|
3.48 KB,
patch
|
michal
:
review+
|
Details | Diff | Splinter Review |
|
4.19 KB,
patch
|
michal
:
review+
|
Details | Diff | Splinter Review |
I have patches to convert CacheFileIOManager::gInstance, CacheIndex::gInstance, nsDirectoryService::gService, and nsMessageManagerScriptExecutor::sScriptCacheCleaner to use StaticRefPtr<>. The first two will require adding some more methods involving StaticRefPtr.
| Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8772566 -
Flags: review?(bugs)
| Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8772567 -
Flags: review?(nfroyd)
| Assignee | ||
Comment 3•9 years ago
|
||
This patch adds a number of standard conversions to and from RefPtr<> and already_AddRefed<>.
These are used in the later patches in this series.
Attachment #8772568 -
Flags: review?(nfroyd)
| Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8772569 -
Flags: review?(honzab.moz)
| Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8772570 -
Flags: review?(honzab.moz)
Updated•9 years ago
|
Attachment #8772568 -
Flags: review?(nfroyd) → review+
Updated•9 years ago
|
Attachment #8772567 -
Flags: review?(nfroyd) → review+
Updated•9 years ago
|
Attachment #8772569 -
Flags: review?(honzab.moz) → review?(michal.novotny)
Updated•9 years ago
|
Attachment #8772570 -
Flags: review?(honzab.moz) → review?(michal.novotny)
Updated•9 years ago
|
Attachment #8772569 -
Flags: review?(michal.novotny) → review+
Updated•9 years ago
|
Attachment #8772570 -
Flags: review?(michal.novotny) → review+
Updated•9 years ago
|
Attachment #8772566 -
Flags: review?(bugs) → review+
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/114da8bdc0b0
part 1 - Use StaticRefPtr for sScriptCacheCleaner. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/602d4d88e806
part 2 - Use StaticRefPtr for nsDirectoryService::gService. r=froydnj
https://hg.mozilla.org/integration/mozilla-inbound/rev/8aa409c9b1ce
part 3 - Add more methods involving StaticRefPtr. r=froydnj
https://hg.mozilla.org/integration/mozilla-inbound/rev/248153344e15
part 4 - Make CacheIndex::gInstance a StaticRefPtr. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/a48daec87ec9
part 5 - Convert CacheFileIOManager::gInstance to StaticRefPtr. r=mayhemer
All backed out for static build bustage: https://treeherder.mozilla.org/logviewer.html#?job_id=32263507&repo=mozilla-inbound
https://hg.mozilla.org/integration/mozilla-inbound/rev/d2c17679b215
Flags: needinfo?(continuation)
| Assignee | ||
Comment 8•9 years ago
|
||
Nathan, static analysis gave me the error message "error: variable of type 'mozilla::StaticRefPtr<mozilla::net::CacheFileIOManager>' only valid as global". Do you know why that isn't okay? Thanks.
I guess I'll just remove them from the class and turn them into globals in the C++ files.
Flags: needinfo?(continuation) → needinfo?(nfroyd)
| Assignee | ||
Comment 9•9 years ago
|
||
Over IRC, glandium said this is due to the MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS annotation, but AFAICT my use should be okay, because they are static members. I'll file a static analysis bug.
| Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(nfroyd)
| Assignee | ||
Comment 10•9 years ago
|
||
Oh, I see. The actual error is:
22:33:43 INFO - /home/worker/workspace/build/src/obj-firefox/dist/include/nsThreadUtils.h:791:19: error: variable of type 'mozilla::StaticRefPtr<mozilla::net::CacheFileIOManager>' only valid as global
22:33:43 INFO - NewRunnableMethod(PtrType aPtr, Method aMethod)
22:33:43 INFO - ^
22:33:43 INFO - /home/worker/workspace/build/src/obj-firefox/dist/include/nsThreadUtils.h:791:19: note: value incorrectly allocated in an automatic variable
22:33:43 INFO - 1 error generated.
I suspect it means this line:
ev = NewRunnableMethod(
gInstance, &CacheFileIOManager::CacheIndexStateChangedInternal);
...and then some template magic is trying to declare something of type StaticRefPtr<>. I suspect the fix is to change that to gInstance.get().
Comment 11•9 years ago
|
||
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/872848c3a716
part 1 - Use StaticRefPtr for sScriptCacheCleaner. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/cef4132ee60b
part 2 - Use StaticRefPtr for nsDirectoryService::gService. r=froydnj
https://hg.mozilla.org/integration/mozilla-inbound/rev/aafe24d898d2
part 3 - Add more methods involving StaticRefPtr. r=froydnj
https://hg.mozilla.org/integration/mozilla-inbound/rev/c3676ef8ac27
part 4 - Make CacheIndex::gInstance a StaticRefPtr. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/2f91720817ab
part 5 - Convert CacheFileIOManager::gInstance to StaticRefPtr. r=mayhemer
| Assignee | ||
Comment 12•9 years ago
|
||
That get was the only missing thing, so I just updated that without bothering to get review.
clean S try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=bb3697ebcbfa
Comment 13•9 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/872848c3a716
https://hg.mozilla.org/mozilla-central/rev/cef4132ee60b
https://hg.mozilla.org/mozilla-central/rev/aafe24d898d2
https://hg.mozilla.org/mozilla-central/rev/c3676ef8ac27
https://hg.mozilla.org/mozilla-central/rev/2f91720817ab
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in
before you can comment on or make changes to this bug.
Description
•