Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Issue 423963004: First cut at "content handling" support in Mojo. (Closed)

Created:
6 years, 4 months ago by Aaron Boodman
Modified:
6 years, 4 months ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, ben+mojo_chromium.org
Project:
chromium
Visibility:
Public.

Description

First cut at "content handling" support in Mojo. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288013 Reverted (see http://crrev.com/288043) because this closed the tree on some builders. They had compile errors and could not find service_provider.mojom-internal.h. See the following builds for examples: http://build.chromium.org/p/chromium.chrome/buildstatus?builder=Google%20Chrome%20Linux&number=36866 http://build.chromium.org/p/chromium.chrome/buildstatus?builder=Google%20Chrome%20ChromeOS&number=70451

Patch Set 1 #

Patch Set 2 : Create a dedicated demo app instead of using wget #

Total comments: 2

Patch Set 3 : Use URLResponse with ContentHandler interface instead of data pipe #

Total comments: 24

Patch Set 4 : Addressed Dave's comments, plus added a --content-handlers switch #

Total comments: 2

Patch Set 5 : make the tests pass #

Total comments: 5

Patch Set 6 : better fix to tests, update content handler app #

Patch Set 7 : add some comentary #

Total comments: 1

Patch Set 8 : delete temporary files #

Patch Set 9 : blech #

Total comments: 18

Patch Set 10 : brace yourself! #

Patch Set 11 : darin comments #

Patch Set 12 : rebase #

Patch Set 13 : try to make win, android, and gn targets pass #

Patch Set 14 : more gn #

Patch Set 15 : more gn #

Patch Set 16 : more gn #

Unified diffs Side-by-side diffs Delta from patch set Stats (+679 lines, -254 lines) Patch
A mojo/examples/content_handler_demo/content_handler_demo.cc View 1 2 3 4 5 1 chunk +89 lines, -0 lines 0 comments Download
M mojo/mojo.gyp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +4 lines, -0 lines 0 comments Download
M mojo/mojo_examples.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +16 lines, -0 lines 0 comments Download
M mojo/mojo_services.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +16 lines, -0 lines 0 comments Download
M mojo/service_manager/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -0 lines 0 comments Download
M mojo/service_manager/background_shell_service_loader.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -7 lines 0 comments Download
M mojo/service_manager/background_shell_service_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +17 lines, -11 lines 0 comments Download
M mojo/service_manager/background_shell_service_loader_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -4 lines 0 comments Download
M mojo/service_manager/service_loader.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +49 lines, -3 lines 0 comments Download
A mojo/service_manager/service_loader.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +29 lines, -0 lines 0 comments Download
M mojo/service_manager/service_manager.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +24 lines, -0 lines 0 comments Download
M mojo/service_manager/service_manager.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +128 lines, -11 lines 0 comments Download
M mojo/service_manager/service_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +10 lines, -10 lines 0 comments Download
M mojo/services/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M mojo/services/public/cpp/view_manager/tests/view_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -3 lines 0 comments Download
A + mojo/services/public/interfaces/content_handler/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -3 lines 0 comments Download
A + mojo/services/public/interfaces/content_handler/content_handler.mojom View 1 2 3 4 1 chunk +5 lines, -5 lines 0 comments Download
M mojo/services/view_manager/view_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -3 lines 0 comments Download
M mojo/services/window_manager/window_manager_api_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -3 lines 0 comments Download
M mojo/shell/context.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +45 lines, -11 lines 0 comments Download
M mojo/shell/dbus_service_loader_linux.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -3 lines 0 comments Download
M mojo/shell/dbus_service_loader_linux.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -3 lines 0 comments Download
M mojo/shell/dynamic_service_loader.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +23 lines, -3 lines 0 comments Download
M mojo/shell/dynamic_service_loader.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +119 lines, -130 lines 0 comments Download
M mojo/shell/dynamic_service_loader_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -1 line 0 comments Download
M mojo/shell/network_service_loader.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -4 lines 0 comments Download
M mojo/shell/network_service_loader.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -4 lines 0 comments Download
M mojo/shell/switches.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M mojo/shell/switches.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M mojo/shell/ui_service_loader_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -6 lines 0 comments Download
M mojo/shell/ui_service_loader_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +22 lines, -18 lines 0 comments Download
M mojo/shell/view_manager_loader.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -4 lines 0 comments Download
M mojo/shell/view_manager_loader.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -4 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
Aaron Boodman
A few of the tests still don't pass, but I think this is ready for ...
6 years, 4 months ago (2014-08-03 02:34:36 UTC) #1
darin (slow to review)
https://codereview.chromium.org/423963004/diff/20001/mojo/public/interfaces/service_provider/content_handler.mojom File mojo/public/interfaces/service_provider/content_handler.mojom (right): https://codereview.chromium.org/423963004/diff/20001/mojo/public/interfaces/service_provider/content_handler.mojom#newcode11 mojo/public/interfaces/service_provider/content_handler.mojom:11: handle<data_pipe_consumer> content, Are you thinking we can get away ...
6 years, 4 months ago (2014-08-03 06:12:02 UTC) #2
Aaron Boodman
https://codereview.chromium.org/423963004/diff/20001/mojo/public/interfaces/service_provider/content_handler.mojom File mojo/public/interfaces/service_provider/content_handler.mojom (right): https://codereview.chromium.org/423963004/diff/20001/mojo/public/interfaces/service_provider/content_handler.mojom#newcode11 mojo/public/interfaces/service_provider/content_handler.mojom:11: handle<data_pipe_consumer> content, On 2014/08/03 06:12:02, darin wrote: > Are ...
6 years, 4 months ago (2014-08-03 11:11:40 UTC) #3
darin (slow to review)
We could move ContentHandler to mojo/services/public/... allowing it to depend on URLResponse. I'm not sure ...
6 years, 4 months ago (2014-08-03 15:13:40 UTC) #4
Aaron Boodman
+davemoore for ServiceManager, ServiceLoader, and DynamicServiceLoader in particular. Dave, I will ask you about some ...
6 years, 4 months ago (2014-08-04 16:40:41 UTC) #5
Aaron Boodman
I have updated ContentHandler to use URLResponse instead of data pipe. Pray I do not ...
6 years, 4 months ago (2014-08-04 18:24:40 UTC) #6
DaveMoore
https://codereview.chromium.org/423963004/diff/40001/mojo/service_manager/service_manager.h File mojo/service_manager/service_manager.h (right): https://codereview.chromium.org/423963004/diff/40001/mojo/service_manager/service_manager.h#newcode98 mojo/service_manager/service_manager.h:98: typedef std::map<GURL, ContentHandlerConnection*> ContentHandlerMap; Nit: We should have consistent ...
6 years, 4 months ago (2014-08-04 21:50:52 UTC) #7
Aaron Boodman
https://codereview.chromium.org/423963004/diff/40001/mojo/service_manager/service_manager.h File mojo/service_manager/service_manager.h (right): https://codereview.chromium.org/423963004/diff/40001/mojo/service_manager/service_manager.h#newcode98 mojo/service_manager/service_manager.h:98: typedef std::map<GURL, ContentHandlerConnection*> ContentHandlerMap; On 2014/08/04 21:50:51, DaveMoore wrote: ...
6 years, 4 months ago (2014-08-05 05:44:55 UTC) #8
tim (not reviewing)
https://codereview.chromium.org/423963004/diff/60001/mojo/service_manager/service_manager.cc File mojo/service_manager/service_manager.cc (right): https://codereview.chromium.org/423963004/diff/60001/mojo/service_manager/service_manager.cc#newcode166 mojo/service_manager/service_manager.cc:166: STLDeleteValues(&url_to_content_handler_); Are connections you're adding here for content handlers ...
6 years, 4 months ago (2014-08-05 20:45:55 UTC) #9
Aaron Boodman
https://codereview.chromium.org/423963004/diff/60001/mojo/service_manager/service_manager.cc File mojo/service_manager/service_manager.cc (right): https://codereview.chromium.org/423963004/diff/60001/mojo/service_manager/service_manager.cc#newcode166 mojo/service_manager/service_manager.cc:166: STLDeleteValues(&url_to_content_handler_); Yes, content handlers are also normal mojo applications, ...
6 years, 4 months ago (2014-08-05 22:45:35 UTC) #10
Aaron Boodman
tim, can you please review the changes to the tests?
6 years, 4 months ago (2014-08-05 23:22:16 UTC) #11
tim (not reviewing)
https://codereview.chromium.org/423963004/diff/80001/mojo/shell/dynamic_service_loader.cc File mojo/shell/dynamic_service_loader.cc (right): https://codereview.chromium.org/423963004/diff/80001/mojo/shell/dynamic_service_loader.cc#newcode132 mojo/shell/dynamic_service_loader.cc:132: // InProcessDynamicServiceRunner to be destroyed so that the shell ...
6 years, 4 months ago (2014-08-05 23:52:37 UTC) #12
tim (not reviewing)
https://codereview.chromium.org/423963004/diff/120001/mojo/shell/dynamic_service_loader.cc File mojo/shell/dynamic_service_loader.cc (right): https://codereview.chromium.org/423963004/diff/120001/mojo/shell/dynamic_service_loader.cc#newcode137 mojo/shell/dynamic_service_loader.cc:137: if (!path_exists) I wasn't looking at the latest patch ...
6 years, 4 months ago (2014-08-06 00:12:35 UTC) #13
Aaron Boodman
https://codereview.chromium.org/423963004/diff/80001/mojo/shell/dynamic_service_loader.cc File mojo/shell/dynamic_service_loader.cc (right): https://codereview.chromium.org/423963004/diff/80001/mojo/shell/dynamic_service_loader.cc#newcode132 mojo/shell/dynamic_service_loader.cc:132: // InProcessDynamicServiceRunner to be destroyed so that the shell ...
6 years, 4 months ago (2014-08-06 00:37:23 UTC) #14
Aaron Boodman
On 2014/08/06 00:12:35, timsteele wrote: > https://codereview.chromium.org/423963004/diff/120001/mojo/shell/dynamic_service_loader.cc > File mojo/shell/dynamic_service_loader.cc (right): > > https://codereview.chromium.org/423963004/diff/120001/mojo/shell/dynamic_service_loader.cc#newcode137 > ...
6 years, 4 months ago (2014-08-06 00:39:25 UTC) #15
tim (not reviewing)
On 2014/08/06 00:39:25, Aaron Boodman wrote: > On 2014/08/06 00:12:35, timsteele wrote: > > > ...
6 years, 4 months ago (2014-08-06 05:57:52 UTC) #16
Aaron Boodman
On Tue, Aug 5, 2014 at 10:57 PM, <tim@chromium.org> wrote: > On 2014/08/06 00:39:25, Aaron ...
6 years, 4 months ago (2014-08-06 19:50:05 UTC) #17
DaveMoore
https://codereview.chromium.org/423963004/diff/160001/mojo/shell/dbus_service_loader_linux.cc File mojo/shell/dbus_service_loader_linux.cc (right): https://codereview.chromium.org/423963004/diff/160001/mojo/shell/dbus_service_loader_linux.cc#newcode160 mojo/shell/dbus_service_loader_linux.cc:160: if (!shell_handle.is_valid()) { Nit: no braces https://codereview.chromium.org/423963004/diff/160001/mojo/shell/dynamic_service_loader.h File mojo/shell/dynamic_service_loader.h ...
6 years, 4 months ago (2014-08-06 20:50:46 UTC) #18
Aaron Boodman
https://codereview.chromium.org/423963004/diff/160001/mojo/shell/dbus_service_loader_linux.cc File mojo/shell/dbus_service_loader_linux.cc (right): https://codereview.chromium.org/423963004/diff/160001/mojo/shell/dbus_service_loader_linux.cc#newcode160 mojo/shell/dbus_service_loader_linux.cc:160: if (!shell_handle.is_valid()) { On 2014/08/06 20:50:46, DaveMoore wrote: > ...
6 years, 4 months ago (2014-08-06 22:49:30 UTC) #19
Aaron Boodman
On 2014/08/06 22:49:30, Aaron Boodman wrote: > 2) I suspect that finding the right content ...
6 years, 4 months ago (2014-08-06 22:50:18 UTC) #20
darin (slow to review)
LGTM https://codereview.chromium.org/423963004/diff/160001/mojo/mojo_examples.gypi File mojo/mojo_examples.gypi (right): https://codereview.chromium.org/423963004/diff/160001/mojo/mojo_examples.gypi#newcode148 mojo/mojo_examples.gypi:148: 'target_name': 'mojo_content_handler_demo', you probably want to add this ...
6 years, 4 months ago (2014-08-06 23:10:02 UTC) #21
Aaron Boodman
https://codereview.chromium.org/423963004/diff/160001/mojo/mojo_examples.gypi File mojo/mojo_examples.gypi (right): https://codereview.chromium.org/423963004/diff/160001/mojo/mojo_examples.gypi#newcode148 mojo/mojo_examples.gypi:148: 'target_name': 'mojo_content_handler_demo', On 2014/08/06 23:10:01, darin wrote: > you ...
6 years, 4 months ago (2014-08-07 00:03:12 UTC) #22
Aaron Boodman
The CQ bit was checked by aa@chromium.org
6 years, 4 months ago (2014-08-07 00:58:47 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aa@chromium.org/423963004/220001
6 years, 4 months ago (2014-08-07 01:01:18 UTC) #24
darin (slow to review)
The URLResponse's url field is the post-redirect URL. Isn't that the same as the URL ...
6 years, 4 months ago (2014-08-07 01:27:03 UTC) #25
Aaron Boodman
The CQ bit was checked by aa@chromium.org
6 years, 4 months ago (2014-08-07 01:40:23 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aa@chromium.org/423963004/240001
6 years, 4 months ago (2014-08-07 01:42:38 UTC) #27
Aaron Boodman
The CQ bit was checked by aa@chromium.org
6 years, 4 months ago (2014-08-07 06:04:36 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aa@chromium.org/423963004/290001
6 years, 4 months ago (2014-08-07 06:05:27 UTC) #29
commit-bot: I haz the power
Change committed as 288013
6 years, 4 months ago (2014-08-07 08:23:15 UTC) #30
Roger Tawa OOO till Jul 10th
Aaron: I had to revert this because it broke the tree. I updated description of ...
6 years, 4 months ago (2014-08-07 15:10:08 UTC) #31
Aaron Boodman
Sorry, I forgot to reply to this. On 2014/08/07 01:27:03, darin wrote: > The URLResponse's ...
6 years, 4 months ago (2014-08-08 04:33:59 UTC) #32
darin (slow to review)
On 2014/08/08 04:33:59, Aaron Boodman wrote: > Sorry, I forgot to reply to this. > ...
6 years, 4 months ago (2014-08-08 04:45:55 UTC) #33
Aaron Boodman
On Thu, Aug 7, 2014 at 9:45 PM, <darin@chromium.org> wrote: > On 2014/08/08 04:33:59, Aaron ...
6 years, 4 months ago (2014-08-08 05:16:52 UTC) #34
darin (slow to review)
On 2014/08/08 05:16:52, Aaron Boodman wrote: ... > > > URL interception, a la ServiceWorker, ...
6 years, 4 months ago (2014-08-08 05:29:24 UTC) #35
Aaron Boodman
On 2014/08/08 05:29:24, darin wrote: > Oh, I see. Perhaps both forms of interception are ...
6 years, 4 months ago (2014-08-08 17:12:59 UTC) #36
darin (slow to review)
6 years, 4 months ago (2014-08-08 19:46:35 UTC) #37
On Fri, Aug 8, 2014 at 10:12 AM, <aa@chromium.org> wrote:

> On 2014/08/08 05:29:24, darin wrote:
>
>> Oh, I see. Perhaps both forms of interception are interesting. For
>> example,
>> if you wanted https://foo/baz to act like a PDF, then you would just fake
>> the network response, but just blanket taking over connections to an URL
>> could certainly be useful and much more efficient and less hacky than
>> generating fake responses. OK. Maybe that is still expressed as a
>> different
>> interface? Or, maybe this just points to a reason why "content handler"
>> might
>> not be the best name for the interface.
>>
>
> Yeah, these are the sorts of issues I've been dancing around: connection,
> navigation, and content handling are all tightly related and interconnected
> concepts. I've gone back and forth about having 1, 2, or 3 interfaces for
> them
> multiple times :). I'm still not happy with what we have, but I thought
> maybe
> I'd make more progress by trying to move on to the next step.
>

Sounds like a good plan to me!
-Darin


>
> https://codereview.chromium.org/423963004/
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698