Commit graph

27 commits

Author SHA1 Message Date
Lina Cambridge
c64f248f76 [components] Pass redirect source and target flags to history tracking delegates.
There's some confusion in `GeckoEngineSession` about redirect flags.
The `VISIT_REDIRECT_SOURCE` and `VISIT_REDIRECT_SOURCE_PERMANENT` flags
that we get from GeckoView's history delegate are for the redirect
_source_, not the visit type. They indicate if the URL passed to
`onVisited` is redirecting _to_ another URL, most likely because the
server returned an HTTP 3xy status code with a `Location` header.
Rust Places decides whether to mark the URL as hidden based on
these flags.

`VISIT_REDIRECT_{PERMANENT, TEMPORARY}`, however, indicate if the
URL passed to `onVisited` is the _target_ of a redirect (in other
words, the page that's _in_ the `Location` header). These get
translated into `VisitType` flags, which Rust Places stores as the
visit transition type. These two flags don't affect whether a URL
is hidden.

Note that, in a redirect chain, the middle links are both sources and
targets. For example, in "mozilla.org" -> "www.mozilla.org" ->
"www.mozilla.org/en-US", "www.mozilla.org" is both a redirect target
(since "mozilla.org" redirected to it), and a source (it redirected
to "www.mozilla.org/en-US").

See https://github.com/mozilla-mobile/fenix/issues/3526.
2019-10-11 21:41:40 -07:00
Denys M
1f8fc3fa5b [components] For https://github.com/mozilla-mobile/android-components/issues/1481. Enable unit test binary resources globally.
Excluded few modules.
2019-06-13 09:29:52 +02:00
Denys M
567ad5f8ff [components] For https://github.com/mozilla-mobile/android-components/issues/1481. Use androidx runner in browser-storage-memory. 2019-06-11 12:37:53 +02:00
Sebastian Kaspari
5c54ec453d [components] Closes https://github.com/mozilla-mobile/android-components/issues/842: Migrate from support libraries to AndroidX. 2019-05-02 16:08:55 +02:00
Grisha Kruglov
cb58d6bef0 [components] Closes https://github.com/mozilla-mobile/android-components/issues/2778 - Bump application-services to 0.27.0 2019-04-23 14:48:03 -07:00
Emily Kager
80d207f287 [components] For https://github.com/mozilla-mobile/android-components/issues/2708 -Adds BookmarksStorageSuggestionProvider 2019-04-18 11:24:50 -07:00
Grisha Kruglov
421d5929ec [components] Closes https://github.com/mozilla-mobile/android-components/issues/1373: Add deleteVisit API to HistoryStorage 2019-03-28 13:00:17 -07:00
Grisha Kruglov
ff26ff28de [components] Closes https://github.com/mozilla-mobile/android-components/issues/1373: HistoryStorage delete APIs
- add Delete APIs to the HistoryStorage concept
- expose them in browser-storage-sync and browser-storage-memory
2019-03-22 13:17:01 -07:00
Grisha Kruglov
227e4f6f9f [components] Issue https://github.com/mozilla-mobile/android-components/issues/2015, issue https://github.com/mozilla-mobile/android-components/issues/2016: Add getDetailedVisits history API 2019-03-15 09:12:46 -07:00
Grisha Kruglov
8260324a9b [components] Perform browser-toolbar autocompletion off the UI thread
At this point in the stack, we're not in control over what our
autocomplete providers are, what actions they'll do in order to
field our queries, etc. For example, some providers may hit the disk
and perform expensive DB queries internally. Some may even hit the
network, in theory!

In order to keep things perceptively speedy, let's run the actual work
off the main thread. This patch sets up a new pool thread to process
autocomplete requests. More than one thread is selected so that we maintain
liveliness during quick user input. Background tasks are cancelled as new
queries come in, and stale results are discarded.
2019-02-08 12:22:13 -08:00
Grisha Kruglov
e9157bb2e2 [components] Switch to android.net.Uri in domain matching logic
It's more forgiving than java.net.URI, which is what we want here.

This is intended to help with https://github.com/mozilla-mobile/reference-browser/issues/396,
although I wasn't able to add a failing unit test that would match that crash.
2019-01-11 10:44:35 +01:00
Mitchell Hentges
8fd19cdf3a [components] Moves description to be part of project.ext 2019-01-11 10:08:32 +01:00
Mitchell Hentges
3ee4d96a84 [components] Reads componentsVersion from .buildconfig.yml 2019-01-11 10:08:32 +01:00
Grisha Kruglov
c8d1e5299f [components] Closes https://github.com/mozilla-mobile/android-components/issues/1647: Improve URL toolbar autocompletion matching
It still isn't great, but has a broader coverage than before.
2019-01-08 11:04:10 -08:00
Grisha Kruglov
ed472d66ae [components] Clean up gradle build files for some of the components
- Remove a few unnecessary dependencies
- Add some comments around usage of 'api'
- Mark some of the dependencies as 'api' if they're necessary for use of the module
2018-12-21 13:11:27 -08:00
Grisha Kruglov
67e68b9b49 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1506: Adjust our use of levenshtein distance to account for empty strings
This also adds history storage as one of the awesomebar data providers, since doing
so doesn't crash the browser anymore.
2018-12-14 11:31:55 -05:00
Lina Cambridge
c4a70391a2 [components] Wire up the history tracking delegate for GeckoView Nightly. 2018-11-30 11:17:36 +01:00
Grisha Kruglov
0ddc3dd0ea [components] Improve autocompletion in HistoryStorage implementations to return a 'result' object 2018-11-26 18:51:31 +01:00
ali-abdullah
89f3263d12 [components] included buildSrc in ktlint and detekt checks 2018-11-16 12:40:04 +01:00
Christian Sadilek
e34c22f81b [components] Closes https://github.com/mozilla-mobile/android-components/issues/1305: Upgrade to Kotlin 1.3.0 and Coroutines 1.0.1 2018-11-09 09:26:47 +01:00
Grisha Kruglov
2330131a1f [components] Closes https://github.com/mozilla-mobile/android-components/issues/1241: Add getDomainSuggestions to HistoryStorage along with implementations
The domain matching logic is quite basic.
See https://github.com/mozilla-mobile/android-components/issues/1279 for a follow-up.
2018-11-07 13:59:47 -08:00
Grisha Kruglov
7d0033cdf5 [components] Add 'limit' to HistoryStorage's getSuggestion concept method 2018-11-05 17:27:42 -08:00
Grisha Kruglov
b9c59b8927 [components] Add 'cleanup' method to HistoryStorage concept
A storage implementation might need to cleanup its allocated resources,
and this provides an entry point for that to happen.

An example might be closing a native database connection that's maintained
by the Rust Places library.
2018-11-05 17:27:42 -08:00
Grisha Kruglov
1d92f12ebc [components] Switch HistoryStorage to use Deferred results and suspend functions
Underlying HistoryStorage implementations might be blocking on IO (Rust Places, room),
or migth be non-blocking (in-memory). A Deferred return type for get* methods makes
it convenient to wrap both regular and `async` operations. Use of 'suspend' functions
serves the same role for write* methods.

This change makes it obvious at the engine call-site that the underlying implementation
might suspend, at which point we can wrap calls in `runBlocking` or use another coroutine builder.
2018-11-05 17:27:42 -08:00
Grisha Kruglov
8a86813255 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1242: Add suggestion API to concept-storage + basic implementation 2018-11-02 14:52:37 -07:00
Sebastian Kaspari
1a0781fea7 [components] Update publishing configuration of browser-storage-memory. 2018-10-31 20:39:48 +01:00
Grisha Kruglov
2d8134bcc9 [components] Add an in-memory implementation of concept-storage 2018-10-26 15:42:19 -07:00