[components] Merge https://github.com/mozilla-mobile/android-components/pull/7510
commit03d9027726c53e632e68e94c2f478b01b326bf47
authorMozLando <skaspari+mozlando@mozilla.com>
Wed, 1 Jul 2020 15:06:39 +0000 (1 15:06 +0000)
committerMozLando <skaspari+mozlando@mozilla.com>
Wed, 1 Jul 2020 15:06:39 +0000 (1 15:06 +0000)
tree3b3c7b22593e1f7db66b5402d9d5dceb7e34128d
parent2ec3838ad2ff00787f6b09e6708f4ab0c36f6fba
parent1320080327e4fcaa278c19b7d5d384cab89f103b
[components] Merge https://github.com/mozilla-mobile/android-components/pull/7510

7510: Add firefox profiler marker API to the GeckoEngine r=pocmo a=canova

Hi all, I'm on the Firefox Profiler team and I was working on the geckoview API for the Firefox and just landed the GeckoView part in [Bug 1624993](https://bugzilla.mozilla.org/show_bug.cgi?id=1624993). I also want to add this API to android-components so we can use that API in the consumers like Fenix. This is still not exactly complete but I wanted to get some early feedback from you. It would be great if you can take a look at it.

- I added a `ProfilerRuntime` interface and added that interface to `GeckoEngine`. These ProfilerRuntime methods calls the geckoview APIs. I'm not exactly sure about the place. I added it to GeckoEngine class but I can move it to somewhere else too if you think it's not great.
- Also currently I didn't add any tests and I would like to get your feedback on how to write this as well. This feels like a bit tricky, because when the profiler is not running, these methods are no-op. And currently there is no way to enable profiler from geckoview. It's only possible with[ remote profiling via `about:debugging`](https://profiler.firefox.com/docs/#/./guide-remote-profiling). So I'm not sure what to test here. Maybe if we have some devtools tests in the codebase, I can try to do some things like these.

Co-authored-by: Nazım Can Altınova <canaltinova@gmail.com>