Backed out 3 changesets (bug 1093172) for robocop failures.

Backed out changeset 8d1c3083f7e6 (bug 1093172)
Backed out changeset 4fa27d0105df (bug 1093172)
Backed out changeset c85c0a37dcb9 (bug 1093172)
This commit is contained in:
Ryan VanderMeulen 2014-12-19 23:51:18 -05:00
Родитель 18688ffd87
Коммит 4415636429
6 изменённых файлов: 4 добавлений и 54 удалений

Просмотреть файл

@ -96,7 +96,6 @@ public final class ReadingListHelper implements GeckoEventListener, NativeEventL
values.put(ReadingListItems.TITLE, message.optString("title"));
values.put(ReadingListItems.LENGTH, message.optInt("length"));
values.put(ReadingListItems.EXCERPT, message.optString("excerpt"));
values.put(ReadingListItems.CONTENT_STATUS, message.optInt("status"));
BrowserDB.addReadingListItem(cr, values);
showToast(R.string.reading_list_added, Toast.LENGTH_SHORT);

Просмотреть файл

@ -352,16 +352,6 @@ public class BrowserContract {
public static final String EXCERPT = "excerpt";
public static final String READ = "read";
public static final String LENGTH = "length";
public static final String CONTENT_STATUS = "content_status";
// CONTENT_STATUS represents the result of an attempt to fetch content for the reading list item.
public static final int STATUS_UNFETCHED = 0;
public static final int STATUS_FETCH_FAILED_TEMPORARY = 1;
public static final int STATUS_FETCH_FAILED_PERMANENT = 2;
public static final int STATUS_FETCH_FAILED_UNSUPPORTED_FORMAT = 3;
public static final int STATUS_FETCHED_ARTICLE = 4;
public static final String DEFAULT_SORT_ORDER = DATE_MODIFIED + " DESC";
public static final String[] DEFAULT_PROJECTION = new String[] { _ID, URL, TITLE, EXCERPT, LENGTH };

Просмотреть файл

@ -33,7 +33,7 @@ import android.util.Log;
final class BrowserDatabaseHelper extends SQLiteOpenHelper {
private static final String LOGTAG = "GeckoBrowserDBHelper";
public static final int DATABASE_VERSION = 22;
public static final int DATABASE_VERSION = 21;
public static final String DATABASE_NAME = "browser.db";
final protected Context mContext;
@ -324,15 +324,12 @@ final class BrowserDatabaseHelper extends SQLiteOpenHelper {
ReadingListItems.GUID + " TEXT UNIQUE NOT NULL, " +
ReadingListItems.DATE_MODIFIED + " INTEGER NOT NULL, " +
ReadingListItems.DATE_CREATED + " INTEGER NOT NULL, " +
ReadingListItems.LENGTH + " INTEGER DEFAULT 0, " +
ReadingListItems.CONTENT_STATUS + " TINYINT DEFAULT " + ReadingListItems.STATUS_UNFETCHED + "); ");
ReadingListItems.LENGTH + " INTEGER DEFAULT 0 ); ");
db.execSQL("CREATE INDEX reading_list_url ON " + TABLE_READING_LIST + "("
+ ReadingListItems.URL + ")");
db.execSQL("CREATE UNIQUE INDEX reading_list_guid ON " + TABLE_READING_LIST + "("
+ ReadingListItems.GUID + ")");
db.execSQL("CREATE INDEX reading_list_content_status ON " + TABLE_READING_LIST + "("
+ ReadingListItems.CONTENT_STATUS + ")");
}
private void createOrUpdateAllSpecialFolders(SQLiteDatabase db) {
@ -764,17 +761,6 @@ final class BrowserDatabaseHelper extends SQLiteOpenHelper {
createSearchHistoryTable(db);
}
private void upgradeDatabaseFrom21to22(SQLiteDatabase db) {
debug("Adding CONTENT_STATUS column to reading list table.");
db.execSQL("ALTER TABLE " + TABLE_READING_LIST +
" ADD COLUMN " + ReadingListItems.CONTENT_STATUS +
" TINYINT DEFAULT " + ReadingListItems.STATUS_UNFETCHED);
db.execSQL("CREATE INDEX reading_list_content_status ON " + TABLE_READING_LIST + "("
+ ReadingListItems.CONTENT_STATUS + ")");
}
private void createV19CombinedView(SQLiteDatabase db) {
db.execSQL("DROP VIEW IF EXISTS " + VIEW_COMBINED);
db.execSQL("DROP VIEW IF EXISTS " + VIEW_COMBINED_WITH_FAVICONS);
@ -838,10 +824,6 @@ final class BrowserDatabaseHelper extends SQLiteOpenHelper {
case 20:
upgradeDatabaseFrom19to20(db);
break;
case 22:
upgradeDatabaseFrom21to22(db);
break;
}
}

Просмотреть файл

@ -91,10 +91,6 @@ public class testReadingListProvider extends ContentProviderTest {
try {
mAsserter.ok(c.moveToFirst(), "Inserted item found", "");
assertRowEqualsContentValues(c, b);
mAsserter.is(c.getInt(c.getColumnIndex(ReadingListItems.CONTENT_STATUS)),
ReadingListItems.STATUS_UNFETCHED,
"Inserted item has correct default content status");
} finally {
c.close();
}

Просмотреть файл

@ -5,14 +5,6 @@
"use strict";
let Reader = {
// These values should match those defined in BrowserContract.java
STATUS_UNFETCHED: 0,
STATUS_FETCH_FAILED_TEMPORARY: 1,
STATUS_FETCH_FAILED_PERMANENT: 2,
STATUS_FETCH_FAILED_UNSUPPORTED_FORMAT: 3,
STATUS_FETCHED_ARTICLE: 4,
get isEnabledForParseOnLoad() {
delete this.isEnabledForParseOnLoad;
@ -100,13 +92,7 @@ let Reader = {
if (!article) {
// If there was a problem getting the article, just store the
// URL and title from the tab.
article = {
url: urlWithoutRef,
title: tab.browser.contentDocument.title,
status: this.STATUS_FETCH_FAILED_UNSUPPORTED_FORMAT,
};
} else {
article.status = this.STATUS_FETCHED_ARTICLE;
article = { url: urlWithoutRef, title: tab.browser.contentDocument.title };
}
this.addArticleToReadingList(article);
@ -124,7 +110,6 @@ let Reader = {
title: truncate(article.title || "", MAX_TITLE_LENGTH),
length: article.length || 0,
excerpt: article.excerpt || "",
status: article.status,
});
ReaderMode.storeArticleInCache(article).catch(e => Cu.reportError("Error storing article in cache: " + e));
@ -261,7 +246,7 @@ let Reader = {
});
for (let article of articles) {
yield this.storeArticleInCache(article);
yield ReaderMode.storeArticleInCache(article);
}
// Delete the database.

Просмотреть файл

@ -309,8 +309,6 @@ AboutReader.prototype = {
return;
if (this._isReadingListItem == 0) {
// If we're in reader mode, we must have fetched the article.
this._article.status = gChromeWin.Reader.STATUS_FETCHED_ARTICLE;
gChromeWin.Reader.addArticleToReadingList(this._article);
UITelemetry.addEvent("save.1", "button", null, "reader");