Bug 1298968 - Add comment explaining why TOPSITES is handled outside of switch r=sebastian

MozReview-Commit-ID: BFvz2qTm4vL

--HG--
extra : rebase_source : 8d4e77baf5c629c0d16f97c7135fd4c85bf5a5b5
This commit is contained in:
Andrzej Hunt 2016-09-06 10:06:58 -07:00
parent 9f2ce6ecc0
commit b79a5e8eec

View File

@ -1211,6 +1211,10 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
String[] selectionArgs, String sortOrder) {
final int match = URI_MATCHER.match(uri);
// Handle only queries requiring a writable DB connection here: most queries need only a readable
// connection, hence we can get a readable DB once, and then handle most queries within a switch.
// TopSites requires a writable connection (because of the temporary tables it uses), hence
// we handle that separately, i.e. before retrieving a readable connection.
if (match == TOPSITES) {
if (uri.getBooleanQueryParameter(BrowserContract.PARAM_TOPSITES_DISABLE_PINNED, false)) {
return getPlainTopSites(uri);