aboutsummaryrefslogtreecommitdiff
path: root/autofill-parser/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'autofill-parser/src/main')
-rw-r--r--autofill-parser/src/main/assets/publicsuffixesbin205216 -> 109555 bytes
-rw-r--r--autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoader.kt7
2 files changed, 5 insertions, 2 deletions
diff --git a/autofill-parser/src/main/assets/publicsuffixes b/autofill-parser/src/main/assets/publicsuffixes
index c12128bd..39d8a034 100644
--- a/autofill-parser/src/main/assets/publicsuffixes
+++ b/autofill-parser/src/main/assets/publicsuffixes
Binary files differ
diff --git a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoader.kt b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoader.kt
index 5f3fc296..8491030d 100644
--- a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoader.kt
+++ b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoader.kt
@@ -16,8 +16,8 @@ private const val PUBLIC_SUFFIX_LIST_FILE = "publicsuffixes"
internal object PublicSuffixListLoader {
- fun load(context: Context): PublicSuffixListData =
- context.assets.open(PUBLIC_SUFFIX_LIST_FILE).buffered().use { stream ->
+ fun load(inputStream: BufferedInputStream): PublicSuffixListData =
+ inputStream.use { stream ->
val publicSuffixSize = stream.readInt()
val publicSuffixBytes = stream.readFully(publicSuffixSize)
@@ -26,6 +26,9 @@ internal object PublicSuffixListLoader {
PublicSuffixListData(publicSuffixBytes, exceptionBytes)
}
+
+ fun load(context: Context): PublicSuffixListData =
+ load(context.assets.open(PUBLIC_SUFFIX_LIST_FILE).buffered())
}
@Suppress("MagicNumber")