Bug 1265708 - Pre: make getForURLs arguments more generic r?sebastian
MozReview-Commit-ID: IkPiLVB5mop
--- a/mobile/android/base/java/org/mozilla/gecko/db/LocalURLMetadata.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/LocalURLMetadata.java
@@ -1,16 +1,17 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.mozilla.gecko.db;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -119,17 +120,17 @@ public class LocalURLMetadata implements
}
/**
* Returns an unmodifiable Map of url->Metadata (i.e. A second HashMap) for a list of urls.
* Must not be called from UI or Gecko threads.
*/
@Override
public Map<String, Map<String, Object>> getForURLs(final ContentResolver cr,
- final List<String> urls,
+ final Collection<String> urls,
final List<String> requestedColumns) {
ThreadUtils.assertNotOnUiThread();
ThreadUtils.assertNotOnGeckoThread();
final Map<String, Map<String, Object>> data = new HashMap<String, Map<String, Object>>();
// Nothing to query for
if (urls.isEmpty() || requestedColumns.isEmpty()) {
--- a/mobile/android/base/java/org/mozilla/gecko/db/StubBrowserDB.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/StubBrowserDB.java
@@ -39,17 +39,17 @@ class StubURLMetadata implements URLMeta
public StubURLMetadata() {
}
public Map<String, Object> fromJSON(JSONObject obj) {
return new HashMap<String, Object>();
}
public Map<String, Map<String, Object>> getForURLs(final ContentResolver cr,
- final List<String> urls,
+ final Collection<String> urls,
final List<String> columns) {
return new HashMap<String, Map<String, Object>>();
}
public void save(final ContentResolver cr, final Map<String, Object> data) {
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/db/URLMetadata.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/URLMetadata.java
@@ -1,21 +1,22 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.mozilla.gecko.db;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.json.JSONObject;
import android.content.ContentResolver;
public interface URLMetadata {
public Map<String, Object> fromJSON(JSONObject obj);
public Map<String, Map<String, Object>> getForURLs(final ContentResolver cr,
- final List<String> urls,
+ final Collection<String> urls,
final List<String> columns);
public void save(final ContentResolver cr, final Map<String, Object> data);
}