Closed Bug 1435483 Opened 6 years ago Closed 6 years ago

Do some cleanup on our exception classes

Categories

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

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(23 files, 1 obsolete file)

2.02 KB, patch
ochameau
: review+
Details | Diff | Splinter Review
8.75 KB, patch
bholley
: review+
Details | Diff | Splinter Review
10.30 KB, patch
qdot
: review+
Details | Diff | Splinter Review
3.69 KB, patch
qdot
: review+
Details | Diff | Splinter Review
9.11 KB, patch
qdot
: review+
Details | Diff | Splinter Review
12.56 KB, patch
qdot
: review+
Details | Diff | Splinter Review
4.74 KB, patch
qdot
: review+
Details | Diff | Splinter Review
4.52 KB, patch
qdot
: review+
Details | Diff | Splinter Review
8.24 KB, patch
qdot
: review+
Details | Diff | Splinter Review
10.73 KB, patch
qdot
: review+
Details | Diff | Splinter Review
6.17 KB, patch
qdot
: review+
Details | Diff | Splinter Review
4.17 KB, patch
qdot
: review+
Details | Diff | Splinter Review
3.88 KB, patch
qdot
: review+
Details | Diff | Splinter Review
4.53 KB, patch
qdot
: review+
Details | Diff | Splinter Review
6.62 KB, patch
qdot
: review+
Details | Diff | Splinter Review
24.19 KB, patch
qdot
: review+
Details | Diff | Splinter Review
18.16 KB, patch
qdot
: review+
Details | Diff | Splinter Review
3.05 KB, patch
qdot
: review+
Details | Diff | Splinter Review
4.30 KB, patch
qdot
: review+
Details | Diff | Splinter Review
10.49 KB, patch
qdot
: review+
Details | Diff | Splinter Review
8.50 KB, patch
Details | Diff | Splinter Review
9.45 KB, patch
Details | Diff | Splinter Review
9.01 KB, patch
qdot
: review+
Details | Diff | Splinter Review
There's a bunch of XPCOM goop we can remove here.
Assignee: nobody → bzbarsky
This code has never worked correctly.  Bug 911258 landed on 2013-09-09 and
removed the initialize() method from XPConnect exceptions.  This code landed
two days after that.  If it's ever reached, it will just throw when calling the
nonexistent initialize() method.

MozReview-Commit-ID: FWpP1fLBIPW
Attachment #8948203 - Flags: review?(poirot.alex)
Bobby, could you review the CanCreateInstance call removal carefully?  I'm pretty sure we should be system-only there, but maybe I'm missing something?
Attachment #8948204 - Flags: review?(bobbyholley)
This interface is not usable from JS, because we don't expose initialize() in
the WebIDL bindings for Exception.  And C++ doesn't use it.

MozReview-Commit-ID: LsIm4YA0YZE
Attachment #8948205 - Flags: review?(kyle)
MozReview-Commit-ID: H1ZPg76xNyI
Attachment #8948206 - Flags: review?(kyle)
MozReview-Commit-ID: D3uuehuDqOB
Attachment #8948207 - Flags: review?(kyle)
MozReview-Commit-ID: 7aYg9kJhiab
Attachment #8948208 - Flags: review?(kyle)
MozReview-Commit-ID: 7VJvDR0qD3G
Attachment #8948209 - Flags: review?(kyle)
MozReview-Commit-ID: KpRyt21PF7W
Attachment #8948210 - Flags: review?(kyle)
MozReview-Commit-ID: ADxO2A8nkel
Attachment #8948211 - Flags: review?(kyle)
MozReview-Commit-ID: 8pdMDFHWlVt
Attachment #8948212 - Flags: review?(kyle)
MozReview-Commit-ID: KLSzUuWt45x
Attachment #8948213 - Flags: review?(kyle)
MozReview-Commit-ID: CTCawPvw6VZ
Attachment #8948214 - Flags: review?(kyle)
MozReview-Commit-ID: CXnwjeHoGRm
Attachment #8948215 - Flags: review?(kyle)
MozReview-Commit-ID: 6JN7UvkhPgl
Attachment #8948216 - Flags: review?(kyle)
It's doing casts that are bogus.  We can do the same thing (only needed for
tests anyway) via a chromeonly API on DOMRequest.

MozReview-Commit-ID: 1FUPGMhBU3k
Attachment #8948217 - Flags: review?(kyle)
nsIException is builtinclass in idl, so whatever code we had to handle
non-dom::Exception nsIExceptions is dead code.

MozReview-Commit-ID: 6VnqDWt0041
Attachment #8948218 - Flags: review?(kyle)
MozReview-Commit-ID: GKzE812BfIF
Attachment #8948219 - Flags: review?(kyle)
MozReview-Commit-ID: JArus2ddEsL
Attachment #8948220 - Flags: review?(kyle)
MozReview-Commit-ID: AbVQ7IA4xqp
Attachment #8948221 - Flags: review?(kyle)
MozReview-Commit-ID: 9cDzCeddOmh
Attachment #8948222 - Flags: review?(kyle)
MozReview-Commit-ID: 17yuhlqzbr2
Attachment #8948223 - Flags: review?(kyle)
Attached patch Part 18 diff -wSplinter Review
Attached patch Part 21 diff -wSplinter Review
MozReview-Commit-ID: GKzE812BfIF
Attachment #8948438 - Flags: review?(kyle)
Attachment #8948219 - Attachment is obsolete: true
Attachment #8948219 - Flags: review?(kyle)
Comment on attachment 8948203 [details] [diff] [review]
part 1.  Stop using nsIXPCException in devtools code

I'm not sure this code is still used, this was related to FXOS.
Attachment #8948203 - Flags: review?(poirot.alex) → review+
(In reply to Alexandre Poirot [:ochameau] from comment #25)
> I'm not sure this code is still used, this was related to FXOS.

Created bug 1435791 to remove this code.
Attachment #8948205 - Flags: review?(kyle) → review+
Attachment #8948206 - Flags: review?(kyle) → review+
Attachment #8948207 - Flags: review?(kyle) → review+
Attachment #8948208 - Flags: review?(kyle) → review+
Comment on attachment 8948209 [details] [diff] [review]
part 7.  Add an infallible "columnNumber" getter on nsIStackFrame

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

::: dom/bindings/Exceptions.cpp
@@ +479,5 @@
>  
>    return col;
>  }
>  
> +NS_IMETHODIMP JSStackFrame::GetColumnNumberXPCOM(JSContext* aCx,

nit: Might as well fix formatting while you're here?
Attachment #8948209 - Flags: review?(kyle) → review+
Attachment #8948210 - Flags: review?(kyle) → review+
Attachment #8948211 - Flags: review?(kyle) → review+
> nit: Might as well fix formatting while you're here?

Done.
Attachment #8948212 - Flags: review?(kyle) → review+
Attachment #8948213 - Flags: review?(kyle) → review+
Attachment #8948214 - Flags: review?(kyle) → review+
Attachment #8948215 - Flags: review?(kyle) → review+
Attachment #8948216 - Flags: review?(kyle) → review+
Attachment #8948217 - Flags: review?(kyle) → review+
Attachment #8948218 - Flags: review?(kyle) → review+
Attachment #8948220 - Flags: review?(kyle) → review+
Attachment #8948221 - Flags: review?(kyle) → review+
Attachment #8948222 - Flags: review?(kyle) → review+
Comment on attachment 8948223 [details] [diff] [review]
part 21.  Remove nsIException::ToString

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

::: xpcom/base/nsIException.idl
@@ +66,5 @@
>  };
>  
> +// This interface only exists because of all the JS consumers doing
> +// "instanceof Ci.nsIException".  We should switch them to something else and
> +// get rid of it.  C++ code should NOT use this; use mozilla::dom::Exception

nit: Do we have followup filed for this? If so, can we mention it here?
Attachment #8948223 - Flags: review?(kyle) → review+
Attachment #8948438 - Flags: review?(kyle) → review+
> nit: Do we have followup filed for this?

Not yet, but I can file and mention: bug 1435856.
Blocks: 1435856
Attachment #8948204 - Flags: review?(bobbyholley) → review+
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/af047d35cc1f
part 1.  Stop using nsIXPCException in devtools code.  r=ochameau
https://hg.mozilla.org/integration/mozilla-inbound/rev/4798fb33e87f
part 2.  Stop allowing creation of Exception objects via contract/CID.  r=bholley
https://hg.mozilla.org/integration/mozilla-inbound/rev/432d38e26230
part 3.  Remove nsIXPCException.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/c916ed1fb22e
part 4.  Remove always-true mInitialized member from Exception.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/06e2c91ca04f
part 5.  Add an infallible "filename" getter on nsIStackFrame.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/feec23374328
part 6.  Add an infallible "lineNumber" getter on nsIStackFrame.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/5376dbad3062
part 7.  Add an infallible "columnNumber" getter on nsIStackFrame.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/2cb9916edac9
part 8.  Add an infallible "asyncCause" getter on nsIStackFrame.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/3c7e9384e092
part 9.  Add an infallible "name" getter on nsIStackFrame.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/4065bdc6d415
part 10.  Add infallible "asyncCaller" and "caller" getters on nsIStackFrame.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/233b3c3c8c4b
part 11.  Add an infallible "formattedStack" getter on nsIStackFrame.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7d20b7d9230
part 12.  Add an infallible "toString" method on nsIStackFrame.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/6c6988ae4688
part 13.  Remove nsIException::GetName.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/43b00825c08c
part 14.  Remove nsIException::GetFilename/GetLineNumber/GetColumnNumber.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/c8e4cf95eb66
part 15.  Remove nsIDOMRequestService::FireDetailedError.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/1cc1b9042bb3
part 16.  Switch to using dom::Exception, not nsIException, in C++ code.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/3dc0da16efed
part 17.  Remove nsIException::GetMessageMoz.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/bd57d71589c2
part 18.  Remove nsIException::GetResult.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/bbad188127c1
part 19.  Remove nsIException::GetLocation.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/a8eaa9b9c2ce
part 20.  Remove nsIException::GetData.  r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/aba564b1d5ec
part 21.  Remove nsIException::ToString.  r=qdot
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: