Back out sdwilsh's patch for bug 393303 as a last ditch effort to fix the perf regression.
git-svn-id: svn://10.0.0.236/trunk@240185 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -62,7 +62,6 @@ interface nsIDownloadManager : nsISupports {
|
||||
const short DOWNLOAD_QUEUED = 5;
|
||||
const short DOWNLOAD_BLOCKED = 6;
|
||||
const short DOWNLOAD_SCANNING = 7;
|
||||
const short DOWNLOAD_DIRTY = 8;
|
||||
|
||||
const short DOWNLOAD_TYPE_DOWNLOAD = 0;
|
||||
|
||||
|
||||
@@ -1372,7 +1372,6 @@ nsDownloadManager::RetryDownload(PRUint32 aID)
|
||||
// if our download is not canceled or failed, we should fail
|
||||
if (dl->mDownloadState != nsIDownloadManager::DOWNLOAD_FAILED &&
|
||||
dl->mDownloadState != nsIDownloadManager::DOWNLOAD_BLOCKED &&
|
||||
dl->mDownloadState != nsIDownloadManager::DOWNLOAD_DIRTY &&
|
||||
dl->mDownloadState != nsIDownloadManager::DOWNLOAD_CANCELED)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
@@ -1446,8 +1445,7 @@ nsDownloadManager::CleanUp()
|
||||
DownloadState states[] = { nsIDownloadManager::DOWNLOAD_FINISHED,
|
||||
nsIDownloadManager::DOWNLOAD_FAILED,
|
||||
nsIDownloadManager::DOWNLOAD_CANCELED,
|
||||
nsIDownloadManager::DOWNLOAD_BLOCKED,
|
||||
nsIDownloadManager::DOWNLOAD_DIRTY };
|
||||
nsIDownloadManager::DOWNLOAD_BLOCKED };
|
||||
|
||||
nsCOMPtr<mozIStorageStatement> stmt;
|
||||
nsresult rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING(
|
||||
@@ -1455,10 +1453,9 @@ nsDownloadManager::CleanUp()
|
||||
"WHERE state = ?1 "
|
||||
"OR state = ?2 "
|
||||
"OR state = ?3 "
|
||||
"OR state = ?4 "
|
||||
"OR state = ?5"), getter_AddRefs(stmt));
|
||||
"OR state = ?4"), getter_AddRefs(stmt));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(states); ++i) {
|
||||
for (PRUint32 i = 0; i < 4; ++i) {
|
||||
rv = stmt->BindInt32Parameter(i, states[i]);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
@@ -1480,8 +1477,7 @@ nsDownloadManager::GetCanCleanUp(PRBool *aResult)
|
||||
DownloadState states[] = { nsIDownloadManager::DOWNLOAD_FINISHED,
|
||||
nsIDownloadManager::DOWNLOAD_FAILED,
|
||||
nsIDownloadManager::DOWNLOAD_CANCELED,
|
||||
nsIDownloadManager::DOWNLOAD_BLOCKED,
|
||||
nsIDownloadManager::DOWNLOAD_DIRTY };
|
||||
nsIDownloadManager::DOWNLOAD_BLOCKED };
|
||||
|
||||
nsCOMPtr<mozIStorageStatement> stmt;
|
||||
nsresult rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING(
|
||||
@@ -1490,10 +1486,9 @@ nsDownloadManager::GetCanCleanUp(PRBool *aResult)
|
||||
"WHERE state = ?1 "
|
||||
"OR state = ?2 "
|
||||
"OR state = ?3 "
|
||||
"OR state = ?4 "
|
||||
"OR state = ?5"), getter_AddRefs(stmt));
|
||||
"OR state = ?4"), getter_AddRefs(stmt));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(states); ++i) {
|
||||
for (PRUint32 i = 0; i < 4; ++i) {
|
||||
rv = stmt->BindInt32Parameter(i, states[i]);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
@@ -1757,7 +1752,6 @@ nsDownload::SetState(DownloadState aState)
|
||||
// dispatch to the observers as well.
|
||||
switch (aState) {
|
||||
case nsIDownloadManager::DOWNLOAD_BLOCKED:
|
||||
case nsIDownloadManager::DOWNLOAD_DIRTY:
|
||||
case nsIDownloadManager::DOWNLOAD_CANCELED:
|
||||
case nsIDownloadManager::DOWNLOAD_FAILED:
|
||||
// Transfers are finished, so break the reference cycle
|
||||
@@ -1889,8 +1883,6 @@ nsDownload::SetState(DownloadState aState)
|
||||
case nsIDownloadManager::DOWNLOAD_BLOCKED:
|
||||
mDownloadManager->SendEvent(this, "dl-blocked");
|
||||
break;
|
||||
case nsIDownloadManager::DOWNLOAD_DIRTY:
|
||||
mDownloadManager->SendEvent(this, "dl-dirty");
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ nsDownloadScanner::Scan::Run()
|
||||
DownloadState downloadState = 0;
|
||||
switch (mStatus) {
|
||||
case AVSCAN_BAD:
|
||||
downloadState = nsIDownloadManager::DOWNLOAD_DIRTY;
|
||||
downloadState = nsIDownloadManager::DOWNLOAD_BLOCKED;
|
||||
break;
|
||||
default:
|
||||
case AVSCAN_FAILED:
|
||||
|
||||
@@ -66,7 +66,6 @@ stateFailed=Failed
|
||||
stateCanceled=Canceled
|
||||
# LOCALIZATION NOTE (stateBlocked): 'Parental Controls' should be capitalized
|
||||
stateBlocked=Blocked by Parental Controls
|
||||
stateDirty=Blocked: Download may contain a virus or spyware
|
||||
|
||||
fileDoesNotExistOpenTitle=Cannot Open %S
|
||||
fileDoesNotExistShowTitle=Cannot Show %S
|
||||
|
||||
@@ -70,7 +70,6 @@ DownloadProgressListener.prototype = {
|
||||
case nsIDM.DOWNLOAD_FAILED:
|
||||
case nsIDM.DOWNLOAD_CANCELED:
|
||||
case nsIDM.DOWNLOAD_BLOCKED:
|
||||
case nsIDM.DOWNLOAD_DIRTY:
|
||||
case nsIDM.DOWNLOAD_FINISHED:
|
||||
downloadCompleted(aDownload);
|
||||
if (state == nsIDM.DOWNLOAD_FINISHED)
|
||||
|
||||
@@ -89,7 +89,17 @@
|
||||
return state == dl.DOWNLOAD_FINISHED ||
|
||||
state == dl.DOWNLOAD_CANCELED ||
|
||||
state == dl.DOWNLOAD_BLOCKED ||
|
||||
state == dl.DOWNLOAD_DIRTY ||
|
||||
state == dl.DOWNLOAD_FAILED;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
<property name="canceledOrFailed">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
var state = parseInt(this.getAttribute("state"));
|
||||
var dl = Components.interfaces.nsIDownloadManager;
|
||||
return state == dl.DOWNLOAD_CANCELED ||
|
||||
state == dl.DOWNLOAD_BLOCKED ||
|
||||
state == dl.DOWNLOAD_FAILED;
|
||||
]]>
|
||||
</getter>
|
||||
@@ -309,31 +319,4 @@
|
||||
</xul:hbox>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="download-dirty" extends="chrome://mozapps/content/downloads/download.xml#download-base">
|
||||
<content>
|
||||
<xul:hbox flex="1">
|
||||
<xul:vbox pack="start">
|
||||
<xul:image class="downloadTypeIcon blockedIcon"/>
|
||||
</xul:vbox>
|
||||
<xul:vbox pack="start" flex="1">
|
||||
<xul:label xbl:inherits="value=target,tooltiptext=target"
|
||||
crop="center" class="name"/>
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:label xbl:inherits="value=status,tooltiptext=status" flex="1"
|
||||
crop="right" class="status"/>
|
||||
</xul:vbox>
|
||||
<xul:vbox pack="center">
|
||||
<xul:hbox>
|
||||
<xul:button class="retry mini-button" tooltiptext="&cmd.retry.label;"
|
||||
command="cmd_retry" ondblclick="event.stopPropagation();"/>
|
||||
<xul:button class="info mini-button" tooltiptext="&cmd.info.label;"
|
||||
command="cmd_showInfo" ondblclick="event.stopPropagation();"
|
||||
anonid="info"/>
|
||||
</xul:hbox>
|
||||
</xul:vbox>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
||||
@@ -31,10 +31,6 @@ richlistitem[type="download"][state="7"] {
|
||||
-moz-binding: url('chrome://mozapps/content/downloads/download.xml#download-scanning');
|
||||
}
|
||||
|
||||
richlistitem[type="download"][state="8"] {
|
||||
-moz-binding: url('chrome://mozapps/content/downloads/download.xml#download-dirty');
|
||||
}
|
||||
|
||||
/* Only focus buttons in the selected item*/
|
||||
richlistitem[type="download"]:not([selected="true"]) button {
|
||||
-moz-user-focus: none;
|
||||
|
||||
@@ -91,7 +91,6 @@ let gStr = {
|
||||
stateFailed: "stateFailed",
|
||||
stateCanceled: "stateCanceled",
|
||||
stateBlocked: "stateBlocked",
|
||||
stateDirty: "stateDirty",
|
||||
|
||||
units: ["bytes", "kilobyte", "megabyte", "gigabyte"],
|
||||
|
||||
@@ -305,7 +304,6 @@ function onDownloadDblClick(aEvent)
|
||||
break;
|
||||
case nsIDM.DOWNLOAD_CANCELED:
|
||||
case nsIDM.DOWNLOAD_BLOCKED:
|
||||
case nsIDM.DOWNLOAD_DIRTY:
|
||||
case nsIDM.DOWNLOAD_FAILED:
|
||||
gDownloadViewController.doCommand("cmd_retry");
|
||||
break;
|
||||
@@ -540,10 +538,7 @@ var gContextMenus = [
|
||||
["menuitem_retry", "menuitem_removeFromList", "menuitem_clearList",
|
||||
"menuseparator_copy_location", "menuitem_copyLocation"],
|
||||
// DOWNLOAD_SCANNING
|
||||
["menuitem_copyLocation"],
|
||||
// DOWNLOAD_DIRTY
|
||||
["menuitem_retry", "menuitem_removeFromList", "menuitem_clearList",
|
||||
"menuseparator_copy_location", "menuitem_copyLocation"]
|
||||
["menuitem_copyLocation"]
|
||||
];
|
||||
|
||||
function buildContextMenu(aEvent)
|
||||
@@ -836,7 +831,6 @@ function updateStatus(aItem, aDownload) {
|
||||
case nsIDM.DOWNLOAD_FAILED:
|
||||
case nsIDM.DOWNLOAD_CANCELED:
|
||||
case nsIDM.DOWNLOAD_BLOCKED:
|
||||
case nsIDM.DOWNLOAD_DIRTY:
|
||||
let (stateSize = {}) {
|
||||
stateSize[nsIDM.DOWNLOAD_FINISHED] = function() {
|
||||
// Display the file size, but show "Unknown" for negative sizes
|
||||
@@ -852,7 +846,6 @@ function updateStatus(aItem, aDownload) {
|
||||
stateSize[nsIDM.DOWNLOAD_FAILED] = function() gStr.stateFailed;
|
||||
stateSize[nsIDM.DOWNLOAD_CANCELED] = function() gStr.stateCanceled;
|
||||
stateSize[nsIDM.DOWNLOAD_BLOCKED] = function() gStr.stateBlocked;
|
||||
stateSize[nsIDM.DOWNLOAD_DIRTY] = function() gStr.stateDirty;
|
||||
|
||||
// Insert 1 is the download size or download state
|
||||
status = replaceInsert(gStr.doneStatus, 1, stateSize[state]());
|
||||
@@ -1082,7 +1075,7 @@ function buildDownloadListWithTime(aTime)
|
||||
var stmt = gDownloadListWithTimeQuery;
|
||||
if (!stmt) {
|
||||
stmt = db.createStatement(replaceInsert(gBaseQuery, 1, "startTime >= ?1 " +
|
||||
"AND (state = ?2 OR state = ?3 OR state = ?4 OR state = ?5 OR state = ?6)"));
|
||||
"AND (state = ?2 OR state = ?3 OR state = ?4 OR state = ?5)"));
|
||||
gDownloadListWithTimeQuery = stmt;
|
||||
}
|
||||
|
||||
@@ -1092,7 +1085,6 @@ function buildDownloadListWithTime(aTime)
|
||||
stmt.bindInt32Parameter(2, nsIDM.DOWNLOAD_FAILED);
|
||||
stmt.bindInt32Parameter(3, nsIDM.DOWNLOAD_CANCELED);
|
||||
stmt.bindInt32Parameter(4, nsIDM.DOWNLOAD_BLOCKED);
|
||||
stmt.bindInt32Parameter(5, nsIDM.DOWNLOAD_DIRTY);
|
||||
buildDownloadList(stmt, gDownloadsDoneArea);
|
||||
} finally {
|
||||
stmt.reset();
|
||||
|
||||
Reference in New Issue
Block a user