~ubuntu-branches/ubuntu/gutsy/firefox/gutsy

« back to all changes in this revision

Viewing changes to modules/plugin/base/src/nsJSNPRuntime.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ian Jackson
  • Date: 2006-10-10 18:49:32 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20061010184932-da75izt7y0e59afq
Tags: 1.99+2.0rc2+dfsg-0ubuntu1
* New upstream version 2.0rc2.
* Fix/workaround for epiphany GtkSocket lifetype crash:
  apply patch id=241087 from Mozilla Bugzilla #241535 to fix LP #63814.
* Change application name to `Firefox', as requested by mdz.
  Files changed:
    - browser/locales/en-US/chrome/branding/brand.dtd
    - browser/locales/en-US/chrome/branding/brand.properties;
  New values:
    - brandShortName and brandFullName: `Bon Echo' => `Firefox'
    - vendorShortName: `Mozilla' => `Ubuntu'
* Make preferences dialogue fit again (bah!).

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
// while executing JS on the context.
79
79
static nsIJSContextStack *sContextStack;
80
80
 
81
 
class AutoCXPusher
82
 
{
83
 
public:
84
 
  AutoCXPusher(JSContext *cx)
85
 
  {
86
 
    if (sContextStack)
87
 
      sContextStack->Push(cx);
88
 
  }
89
 
 
90
 
  ~AutoCXPusher()
91
 
  {
92
 
    if (sContextStack)
93
 
      sContextStack->Pop(nsnull);
94
 
  }
95
 
};
96
 
 
97
81
NPClass nsJSObjWrapper::sJSObjWrapperNPClass =
98
82
  {
99
83
    NP_CLASS_STRUCT_VERSION,
225
209
  }
226
210
}
227
211
 
 
212
struct AutoCXPusher
 
213
{
 
214
  AutoCXPusher(JSContext *cx)
 
215
  {
 
216
    // Precondition explaining why we don't need to worry about errors
 
217
    // in OnWrapperCreated.
 
218
    NS_PRECONDITION(sWrapperCount > 0,
 
219
                    "must have live wrappers when using AutoCXPusher");
 
220
 
 
221
    // Call OnWrapperCreated and OnWrapperDestroyed to ensure that the
 
222
    // last OnWrapperDestroyed doesn't happen while we're on the stack
 
223
    // and null out sContextStack.
 
224
    OnWrapperCreated();
 
225
 
 
226
    sContextStack->Push(cx);
 
227
  }
 
228
 
 
229
  ~AutoCXPusher()
 
230
  {
 
231
    sContextStack->Pop(nsnull);
 
232
 
 
233
    OnWrapperDestroyed();
 
234
  }
 
235
};
 
236
 
228
237
static JSContext *
229
238
GetJSContext(NPP npp)
230
239
{