~ubuntu-branches/ubuntu/natty/firefox/natty-updates

« back to all changes in this revision

Viewing changes to debian/globalmenu/components/src/uDebug.h

  • Committer: Package Import Robot
  • Author(s): Chris Coulson, Chris Coulson, Jamie Strandboge
  • Date: 2012-06-01 18:31:55 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20120601183155-4q12f7adnllql614
Tags: 13.0+build1-0ubuntu0.11.04.1
* New upstream stable release (FIREFOX_13_0_BUILD1)
  - see LP: #1007495 for USN information

[ Chris Coulson <chris.coulson@canonical.com> ]
* Update globalmenu-extension to 3.2.3
  - Reduce our memory footprint a bit, which wasn't really a lot anyway
  - Avoid the use of the component manager for accessing commonly used
    services, where "commonly used" means "accessed when building every
    menu item". This should save some CPU cycles when building or
    refreshing menus
  - Try to recycle menuitems when they are removed from a menu by
    adding contiguous blocks of removed items to a "free list" which
    is emptied asynchronously, and reusing the items in this list when
    new items are added in place of the removed items. This means that
    refreshing the history menu contents when the menu is opened no
    longer alters the menu structure, but results in a shifting of
    properties between existing nodes instead. This has a few benefits:
    + With no layout changes, unity-panel-service doesn't request
      the entire menu structure, which significantly reduces dbus traffic
      and makes it much faster to refresh the menu contents
    + The size of the menu doesn't change when it is refreshed, which
      eliminates the flicker that used to occur when opening the history
      menu.
  - Remove all use of the global observer service for sending our own
    internal notifications around
  - Clean up the way we ensure that the correct edit commands are
    enabled by just installing our own onpopupshowing handler rather
    than using an additional notification to fix things up after the
    default handler runs
  - Get rid of a static initializer
  - Don't support older than Firefox 11
  - Fix some GError leaks
  - Hide the internal menu when creating a native menu, rather than
    waiting for confirmation that the native menu is registered
    successfully. We don't try to create a native menu if we don't
    find a menu service to register the menu with anyway
  - Keep menu contents updated whilst the menu is open, rather than
    just whilst it is opening
  - Fix LP: #915888 - Handling of checkbox menuitems with a command
    node is wrong
* Refresh build-depends:
  - Bump minimum GTK version to 2.14 as we build with GIO support
  - Add minimum requirement for glib (2.18)
  - Drop libidl-dev, this doesn't appear to be needed now
  - Bump minimum NSPR version to 4.9.0 for --enable-system-nspr builds
  - Bump minimum sqlite version to 3.7.10 for --enable-system-sqlite
    builds
  - Bump minimum NSS version to 3.13.2 for --enable-system-nss builds
* Refresh patches:
  - update debian/patches/ubuntu-ua-string-changes.patch
  - update debian/patches/ubuntu-codes-google.patch
  - update debian/patches/firefox-kde.patch
  - update debian/patches/mozilla-kde.patch
  - update debian/patches/dont-include-hyphenation-patterns.patch
* Clean up the file exclude list and add comments for excluded files
  - update debian/build/create-tarball.py
* Make it easy to run Firefox in valgrind for builds that are compiled
  with explicit valgrind support
  - update debian/firefox.sh.in
* Bump debhelper compat to 7
  - update debian/apport/blacklist.in
  - update debian/apport/source_firefox.py.in
  - update debian/compat
  - update debian/config/mozconfig.in
  - update debian/control.in
  - update debian/firefox-dev.install.in
  - update debian/firefox-dev.links.in
  - update debian/firefox-globalmenu.dirs.in
  - update debian/firefox-gnome-support.install.in
  - update debian/firefox.dirs.in
  - update debian/firefox.install.in
  - update debian/firefox.links.in
  - update debian/firefox.postinst.in
  - update debian/firefox.preinst.in
  - update debian/firefox.sh.in
  - update debian/pkgconfig/libxul.pc.in
  - update debian/pkgconfig/mozilla-nspr.pc.in
  - update debian/pkgconfig/mozilla-plugin.pc.in
  - update debian/rules
  - update debian/usr.bin.firefox.apparmor.10.04
  - update debian/usr.bin.firefox.apparmor.10.10
  - update debian/usr.bin.firefox.apparmor.11.04
  - update debian/usr.bin.firefox.apparmor.9.10
* Override 2 embedded-library lintian errors
  - update debian/firefox.lintian-overrides.in
* Drop debian/patches/distro-locale-searchplugins after landing of
  bmo: #515232
* Don't hardcode general.useragent.locale to en-US, now that it's used
  for searchplugin localization. This means we can drop this pref from
  ubufox
  - add debian/patches/dont-override-general-useragent-locale.patch
  - update debian/patches/series
* Drop patches fixed upstream
  - remove debian/patches/no-sps-profiler-on-unsupported-archs.patch
  - remove debian/patches/avoid-dbus-roundtrip-for-httpchannel.patch
  - update debian/patches/series
* Apport hook improvements:
  - Add support for reporting preference defaults that are set by extensions
  - When reporting preferences, record the source of each preference
  - Report plugin packages for plugins that are installed with the
    package manager
  - Add some addon manager related prefs to the whitelist
  - Display additional metadata in the extensions report
  - Take "default-to-compatible" in to account when determining whether
    the user is running incompatible addons
  - Attach submitted crash ID's to bug reports
  - Report if files in the profile folder have broken permissions
* Update compare-locales to 0.9.5
* Fix make-makefile test failure when the build directory contains
  perl regexp control characters
  - add debian/patches/make-makefile-test-fix.patch
  - update debian/patches/series
* Fix for NSS libs not being signed, breaking FIPS
  - update debian/rules

[ Jamie Strandboge <jamie@ubuntu.com> ]
* adjust apparmor profile to deny reads to @{PROC}/[0-9]*/net/dev. Patch 
  thanks to James Troup (LP: #955066)
* adjust apparmor profile to deny reads to @{PROC}/[0-9]*/net/wireless.
  Patch thanks to James Troup (LP: #974141)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
 
/* ***** BEGIN LICENSE BLOCK *****
3
 
 *       Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
 
 *
5
 
 * The contents of this file are subject to the Mozilla Public License Version
6
 
 * 1.1 (the "License"); you may not use this file except in compliance with
7
 
 * the License. You may obtain a copy of the License at
8
 
 * http://www.mozilla.org/MPL/
9
 
 * 
10
 
 * Software distributed under the License is distributed on an "AS IS" basis,
11
 
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
 
 * for the specific language governing rights and limitations under the
13
 
 * License.
14
 
 *
15
 
 * The Original Code is globalmenu-extension.
16
 
 *
17
 
 * The Initial Developer of the Original Code is
18
 
 * Canonical Ltd.
19
 
 * Portions created by the Initial Developer are Copyright (C) 2010
20
 
 * the Initial Developer. All Rights Reserved.
21
 
 *
22
 
 * Contributor(s):
23
 
 * Chris Coulson <chris.coulson@canonical.com>
24
 
 *
25
 
 * Alternatively, the contents of this file may be used under the terms of
26
 
 * either the GNU General Public License Version 2 or later (the "GPL"), or
27
 
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28
 
 * in which case the provisions of the GPL or the LGPL are applicable instead
29
 
 * of those above. If you wish to allow use of your version of this file only
30
 
 * under the terms of either the GPL or the LGPL, and not to allow others to
31
 
 * use your version of this file under the terms of the MPL, indicate your
32
 
 * decision by deleting the provisions above and replace them with the notice
33
 
 * and other provisions required by the GPL or the LGPL. If you do not delete
34
 
 * the provisions above, a recipient may use your version of this file under
35
 
 * the terms of any one of the MPL, the GPL or the LGPL.
36
 
 * 
37
 
 * ***** END LICENSE BLOCK ***** */
38
 
 
39
 
#ifndef _U_DEBUG_H
40
 
#define _U_DEBUG_H
41
 
 
42
 
#include <nsStringAPI.h>
43
 
#include <nsXPCOM.h>
44
 
 
45
 
#if defined DEBUG_chrisccoulson && !defined DEBUG
46
 
#undef NS_ASSERTION
47
 
#undef NS_WARN_IF_FALSE
48
 
#undef NS_WARNING
49
 
 
50
 
#define NS_ASSERTION(expr, str)                               \
51
 
  do {                                                        \
52
 
    if (!(expr)) {                                            \
53
 
      NS_DebugBreak(NS_DEBUG_ASSERTION, str, #expr, __FILE__, __LINE__); \
54
 
    }                                                         \
55
 
  } while(0)
56
 
 
57
 
#define NS_WARN_IF_FALSE(_expr,_msg)                          \
58
 
  do {                                                        \
59
 
    if (!(_expr)) {                                           \
60
 
      NS_DebugBreak(NS_DEBUG_WARNING, _msg, #_expr, __FILE__, __LINE__); \
61
 
    }                                                         \
62
 
  } while(0)
63
 
 
64
 
#define NS_WARNING(str)                                       \
65
 
  NS_DebugBreak(NS_DEBUG_WARNING, str, nsnull, __FILE__, __LINE__)
66
 
#endif
67
 
 
68
 
#ifdef DEBUG
69
 
#define DEBUG_chrisccoulson
70
 
#endif
71
 
 
72
 
#ifdef DEBUG_chrisccoulson
73
 
class FunctionTracer
74
 
{
75
 
public:
76
 
  FunctionTracer(const char *funcName, const char *extra): mFuncName(funcName), mExtra(extra)
77
 
  {
78
 
    if (getenv("GLOBAL_MENU_VERBOSE")) {
79
 
      printf("%*s=== globalmenu-extension: Entering %s [%s] ===\n", sDepth, "", mFuncName.get(), mExtra.get());
80
 
    }
81
 
    sDepth++;
82
 
  }
83
 
 
84
 
  FunctionTracer(const char *funcName): mFuncName(funcName)
85
 
  {
86
 
    if (getenv("GLOBAL_MENU_VERBOSE")) {
87
 
      printf("%*s=== globalmenu-extension: Entering %s ===\n", sDepth, "", mFuncName.get());
88
 
    }
89
 
    sDepth++;
90
 
  }
91
 
 
92
 
  ~FunctionTracer()
93
 
  {
94
 
    sDepth--;
95
 
    if (getenv("GLOBAL_MENU_VERBOSE")) {
96
 
      if (mExtra.Length() > 0) {
97
 
        printf("%*s=== globalmenu-extension: Leaving %s [%s] ===\n", sDepth, "", mFuncName.get(), mExtra.get());
98
 
      } else {
99
 
        printf("%*s=== globalmenu-extension: Leaving %s ===\n", sDepth, "", mFuncName.get());
100
 
      }
101
 
    }
102
 
  }
103
 
 
104
 
  static PRUint32 sDepth;
105
 
private:
106
 
  nsCString mFuncName;
107
 
  nsCString mExtra;
108
 
};
109
 
 
110
 
#define DEBUG_WITH_THIS_MENUOBJECT(format...)                 \
111
 
  DEBUG_WITH_MENUOBJECT(this, format)
112
 
 
113
 
#define DEBUG_WITH_MENUOBJECT(object, format...)              \
114
 
  if (getenv("GLOBAL_MENU_VERBOSE")) {                        \
115
 
    nsCOMPtr<nsIContent> content;                             \
116
 
    if (object) object->GetContent(getter_AddRefs(content));  \
117
 
    nsAutoString id;                                          \
118
 
    nsCAutoString cid;                                        \
119
 
    if (content) content->GetAttr(kNameSpaceID_None, uWidgetAtoms::id, id); \
120
 
    CopyUTF16toUTF8(id, cid);                                 \
121
 
    char *str;                                                \
122
 
    asprintf(&str, format);                                   \
123
 
    printf("%*s* globalmenu-extension %s: %s [menuobject: %p (id: %s)] [this: %p]\n", FunctionTracer::sDepth, "", __PRETTY_FUNCTION__, str, object, cid.get(), this); \
124
 
    free(str);                                                \
125
 
  }
126
 
 
127
 
#define DEBUG_WITH_CONTENT(content, format...)                \
128
 
  if (getenv("GLOBAL_MENU_VERBOSE")) {                        \
129
 
    nsAutoString id;                                          \
130
 
    nsCAutoString cid;                                        \
131
 
    if (content) content->GetAttr(kNameSpaceID_None, uWidgetAtoms::id, id); \
132
 
    CopyUTF16toUTF8(id, cid);                                 \
133
 
    char *str;                                                \
134
 
    asprintf(&str, format);                                   \
135
 
    printf("%*s* globalmenu-extension %s: %s [content: %p (id: %s)] [this: %p]\n", FunctionTracer::sDepth, "", __PRETTY_FUNCTION__, str, content, cid.get(), this); \
136
 
    free(str);                                                \
137
 
  }
138
 
 
139
 
#define DEBUG_CSTR_FROM_UTF16(str) __extension__({            \
140
 
  nsCAutoString cstr;                                         \
141
 
  CopyUTF16toUTF8(str, cstr);                                 \
142
 
  cstr.get();                                                 \
143
 
})
144
 
 
145
 
#define TRACE_WITH_THIS_MENUOBJECT()                          \
146
 
  TRACE_WITH_MENUOBJECT(this)
147
 
 
148
 
#define TRACE_WITH_MENUOBJECT(object)                         \
149
 
  char *_id_s;                                                \
150
 
  {                                                           \
151
 
    nsCOMPtr<nsIContent> content;                             \
152
 
    if (object) object->GetContent(getter_AddRefs(content));  \
153
 
    nsAutoString _id;                                         \
154
 
    if (content) content->GetAttr(kNameSpaceID_None, uWidgetAtoms::id, _id); \
155
 
    nsCAutoString _cid;                                       \
156
 
    CopyUTF16toUTF8(_id, _cid);                               \
157
 
    asprintf(&_id_s, "menuobject: %p (id: %s)", object, _cid.get()); \
158
 
  }                                                           \
159
 
  FunctionTracer _marker(__PRETTY_FUNCTION__, _id_s);         \
160
 
  free(_id_s);
161
 
 
162
 
#define TRACE_WITH_CONTENT(content)                           \
163
 
  char *_id_s;                                                \
164
 
  {                                                           \
165
 
    nsAutoString _id;                                         \
166
 
    content->GetAttr(kNameSpaceID_None, uWidgetAtoms::id, _id); \
167
 
    nsCAutoString _cid;                                       \
168
 
    CopyUTF16toUTF8(_id, _cid);                               \
169
 
    asprintf(&_id_s, "id: %s", _cid.get());                   \
170
 
  }                                                           \
171
 
  FunctionTracer _marker(__PRETTY_FUNCTION__, _id_s);         \
172
 
  free(_id_s);
173
 
 
174
 
#define TRACE()                                               \
175
 
  FunctionTracer _marker(__PRETTY_FUNCTION__);
176
 
#else
177
 
#define DEBUG_WITH_THIS_MENUOBJECT(format...)
178
 
#define DEBUG_WITH_MENUOBJECT(object, format...)
179
 
#define DEBUG_WITH_CONTENT(content, format...)
180
 
#define DEBUG_CSTR_FROM_UTF16(str)
181
 
#define TRACE_WITH_THIS_MENUOBJECT()
182
 
#define TRACE_WITH_MENUOBJECT(object)
183
 
#define TRACE_WITH_CONTENT(content)
184
 
#define TRACE()
185
 
#endif
186
 
 
187
 
#endif