Exception handling

295 views
Skip to first unread message

Rodrigo Bonifacio

unread,
Jan 30, 2014, 6:13:15 PM1/30/14
to chromium...@chromium.org
Dear all, analysing the source code of Google Chrome, I could figure out that the exception handling constructs of c++ is not frequently used in the project. Is there any recommendation for not using try-catch statements for handling errors in the project?

All the best,

Rodrigo.

Torne (Richard Coles)

unread,
Jan 31, 2014, 12:40:05 PM1/31/14
to rbonif...@gmail.com, Chromium-discuss
We build without exception support; any code that does mention try-catch must be in a third party project in a part of the code that we don't use. You can't use exceptions in Chromium; it's not a recommendation, it just doesn't work :)


--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss
 

Torne (Richard Coles)

unread,
Feb 3, 2014, 6:32:36 AM2/3/14
to Rodrigo, Chromium-discuss
On 31 January 2014 17:54, Rodrigo <rbonif...@gmail.com> wrote:
Hi Richard, is there any reason for avoiding try-catch and building Chromium without EH support?

Well, there's always a reason :)

I can't tell you specifically the reasons why the Chromium project decided not to use exceptions at the beginning as I wasn't there, but the general Google C++ coding standard forbids it because much pre-existing Google code isn't exception-safe and therefore using exceptions in a new piece of code makes it hard to interoperate. Exceptions in C++ also impose a cost in performance and binary size to implement RTTI, store stack unrolling info, etc.
 
Thank you for your response.


Sent from my iPad

Rodrigo

unread,
Jan 31, 2014, 12:54:22 PM1/31/14
to Torne (Richard Coles), Chromium-discuss
Hi Richard, is there any reason for avoiding try-catch and building Chromium without EH support?

Thank you for your response.


Sent from my iPad

On 31/01/2014, at 14:40, "Torne (Richard Coles)" <to...@chromium.org> wrote:

Reply all
Reply to author
Forward
0 new messages