Closed Bug 1155387 Opened 5 years ago Closed 5 years ago

Call to SetData(imageContainer) triggers build error: "ContentParent.cpp:2616:30: error: no viable conversion from 'nsCOMPtr<imgIContainer>' to 'nsISupports *' "

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

dom/ipc/ContentParent.cpp:2616:30: error: no viable conversion from 'nsCOMPtr<imgIContainer>' to 'nsISupports *'
         rv = imgPtr->SetData(imageContainer);
                              ^~~~~~~~~~~~~~
 ../../dist/include/nsCOMPtr.h:693:3: note: candidate function
   operator T*() const { return get(); }
   ^
 ../../dist/include/nsISupportsPrimitives.h:1613:35: note: passing argument to parameter 'aData' here
   NS_IMETHOD SetData(nsISupports *aData) = 0;
                                   ^
}

This line of code was added in bug 1071562 part 1:
https://hg.mozilla.org/integration/mozilla-inbound/rev/802512ee57ae#l6.139
Just need a QI or a cast or something. Doesn't happen on our default compilers though.
That's what I thought, but that's not quite it.

I thought replacing "imageContainer" with "imageContainer.get()" might fix it, but then I get:
> error: cannot initialize a parameter of type 'nsISupports *' with an rvalue of type 'imgIContainer *'

I also tried static_cast<nsISupports*>(imageContainer.get()), but that gives me this error about the static_cast:
> error: static_cast from 'imgIContainer *' to 'nsISupports *', which are not related by inheritance, is not allowed

This was pretty mysterious, until I realized that we just were missing the imgIContainer header-file.  (The compiler errors could stand to be more helpful about that.)
I suspect our TreeHerder compilers aren't hitting this due to some luck of unified builds, or perhaps due to getting this #include via some #ifdeffed section somewhere, due to having a different build configuration from mine.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #8593595 - Flags: review?(enndeakin)
Attachment #8593595 - Flags: review?(enndeakin) → review+
https://hg.mozilla.org/mozilla-central/rev/89fd1de23ff3
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.