~ubuntu-branches/ubuntu/precise/xulrunner-1.9/precise

« back to all changes in this revision

Viewing changes to mozilla/toolkit/crashreporter/mac_utils.mm

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2008-12-16 18:40:18 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20081216184018-j646ukfhzxnjynix
Tags: 1.9.0.5+nobinonly-0ubuntu1
* new security/stability upstream release v1.9.0.5 (FIREFOX_3_0_5_RELEASE)
  - see USN-690-1
* submit patches upstreamed:
  - bzXXX_plugin_for_mimetype_pref.patch => bz449188_att350098_plugin_for_mimetype_pref.patch
  - update debian/patches/series
* adjust XULFastLoad cache in response to interleaving landing of bmo
  #453545 and #462806
  - update debian/patches/bz368428_attachment_308130.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 * the Initial Developer. All Rights Reserved.
21
21
 *
22
22
 * Contributor(s):
 
23
 *  Josh Aas <josh@mozilla.com>
23
24
 *
24
25
 * Alternatively, the contents of this file may be used under the terms of
25
26
 * either the GNU General Public License Version 2 or later (the "GPL"), or
39
40
 
40
41
#include "mac_utils.h"
41
42
#include "nsObjCExceptions.h"
 
43
#include "nsXPCOM.h"
42
44
 
43
45
bool PassToOSCrashReporter()
44
46
{
53
55
 
54
56
  NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
55
57
}
 
58
 
 
59
void GetObjCExceptionInfo(void* inException, nsACString& outString)
 
60
{
 
61
  NSException* e = (NSException*)inException;
 
62
 
 
63
  NSString* name = [e name];
 
64
  NSString* reason = [e reason];
 
65
  unsigned int nameLength = [name length];
 
66
  unsigned int reasonLength = [reason length];
 
67
 
 
68
  unichar* nameBuffer = (unichar*)NS_Alloc(sizeof(unichar) * (nameLength + 1));
 
69
  if (!nameBuffer)
 
70
    return;
 
71
  unichar* reasonBuffer = (unichar*)NS_Alloc(sizeof(unichar) * (reasonLength + 1));
 
72
  if (!reasonBuffer) {
 
73
    NS_Free(nameBuffer);
 
74
    return;
 
75
  }
 
76
 
 
77
  [name getCharacters:nameBuffer];
 
78
  [reason getCharacters:reasonBuffer];
 
79
  nameBuffer[nameLength] = '\0';
 
80
  reasonBuffer[reasonLength] = '\0';
 
81
 
 
82
  outString.AssignLiteral("\nObj-C Exception data:\n");
 
83
  AppendUTF16toUTF8(nameBuffer, outString);
 
84
  outString.AppendLiteral(": ");
 
85
  AppendUTF16toUTF8(reasonBuffer, outString);
 
86
 
 
87
  NS_Free(nameBuffer);
 
88
  NS_Free(reasonBuffer);
 
89
}