Migrate IPCs to Mojo interfaces for components/translate |
|||||
Issue descriptionMojofication target: components/translate/content/common/translate_messages.h Hi, sorry I cc all translate OWNERs here, to confirm whether it makes sense if I'd like to start this work now, to avoid the possible conflict that someone has been working for this. If OK I'll prepare a CL for your review. Thanks.
,
Jun 13 2016
Her answer :) I'm perfectly fine with migrating to Mojo. Is there a particular need driving this, or is this part of a general mojofication drive? Also: If you expect this to take a bit, it'd probably be helpful if you could just share a quick sketch of the service interfaces you plan to implement.
,
Jun 14 2016
Yeah I think this should be part of the general mojofication drive, the overall issue is tracked by https://bugs.chromium.org/p/chromium/issues/detail?id=577685. Also cc Anand here to help confirm whether there is any conflict. The interfaces definition will be like: https://codereview.chromium.org/2066483004/diff/1/components/translate/content/common/translate.mojom And, as currently translate IPCs only happen between Main RFH(Render Frame Host) and Main RF(Render Frame), the draft interfaces impl sketch will be: 1, Put mojom.ContentTranslateDriver interface impl into ContentTranslateDriver, which would be registered into the service registry of Main RFH via ChromeContentBrowserClient::RegisterRenderFrameMojoServices(). 2, Put mojom.TranslateHelper interface impl into TranslateHelper, which would be registered into the service registry of Main RF via ChromeRenderFrameObserver constructor or TranslateHelper constructor by itself. Thanks all~
,
Jun 17 2016
I think you can do something more Mojo-y and do away with the page sequence numbers. I'm thinking something along the lines of:
interface Page {
Translate(string translate_script, string source_lang, string target_lang)
=> (string original_lang, string translated_lang, TranslateErrorsType error_type);
RevertTranslation();
};
interface TranslateDriver {
NewPage(Page page, LanguageDetectionDetails, bool page_needs_translation);
};
What happens when there's a new page is that first, the renderer destroys its existing Page service, if it exists. Then once the page has loaded, it detects language, creates a new Page service and sends the client to the browser via NewPage(). The browser can then translate and revert via the Page interface. Of course, this is based on a cursory look at the translate messages and my understanding of it could be completly wrong.
,
Jun 17 2016
Thanks Anand very much for analysis and suggestion. I like the idea! I'll dig down some more and try to figure out a better world ;-)
,
Jun 21 2016
Re #2: Oops, I'm very sorry groby@. I of course knew your name and photo, but account wasn't tied with them in my memory.
,
Jun 21 2016
toyoshim@ no worries - I do the same all the time. It's hard to match people and LDAPs :)
,
Jun 24 2016
Hi, I tried to understand the wholesale logic of translate and I want to confirm some of my understandings and thoughts about the mojofication work: 1, Only one page is supposed to be involved into translation process at anytime, once page navigated away, no translation anymore. So I'm considering maybe we don't need to create a new Page interface impl for every page(in renderer side) as we'll have to kill previous one when creating a new one. 2, The page sequence number is handled in translate/core logic, so this involves translate/ios/browser logic, there I saw some more logic concerned with the page sequence number. So I think maybe we'd better do the mojofication still aligning with current logic to make sure everything run correctly. WDYT? Thanks.
,
Jul 4 2016
Finally I understood that Anand's suggestion for the mojom definition makes great sense. I'll start to prepare a CL.
,
Jul 4 2016
,
Aug 10 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3134fc62afcbbc25e0deeb674e5252be9f458d7b commit 3134fc62afcbbc25e0deeb674e5252be9f458d7b Author: leon.han <leon.han@intel.com> Date: Wed Aug 10 07:25:58 2016 [Translate] Migrate IPCs to Mojo interfaces. BUG= 619390 TEST=browser_tests, unit_tests Review-Url: https://codereview.chromium.org/2143383002 Cr-Commit-Position: refs/heads/master@{#410992} [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/chrome/browser/BUILD.gn [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/chrome/browser/chrome_content_browser_client.cc [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/chrome/browser/translate/chrome_translate_client.cc [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/chrome/browser/translate/chrome_translate_client.h [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/chrome/browser/translate/translate_manager_render_view_host_unittest.cc [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/chrome/renderer/chrome_render_frame_observer_browsertest.cc [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/chrome/renderer/translate/translate_helper_browsertest.cc [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate.gypi [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/DEPS [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/browser/BUILD.gn [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/browser/content_translate_driver.cc [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/browser/content_translate_driver.h [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/common/BUILD.gn [add] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/common/DEPS [add] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/common/OWNERS [add] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/common/translate.mojom [add] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/common/translate.typemap [delete] https://crrev.com/0402b9c04ec0dcbced39310a641e7b4fd8adc758/components/translate/content/common/translate_messages.cc [delete] https://crrev.com/0402b9c04ec0dcbced39310a641e7b4fd8adc758/components/translate/content/common/translate_messages.h [add] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/common/translate_struct_traits.cc [add] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/common/translate_struct_traits.h [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/renderer/BUILD.gn [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/renderer/DEPS [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/renderer/translate_helper.cc [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/translate/content/renderer/translate_helper.h [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/components/typemaps.gni [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/ipc/ipc_message_start.h [modify] https://crrev.com/3134fc62afcbbc25e0deeb674e5252be9f458d7b/tools/ipc_fuzzer/message_lib/all_messages.h
,
Aug 16 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by toyoshim@chromium.org
, Jun 12 2016