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

« back to all changes in this revision

Viewing changes to browser/components/safebrowsing/src/nsDocNavStartProgressListener.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:
87
87
  NS_ENSURE_SUCCESS(rv, rv);
88
88
 
89
89
  return webProgressService->AddProgressListener(this,
90
 
      nsIWebProgress::NOTIFY_STATE_REQUEST);
 
90
      nsIWebProgress::NOTIFY_LOCATION);
91
91
}
92
92
 
93
93
 
111
111
  nsCOMPtr<nsIChannel> channel;
112
112
  nsresult rv;
113
113
  channel = do_QueryInterface(aReq, &rv);
114
 
  NS_ENSURE_SUCCESS(rv, rv);
 
114
  if (NS_FAILED(rv))
 
115
    return rv;
115
116
 
116
117
  rv = channel->GetURI(uri);
117
 
  NS_ENSURE_SUCCESS(rv, rv);
 
118
  if (NS_FAILED(rv))
 
119
    return rv;
118
120
  return NS_OK;
119
121
}
120
122
 
194
196
 
195
197
  *isSpurious = scheme.Equals("about") ||
196
198
                scheme.Equals("chrome") ||
197
 
                scheme.Equals("file");
 
199
                scheme.Equals("file") ||
 
200
                scheme.Equals("javascript");
198
201
 
199
202
  if (scheme.Equals("jar")) {
200
203
    // If it's a jar URI, we want to check the inner URI's scheme
221
224
                                            PRUint32 aStateFlags,
222
225
                                            nsresult aStatus)
223
226
{
224
 
  if (mEnabled && aStateFlags & STATE_START && aStateFlags & STATE_IS_REQUEST) {
225
 
    // We only care about document loads, check load flags.
226
 
    nsresult rv;
227
 
    nsLoadFlags loadFlags;
228
 
    rv = aRequest->GetLoadFlags(&loadFlags);
229
 
    NS_ENSURE_SUCCESS(rv, rv);
230
 
    if (!(loadFlags & nsIChannel::LOAD_DOCUMENT_URI))
231
 
      return NS_OK;
232
 
 
233
 
    // ignore requests with no URI
234
 
    nsCOMPtr<nsIURI> uri;
235
 
    rv = GetRequestUri(aRequest, getter_AddRefs(uri));
236
 
    if (NS_FAILED(rv))
237
 
      return NS_OK;
238
 
 
239
 
    nsCAutoString uriString;
240
 
    rv = uri->GetAsciiSpec(uriString);
241
 
    if (NS_FAILED(rv))
242
 
      return NS_OK;
243
 
 
244
 
    // We store the request and a timer in queue.  When the timer fires,
245
 
    // we use the request in the front of the queue.
246
 
 
247
 
    nsCOMPtr<nsITimer> timer = do_CreateInstance("@mozilla.org/timer;1", &rv);
248
 
    NS_ENSURE_TRUE(timer, rv);
249
 
 
250
 
    rv = timer->Init(this, mDelay, nsITimer::TYPE_ONE_SHOT);
251
 
    if (NS_SUCCEEDED(rv)) {
252
 
      mRequests.AppendObject(aRequest);
253
 
      mTimers.AppendObject(timer);
254
 
    } else {
255
 
      return NS_ERROR_FAILURE;
256
 
    }
257
 
  }
258
227
  return NS_OK;
259
228
}
260
229
 
279
248
                                               nsIRequest *aRequest,
280
249
                                               nsIURI *aLocation)
281
250
{
 
251
  nsresult rv;
 
252
  nsCAutoString uriString;
 
253
  nsCOMPtr<nsIURI> uri;
 
254
 
 
255
  // ignore requests with no URI
 
256
  rv = GetRequestUri(aRequest, getter_AddRefs(uri));
 
257
  if (NS_FAILED(rv))
 
258
    return NS_OK;
 
259
  rv = uri->GetAsciiSpec(uriString);
 
260
  if (NS_FAILED(rv))
 
261
    return NS_OK;
 
262
 
 
263
  // We store the request and a timer in queue.  When the timer fires,
 
264
  // we use the request in the front of the queue.
 
265
  nsCOMPtr<nsITimer> timer = do_CreateInstance("@mozilla.org/timer;1", &rv);
 
266
  NS_ENSURE_TRUE(timer, rv);
 
267
 
 
268
  rv = timer->Init(this, mDelay, nsITimer::TYPE_ONE_SHOT);
 
269
  NS_ENSURE_SUCCESS(rv, rv);
 
270
 
 
271
  mRequests.AppendObject(aRequest);
 
272
  mTimers.AppendObject(timer);
 
273
 
282
274
  return NS_OK;
283
275
}
284
276