With the added safety checks it's unlikely that anything in this function will
fire ObjC exceptions, but our rule is to have guards around every Objective C
function that can directly be called from C++ files.
MozReview-Commit-ID: GQ0bN5638Sf
--HG--
extra : rebase_source : 3919f4a2b8160f197e1690ba13b58319239848e1
extra : source : 3d233eddd929e0cb2cadf0b07f75d60aa3fba419
This potentially changes behavior. On my machine, the old code returned
NS_ERROR_FAILURE because the dictionary did not have a "countryCode" entry,
but this new implementation correctly returns the string "CA".
MozReview-Commit-ID: 17Vme0fcAIw
--HG--
extra : rebase_source : 9ffc388ae98b11cb37c37957a8721e92284208c3
extra : source : e1a14b0c638571ec7f7aaec56f11d4b77dfb4dd5