Merginig mozilla-inbound with mozilla-central.

This commit is contained in:
Mounir Lamouri 2011-06-10 09:58:03 +02:00
commit 6895a96f41
34 changed files with 337 additions and 81 deletions

View File

@ -1182,6 +1182,7 @@ nsCanvasRenderingContext2D::InitializeWithSurface(nsIDocShell *docShell, gfxASur
mThebes->SetMiterLimit(10.0);
mThebes->SetLineCap(gfxContext::LINE_CAP_BUTT);
mThebes->SetLineJoin(gfxContext::LINE_JOIN_MITER);
mThebes->SetFillRule(gfxContext::FILL_RULE_WINDING);
mThebes->NewPath();
@ -1600,6 +1601,37 @@ nsCanvasRenderingContext2D::GetFillStyle_multi(nsAString& aStr, nsISupports **aI
return GetStyleAsStringOrInterface(aStr, aInterface, aType, STYLE_FILL);
}
NS_IMETHODIMP
nsCanvasRenderingContext2D::SetMozFillRule(const nsAString& aString)
{
gfxContext::FillRule rule;
if (aString.EqualsLiteral("evenodd"))
rule = gfxContext::FILL_RULE_EVEN_ODD;
else if (aString.EqualsLiteral("nonzero"))
rule = gfxContext::FILL_RULE_WINDING;
else
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
return NS_OK;
mThebes->SetFillRule(rule);
return NS_OK;
}
NS_IMETHODIMP
nsCanvasRenderingContext2D::GetMozFillRule(nsAString& aString)
{
switch (mThebes->CurrentFillRule()) {
case gfxContext::FILL_RULE_WINDING:
aString.AssignLiteral("nonzero"); break;
case gfxContext::FILL_RULE_EVEN_ODD:
aString.AssignLiteral("evenodd"); break;
default:
return NS_ERROR_FAILURE;
}
return NS_OK;
}
//
// gradients and patterns
//

View File

@ -62,7 +62,7 @@ interface nsIDOMTextMetrics : nsISupports
readonly attribute float width;
};
[scriptable, uuid(408be1b9-4d75-4873-b50b-9b651626e41d)]
[scriptable, uuid(bf5e52a3-6ec1-4a6e-8364-9f9222ec8edb)]
interface nsIDOMCanvasRenderingContext2D : nsISupports
{
// back-reference to the canvas element for which
@ -106,6 +106,9 @@ enum CanvasMultiGetterType {
[noscript] void setFillStyle_multi(in DOMString str, in nsISupports iface);
[noscript] void getFillStyle_multi(out DOMString str, out nsISupports iface, out long type);
//attribute DOMString fillRule;
attribute DOMString mozFillRule; /* "evenodd", "nonzero" (default) */
nsIDOMCanvasGradient createLinearGradient (in float x0, in float y0, in float x1, in float y1);
nsIDOMCanvasGradient createRadialGradient(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1);
nsIDOMCanvasPattern createPattern(in nsIDOMHTMLElement image, in DOMString repetition);

View File

@ -49,6 +49,7 @@
#include "cairo-win32-refptr.h"
#include "cairo-d2d-private-fx.h"
#include "cairo-win32.h"
#include "cairo-list-private.h"
/* describes the type of the currently applied clip so that we can pop it */
struct d2d_clip;
@ -81,7 +82,11 @@ struct _cairo_d2d_surface {
textRenderingState(TEXT_RENDERING_UNINITIALIZED)
{
_cairo_clip_init (&this->clip);
cairo_list_init(&this->dependent_surfaces);
}
~_cairo_d2d_surface();
cairo_surface_t base;
/* Device used by this surface
@ -139,11 +144,23 @@ struct _cairo_d2d_surface {
RefPtr<ID3D10RenderTargetView> buffer_rt_view;
RefPtr<ID3D10ShaderResourceView> buffer_sr_view;
// Other d2d surfaces which depend on this one and need to be flushed if
// it is drawn to. This is required for situations where this surface is
// drawn to another surface, but may be modified before the other surface
// has flushed. When the flush of the other surface then happens and the
// drawing command is actually executed, the contents of this surface will
// no longer be what it was when the drawing command was issued.
cairo_list_t dependent_surfaces;
//cairo_surface_clipper_t clipper;
};
typedef struct _cairo_d2d_surface cairo_d2d_surface_t;
struct _cairo_d2d_surface_entry
{
cairo_list_t link;
cairo_d2d_surface_t *surface;
};
typedef HRESULT (WINAPI*D2D1CreateFactoryFunc)(
__in D2D1_FACTORY_TYPE factoryType,
__in REFIID iid,

View File

@ -1053,6 +1053,25 @@ _cairo_d2d_set_clip (cairo_d2d_surface_t *d2dsurf, cairo_clip_t *clip)
return CAIRO_STATUS_SUCCESS;
}
static void _cairo_d2d_add_dependent_surface(cairo_d2d_surface_t *surf, cairo_d2d_surface_t *user)
{
_cairo_d2d_surface_entry *entry = new _cairo_d2d_surface_entry;
entry->surface = user;
cairo_surface_reference(&user->base);
cairo_list_add(&entry->link, &surf->dependent_surfaces);
};
static void _cairo_d2d_flush_dependent_surfaces(cairo_d2d_surface_t *surf)
{
_cairo_d2d_surface_entry *entry, *next;
cairo_list_foreach_entry_safe(entry, next, _cairo_d2d_surface_entry, &surf->dependent_surfaces, link) {
_cairo_d2d_flush(entry->surface);
cairo_surface_destroy(&entry->surface->base);
delete entry;
}
cairo_list_init(&surf->dependent_surfaces);
}
/**
* Enter the state where the surface is ready for drawing. This will guarantee
* the surface is in the correct state, and the correct clipping area is pushed.
@ -1062,6 +1081,7 @@ _cairo_d2d_set_clip (cairo_d2d_surface_t *d2dsurf, cairo_clip_t *clip)
static void _begin_draw_state(cairo_d2d_surface_t* surface)
{
if (!surface->isDrawing) {
_cairo_d2d_flush_dependent_surfaces(surface);
surface->rt->BeginDraw();
surface->isDrawing = true;
}
@ -1778,6 +1798,9 @@ _cairo_d2d_create_brush_for_pattern(cairo_d2d_surface_t *d2dsurf,
_cairo_d2d_update_surface_bitmap(srcSurf);
_cairo_d2d_flush(srcSurf);
// Mark a dependency on the source surface.
_cairo_d2d_add_dependent_surface(srcSurf, d2dsurf);
if (pattern->extend == CAIRO_EXTEND_NONE) {
ID2D1Bitmap *srcSurfBitmap = srcSurf->surfaceBitmap;
d2dsurf->rt->CreateBitmap(
@ -2327,6 +2350,18 @@ _cairo_d2d_surface_init(cairo_d2d_surface_t *newSurf, cairo_d2d_device_t *d2d_de
cairo_addref_device(&d2d_device->base);
d2d_device->mVRAMUsage += _cairo_d2d_compute_surface_mem_size(newSurf);
}
_cairo_d2d_surface::~_cairo_d2d_surface()
{
_cairo_d2d_surface_entry *entry, *next;
cairo_list_foreach_entry_safe(entry, next, _cairo_d2d_surface_entry, &dependent_surfaces, link) {
// We do not need to flush, the contents of our texture has not changed,
// our users have their own reference and can just use it later.
cairo_surface_destroy(&entry->surface->base);
delete entry;
}
}
// Implementation
static cairo_surface_t*
@ -2793,6 +2828,8 @@ _cairo_d2d_blend_surface(cairo_d2d_surface_t *dst,
needsTransform = true;
}
_cairo_d2d_add_dependent_surface(src, dst);
D2D1_BITMAP_INTERPOLATION_MODE interpMode =
D2D1_BITMAP_INTERPOLATION_MODE_LINEAR;
@ -2986,6 +3023,8 @@ _cairo_d2d_get_temp_rt(cairo_d2d_surface_t *surf, cairo_clip_t *clip)
static cairo_int_status_t
_cairo_d2d_blend_temp_surface(cairo_d2d_surface_t *surf, cairo_operator_t op, ID2D1RenderTarget *rt, cairo_clip_t *clip, const cairo_rectangle_int_t *bounds = NULL)
{
_cairo_d2d_flush_dependent_surfaces(surf);
int numPaths = 0;
if (clip) {
cairo_clip_path_t *path = clip->path;
@ -3590,6 +3629,10 @@ _cairo_dwrite_manual_show_glyphs_on_d2d_surface(void *surface,
}
}
if (!dst->isDrawing) {
_cairo_d2d_flush_dependent_surfaces(dst);
}
_cairo_d2d_set_clip(dst, NULL);
dst->rt->Flush();

View File

@ -1,9 +1,16 @@
<html class="reftest-wait">
<head>
<script>
setTimeout('document.documentElement.className = ""', 1000);
var numLoads = 0;
function loaded()
{
numLoads++;
if (numLoads == 5) {
document.documentElement.className = "";
}
}
</script>
<body>
<iframe src="331883-1-inner.html"></iframe>
<iframe onload="loaded()" src="331883-1-inner.html"></iframe>
</body>
</html>

View File

@ -1,35 +0,0 @@
<html>
<head style="display: none">
<style id="style">
.lizard:first-line { }
</style>
<script>
function init()
{
document.getElementById("style").textContent += "* { position: relative; }";
document.getElementById("comment10div").setAttribute("class", "lizard");
document.getElementById("style").textContent += "*::-moz-line-frame { position: absolute; }";
setTimeout(function() { location.reload(); }, 200);
}
window.addEventListener("load", init, false);
</script>
</head>
<body>
<div id="comment10div">XXXXXXXXXXXXXXXXXXXXXXXX <span>YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ JJJJJJJJJJJJJJJ PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP</span></div>
</body>
</html>

View File

@ -1,9 +0,0 @@
<html class="reftest-wait">
<head>
<script>
setTimeout('document.documentElement.className = ""', 1000);
</script>
<body>
<iframe src="331883-2-inner.html"></iframe>
</body>
</html>

View File

@ -83,7 +83,6 @@ load 331679-1.xhtml
load 331679-2.xml
load 331679-3.xml
load 331883-1.html
load 331883-2.html
load 335140-1.html
load 336291-1.html
load 336999-1.xul

View File

@ -0,0 +1,16 @@
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var ctx = document.getElementById("c1").getContext("2d");
ctx.mozFillRule = "evenodd";
ctx.rect(50, 50, 200, 200);
ctx.rect(100, 100, 100, 100);
ctx.fill();
}
</script>
</head>
<body>
<div><canvas id="c1" width="300" height="300"></canvas></div>
</body>
</html>

View File

@ -0,0 +1,19 @@
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var ctx = document.getElementById("c1").getContext("2d");
ctx.mozFillRule = "evenodd";
ctx.rect(50, 50, 200, 200);
ctx.rect(100, 100, 100, 100);
ctx.clip();
ctx.beginPath();
ctx.fillRect(0, 0, 300, 300);
}
</script>
</head>
<body>
<div><canvas id="c1" width="300" height="300"></canvas></div>
</body>
</html>

View File

@ -0,0 +1,27 @@
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var ctx = document.getElementById("c1").getContext("2d");
ctx.mozFillRule = "evenodd";
ctx.moveTo(50, 50);
ctx.lineTo(250, 50);
ctx.lineTo(250, 250);
ctx.lineTo(50, 250);
ctx.lineTo(50, 50);
ctx.moveTo(100, 100);
ctx.lineTo(100, 200);
ctx.lineTo(200, 200);
ctx.lineTo(200, 100);
ctx.lineTo(100, 100);
ctx.fill();
}
</script>
</head>
<body>
<div><canvas id="c1" width="300" height="300"></canvas></div>
</body>
</html>

View File

@ -0,0 +1,17 @@
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var ctx = document.getElementById("c1").getContext("2d");
ctx.rect(50, 50, 200, 50);
ctx.rect(50, 50, 50, 200);
ctx.rect(250, 250, -200, -50);
ctx.rect(250, 250, -50, -200);
ctx.fill();
}
</script>
</head>
<body>
<div><canvas id="c1" width="300" height="300"></canvas></div>
</body>
</html>

View File

@ -0,0 +1,43 @@
<html>
<head>
<script type="text/javascript">
function assert(cond, msg) { if (!cond) { throw msg; } }
window.onload = function() {
try {
var ctx = document.getElementById("c1").getContext("2d");
assert("nonzero" == ctx.mozFillRule,
"Default fillRule is 'nonzero'");
ctx.mozFillRule = "evenodd";
assert("evenodd" == ctx.mozFillRule,
"fillRule understands 'evenodd'");
ctx.mozFillRule = "nonzero";
ctx.mozFillRule = "garbageLSKJDF 29879234";
assert("nonzero" == ctx.mozFillRule,
"Garbage fillRule string has no effect");
ctx.mozFillRule = "evenodd";
ctx.mozFillRule = "garbageLSKJDF 29879234";
assert("evenodd" == ctx.mozFillRule,
"Garbage fillRule string has no effect");
ctx.mozFillRule = "nonzero";
ctx.save();
ctx.mozFillRule = "evenodd";
ctx.restore();
assert("nonzero" == ctx.mozFillRule,
"fillRule was saved then restored");
} catch (e) {
document.body.innerHTML = "FAIL: "+ e.toString();
return;
}
document.body.innerHTML = "Pass";
}
</script>
</head>
<body>
<div><canvas id="c1" width="300" height="300"></canvas></div>
</body>
</html>

View File

@ -0,0 +1,15 @@
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var ctx = document.getElementById("c1").getContext("2d");
ctx.rect(50, 50, 200, 200);
ctx.rect(100, 100, 100, 100);
ctx.fill();
}
</script>
</head>
<body>
<div><canvas id="c1" width="300" height="300"></canvas></div>
</body>
</html>

View File

@ -0,0 +1,26 @@
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var ctx = document.getElementById("c1").getContext("2d");
ctx.moveTo(50, 50);
ctx.lineTo(250, 50);
ctx.lineTo(250, 250);
ctx.lineTo(50, 250);
ctx.lineTo(50, 50);
ctx.moveTo(100, 100);
ctx.lineTo(100, 200);
ctx.lineTo(200, 200);
ctx.lineTo(200, 100);
ctx.lineTo(100, 100);
ctx.fill();
}
</script>
</head>
<body>
<div><canvas id="c1" width="300" height="300"></canvas></div>
</body>
</html>

View File

@ -47,3 +47,9 @@ fails-if(Android) != text-font-lang.html text-font-lang-notref.html
fails-if(cocoaWidget) == linear-gradient-1b.html linear-gradient-1-ref.html
== zero-dimensions.html zero-dimensions-ref.html
== evenodd-fill-sanity.html data:text/html,<body>Pass
!= evenodd-fill-1.html nonzero-fill-1.html
== evenodd-fill-1.html evenodd-fill-ref.html
== evenodd-fill-2.html evenodd-fill-ref.html
== evenodd-fill-3.html nonzero-fill-2.html

View File

@ -647,7 +647,7 @@ pref("browser.safebrowsing.malware.reportURL", "http://safebrowsing.clients.goog
// True if this is the first time we are showing about:firstrun
pref("browser.firstrun.show.uidiscovery", true);
pref("browser.firstrun.show.localepicker", false);
pref("browser.firstrun.show.localepicker", true);
// initiated by a user
pref("content.ime.strict_policy", true);

View File

@ -162,7 +162,7 @@ let Util = {
},
isTablet: function isTablet() {
let dpi = Util.getWindowUtils(window).displayDPI;
let dpi = this.displayDPI;
if (dpi <= 96)
return (window.innerWidth > 1024);
@ -188,6 +188,12 @@ let Util = {
return ViewableAreaObserver.isKeyboardOpened;
return (sendSyncMessage("Content:IsKeyboardOpened", {}))[0];
},
// because this uses the global window, will only work in the parent process
get displayDPI() function() {
delete this.displayDPI;
return this.displayDPI = this.getWindowUtils(window).displayDPI;
}
};

View File

@ -364,7 +364,7 @@ var BrowserUI = {
return true;
case -1: {
let threshold = Services.prefs.getIntPref("widget.ime.android.fullscreen_threshold");
let dpi = Util.getWindowUtils(window).displayDPI;
let dpi = Util.displayDPI;
return (window.innerHeight * 100 < threshold * dpi);
}
}

View File

@ -1112,7 +1112,7 @@ var Browser = {
if (prefValue > 0)
return prefValue / 100;
let dpi = this.windowUtils.displayDPI;
let dpi = Utils.displayDPI;
if (dpi < 200) // Includes desktop displays, and LDPI and MDPI Android devices
return 1;
else if (dpi < 300) // Includes Nokia N900, and HDPI Android devices
@ -1809,7 +1809,7 @@ const ContentTouchHandler = {
panningPrevented: false,
updateCanCancel: function(aX, aY) {
let dpi = Browser.windowUtils.displayDPI;
let dpi = Utils.displayDPI;
const kSafetyX = Services.prefs.getIntPref("dom.w3c_touch_events.safetyX") / 240 * dpi;
const kSafetyY = Services.prefs.getIntPref("dom.w3c_touch_events.safetyY") / 240 * dpi;

View File

@ -68,7 +68,11 @@ const ElementTouchHelper = {
/* Retrieve the closest element to a point by looking at borders position */
getClosest: function getClosest(aWindowUtils, aX, aY) {
let dpiRatio = aWindowUtils.displayDPI / kReferenceDpi;
// cached for the child process, since Utils.displayDPI is only available in the parent
if (!this.dpiRatio)
this.dpiRatio = aWindowUtils.displayDPI / kReferenceDpi;
let dpiRatio = this.dpiRatio;
let target = aWindowUtils.elementFromPoint(aX, aY,
true, /* ignore root scroll frame*/

View File

@ -118,7 +118,7 @@ function MouseModule() {
this._mouseOverTimeout = new Util.Timeout(this._doMouseOver.bind(this));
this._longClickTimeout = new Util.Timeout(this._doLongClick.bind(this));
this._doubleClickRadius = Util.getWindowUtils(window).displayDPI * kDoubleClickRadius;
this._doubleClickRadius = Util.displayDPI * kDoubleClickRadius;
window.addEventListener("mousedown", this, true);
window.addEventListener("mouseup", this, true);
@ -570,7 +570,7 @@ MouseModule.prototype = {
var ScrollUtils = {
// threshold in pixels for sensing a tap as opposed to a pan
get tapRadius() {
let dpi = Util.getWindowUtils(window).displayDPI;
let dpi = Util.displayDPI;
delete this.tapRadius;
return this.tapRadius = Services.prefs.getIntPref("ui.dragThresholdX") / 240 * dpi;
@ -686,7 +686,7 @@ var ScrollUtils = {
*/
function DragData() {
this._domUtils = Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
this._lockRevertThreshold = Util.getWindowUtils(window).displayDPI * kAxisLockRevertThreshold;
this._lockRevertThreshold = Util.displayDPI * kAxisLockRevertThreshold;
this.reset();
};

View File

@ -148,7 +148,7 @@ function tab_on_undo() {
let undoBox = document.getElementById("tabs")._tabsUndo;
is(undoBox.firstChild, null, "It should be no tab in the undo box");
Browser.loadURI("about:firstrun");
Browser.loadURI("about:home");
is(undoBox.firstChild, null, "It should be no tab in the undo box when opening a new local page");
// loadURI will open a new tab so ensure new_tab_05 point to the newly opened tab

View File

@ -120,12 +120,6 @@ AboutEmpty.prototype = {
classID: Components.ID("{433d2d75-5923-49b0-854d-f37267b03dc7}")
}
function AboutFirstrun() {}
AboutFirstrun.prototype = {
__proto__: AboutGeneric.prototype,
classID: Components.ID("{077ea23e-0f22-4168-a744-8e444b560197}")
}
function AboutFennec() {}
AboutFennec.prototype = {
__proto__: AboutGeneric.prototype,
@ -162,6 +156,6 @@ AboutBlocked.prototype = {
classID: Components.ID("{88fd40b6-c5c2-4120-9238-f2cb9ff98928}")
}
const components = [AboutEmpty, AboutFirstrun, AboutFennec, AboutRights,
const components = [AboutEmpty, AboutFennec, AboutRights,
AboutCertError, AboutFirefox, AboutHome, AboutBlocked];
const NSGetFactory = XPCOMUtils.generateNSGetFactory(components);

View File

@ -1,8 +1,6 @@
# AboutRedirector.js
component {433d2d75-5923-49b0-854d-f37267b03dc7} AboutRedirector.js
contract @mozilla.org/network/protocol/about;1?what=empty {433d2d75-5923-49b0-854d-f37267b03dc7}
component {077ea23e-0f22-4168-a744-8e444b560197} AboutRedirector.js
contract @mozilla.org/network/protocol/about;1?what=firstrun {077ea23e-0f22-4168-a744-8e444b560197}
component {842a6d11-b369-4610-ba66-c3b5217e82be} AboutRedirector.js
contract @mozilla.org/network/protocol/about;1?what=fennec {842a6d11-b369-4610-ba66-c3b5217e82be}
component {dd40c467-d206-4f22-9215-8fcc74c74e38} AboutRedirector.js

View File

@ -11,10 +11,6 @@
# title for the folder that will contains the default bookmarks
#define bookmarks_title Mobile
# LOCALIZATION NOTE (bookmarks_welcome):
# link title for about:firstrun
#define bookmarks_welcome Firefox: Welcome
# LOCALIZATION NOTE (bookmarks_aboutBrowser):
# link title for about:fennec
#define bookmarks_aboutBrowser Firefox: About your browser

View File

@ -3,9 +3,6 @@
[{"type":"text/x-moz-place-container","title":"@bookmarks_title@","annos":[{"name":"mobile/bookmarksRoot","expires":4,"type":1,"value":1}],
"children":
[
{ "title":"@bookmarks_welcome@", "type":"text/x-moz-place", "uri":"about:firstrun",
"iconUri":"chrome://branding/content/favicon32.png"
},
{"index":1,"title":"@bookmarks_aboutBrowser@", "type":"text/x-moz-place", "uri":"about:firefox",
"iconUri":"chrome://branding/content/favicon32.png"
},

View File

@ -226,6 +226,8 @@ nsresult imgRequest::Init(nsIURI *aURI,
mKeyURI = aKeyURI;
mRequest = aRequest;
mChannel = aChannel;
mTimedChannel = do_QueryInterface(mChannel);
mChannel->GetNotificationCallbacks(getter_AddRefs(mPrevChannelSink));
NS_ASSERTION(mPrevChannelSink != this,
@ -956,6 +958,7 @@ NS_IMETHODIMP imgRequest::OnStopRequest(nsIRequest *aRequest, nsISupports *ctxt,
statusTracker.SendStopRequest(srIter.GetNext(), lastPart, status);
}
mTimedChannel = nsnull;
return NS_OK;
}
@ -1277,6 +1280,7 @@ imgRequest::OnRedirectVerifyCallback(nsresult result)
}
mChannel = mNewRedirectChannel;
mTimedChannel = do_QueryInterface(mChannel);
mNewRedirectChannel = nsnull;
// Don't make any cache changes if we're going to point to the same thing. We

View File

@ -51,6 +51,7 @@
#include "nsIStreamListener.h"
#include "nsIURI.h"
#include "nsIPrincipal.h"
#include "nsITimedChannel.h"
#include "nsCategoryCache.h"
#include "nsCOMPtr.h"
@ -219,6 +220,8 @@ private:
nsTObserverArray<imgRequestProxy*> mObservers;
nsCOMPtr<nsITimedChannel> mTimedChannel;
nsCString mContentType;
nsRefPtr<imgCacheEntry> mCacheEntry; /* we hold on to this to this so long as we have observers */

View File

@ -57,8 +57,17 @@
using namespace mozilla::imagelib;
NS_IMPL_ISUPPORTS4(imgRequestProxy, imgIRequest, nsIRequest,
nsISupportsPriority, nsISecurityInfoProvider)
NS_IMPL_ADDREF(imgRequestProxy)
NS_IMPL_RELEASE(imgRequestProxy)
NS_INTERFACE_MAP_BEGIN(imgRequestProxy)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, imgIRequest)
NS_INTERFACE_MAP_ENTRY(imgIRequest)
NS_INTERFACE_MAP_ENTRY(nsIRequest)
NS_INTERFACE_MAP_ENTRY(nsISupportsPriority)
NS_INTERFACE_MAP_ENTRY(nsISecurityInfoProvider)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsITimedChannel, TimedChannel() != nsnull)
NS_INTERFACE_MAP_END
imgRequestProxy::imgRequestProxy() :
mOwner(nsnull),

View File

@ -48,6 +48,7 @@
#include "nsIChannel.h"
#include "nsILoadGroup.h"
#include "nsISupportsPriority.h"
#include "nsITimedChannel.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsThreadUtils.h"
@ -71,7 +72,10 @@ class Image;
} // namespace imagelib
} // namespace mozilla
class imgRequestProxy : public imgIRequest, public nsISupportsPriority, public nsISecurityInfoProvider
class imgRequestProxy : public imgIRequest,
public nsISupportsPriority,
public nsISecurityInfoProvider,
public nsITimedChannel
{
public:
NS_DECL_ISUPPORTS
@ -79,6 +83,7 @@ public:
NS_DECL_NSIREQUEST
NS_DECL_NSISUPPORTSPRIORITY
NS_DECL_NSISECURITYINFOPROVIDER
// nsITimedChannel declared below
imgRequestProxy();
virtual ~imgRequestProxy();
@ -196,6 +201,16 @@ protected:
// (b) whether mOwner has instantiated its image yet
imgStatusTracker& GetStatusTracker();
nsITimedChannel* TimedChannel()
{
if (!mOwner)
return nsnull;
return mOwner->mTimedChannel;
}
public:
NS_FORWARD_SAFE_NSITIMEDCHANNEL(TimedChannel())
private:
friend class imgCacheValidator;

View File

@ -344,6 +344,9 @@ struct ParamTraits<PRNetAddr>
WriteParam(aMsg, aParam.ipv6.scope_id);
#if defined(XP_UNIX) || defined(XP_OS2)
} else if (aParam.raw.family == PR_AF_LOCAL) {
// Train's already off the rails: let's get a stack trace at least...
NS_RUNTIMEABORT("Error: please post stack trace to "
"https://bugzilla.mozilla.org/show_bug.cgi?id=661158");
aMsg->WriteBytes(aParam.local.path, sizeof(aParam.local.path));
#endif
}

View File

@ -87,6 +87,10 @@ HttpBaseChannel::HttpBaseChannel()
// grab a reference to the handler to ensure that it doesn't go away.
NS_ADDREF(gHttpHandler);
// Subfields of unions cannot be targeted in an initializer list
mSelfAddr.raw.family = PR_AF_UNSPEC;
mPeerAddr.raw.family = PR_AF_UNSPEC;
}
HttpBaseChannel::~HttpBaseChannel()

View File

@ -138,9 +138,6 @@ nsHttpChannel::nsHttpChannel()
LOG(("Creating nsHttpChannel [this=%p]\n", this));
mChannelCreationTime = PR_Now();
mChannelCreationTimestamp = mozilla::TimeStamp::Now();
// Subfields of unions cannot be targeted in an initializer list
mSelfAddr.raw.family = PR_AF_UNSPEC;
mPeerAddr.raw.family = PR_AF_UNSPEC;
}
nsHttpChannel::~nsHttpChannel()