I really don't like putting Chromium code in third_party, because that makes it harder to distinguish between bundled libraries that can be unbundled and Chromium code that needs to be preserved.
If the code is needed in content, why not move it to content? John, do you have objections against that?
I'd like to introduce a dependency on 'zip' in this CL:For background, this is a tool (chrome://indexeddb-internals) which can download an IDB directory (potentially containing hundreds/thousands of files) from your profile for debugging as a single ZIP file.John you appropriately pointed out that content/ shouldn't depend on components/this seems quite reasonable except that 'zip' seems unique among components/* in that it has no complex dependencies - just zlib and base, both of which are already dependencies of content/dgrogan found an earlier CL where zip was moved out of chrome/common, and there was some discussion if zip should be in base/ itself:but Brett, you objected at the time.
Any thoughts here?(as an aside: The compression aspect of ZIP is of moderate importance because one of the main use cases is to download someone's (potentially large) offline google drive database on chromeos, which can be disk-constrained. We could live without the compression if we had to, but I'd like to keep it - but the fact that we need zlib anyway in content/ makes this sort of moot)Alec
If it was just one thing, making a separate base subproject would
probably be fine, but this has come up with some other third party
libraries where people write wrappers around them, and I suspect it
will come up more as people slice and dice the codebase to be more
componentized.
This is where the recommendation to put the code in the third_party
directory came from, since when you depend on the third_party thingy,
you automatically get the nice wrapper code.
But this isn't ideal for the reasons Paweł points out. I feel like we
should have a better system for doing this, something like
standardizing on making directories like "third_party/.../google" for
the wrapper code.
Brett
//components was only supposed to be for stuff that depends on
//content and down. Unfortunately there are a couple of exceptions to
this at the moment, due to there not being a better place for them.
If we want to be able to consider //components a fairly well-defined
layer, then we should stick to the originally intended rule - that way
it's a layer on top of //content.
We could revisit the idea that came up when we initially were
discussing //components, which was to have one components directory
for each architectural layer, where components live that depend on
that layer and below, e.g. //base_components, //net_components,
//content_components. In such a scenario, prefs and zip and maybe
i18n would move to //base_components.
OK, I'm convinced, //components it is. In this case, //components/zip
should be fine,
and //content can depend on //components/zip.
Consider an imaginary //components/foo that is designed to depend only
on //base. If that component wants to depend on any other component
from //components, it needs to be diligent about checking what layers
that component depends on.
Yes, I think it necessarily follows, even though you could dodge the
need to face that fact by putting the zip wrapper code where you
suggested. Otherwise, //components would be the directory from which
everybody except //content can reuse features, and that's not exactly
a transparent rule (and why wouldn't other layers say that their layer
shouldn't depend back on //components then?).
On Thu, Apr 18, 2013 at 10:11 AM, Jói Sigurðsson <j...@chromium.org> wrote:Consider an imaginary //components/foo that is designed to depend only
on //base. If that component wants to depend on any other component
from //components, it needs to be diligent about checking what layers
that component depends on.So I just stumbled upon this in trying to move components/zip into base/zip - it seems that components/zip does depend on net/base/file_* to open files, synchronously... but I think it picked up that dependency indirectly because its a static library - it happily built from base/ but failed to link base_unittest (but literally every other target built just fine)conveniently, everyone who depends on zip also happens to depend on net/ so this could only have been caught by IWYU :(This also means at least in its current form, components/zip can't move to base/ - with the net/base dependency, it probably can't move to third_party either?And now I see Jói and John's recent messages.sounds like we're down to toplevel directory vs breaking up components?it sounds like the only difference between any of these is how many toplevel directories we end up with.Seems like the issue here is that components/ is a mishmash of high and low level 'components'
I'm starting to lean towards the toplevel directory, even though I'm with John about limiting the number of those.
On Thu, Apr 18, 2013 at 11:28 AM, Jói Sigurðsson <j...@chromium.org> wrote:
Yes, I think it necessarily follows, even though you could dodge the
need to face that fact by putting the zip wrapper code where you
suggested. Otherwise, //components would be the directory from which
everybody except //content can reuse features, and that's not exactly
a transparent rule (and why wouldn't other layers say that their layer
shouldn't depend back on //components then?).How I think about it is that src/components is the the place for getting extra functionality to add to your browser. So it's not just content that can't include it, but also other low-level directories like src/net, src/ui etc.. The only places that should include stuff from components would be browser apps, i.e. src/chrome, src/android_webview, and src/wherever_we_upstream_ios_code.
> How I think about it is that src/components is the the place for gettingThanks John, that definition for //components would also make sense
> extra functionality to add to your browser. So it's not just content that
> can't include it, but also other low-level directories like src/net, src/ui
> etc.. The only places that should include stuff from components would be
> browser apps, i.e. src/chrome, src/android_webview, and
> src/wherever_we_upstream_ios_code.
and is perhaps more intuitive. As Alec has said, that leaves the
question of where to put things that are not "features for your
browser" so to speak. I guess we could doge that question now by
putting the zip wrapper code in third_party/zip as has been suggested.
On Thu, Apr 18, 2013 at 4:15 PM, Jói Sigurðsson <j...@chromium.org> wrote:
> How I think about it is that src/components is the the place for gettingThanks John, that definition for //components would also make sense
> extra functionality to add to your browser. So it's not just content that
> can't include it, but also other low-level directories like src/net, src/ui
> etc.. The only places that should include stuff from components would be
> browser apps, i.e. src/chrome, src/android_webview, and
> src/wherever_we_upstream_ios_code.
and is perhaps more intuitive. As Alec has said, that leaves the
question of where to put things that are not "features for your
browser" so to speak. I guess we could doge that question now by
putting the zip wrapper code in third_party/zip as has been suggested.Thanks, that sounds best to me. I suspect that the zip example is a one-off, and it would be very rare that we need to share code between content and chrome that can't go into base.
On Fri, Apr 19, 2013 at 8:40 AM, John Abd-El-Malek <j...@chromium.org> wrote:
On Thu, Apr 18, 2013 at 4:15 PM, Jói Sigurðsson <j...@chromium.org> wrote:
> How I think about it is that src/components is the the place for gettingThanks John, that definition for //components would also make sense
> extra functionality to add to your browser. So it's not just content that
> can't include it, but also other low-level directories like src/net, src/ui
> etc.. The only places that should include stuff from components would be
> browser apps, i.e. src/chrome, src/android_webview, and
> src/wherever_we_upstream_ios_code.
and is perhaps more intuitive. As Alec has said, that leaves the
question of where to put things that are not "features for your
browser" so to speak. I guess we could doge that question now by
putting the zip wrapper code in third_party/zip as has been suggested.Thanks, that sounds best to me. I suspect that the zip example is a one-off, and it would be very rare that we need to share code between content and chrome that can't go into base.Sorry for coming late, but I found it rather awkward to have this in third_party/zip. Here's why:1) "components/zip" is built on top of 'zlib' but also uses 'base' and 'net' (for FileStream). Somewhat awkward to use 'base' and 'net' from third_party.
2) The code consists of 1752 lines of C++ code including unit tests. This is not a trivial wrapper.
3) If we are to move this to third_party, are we going to introduce 'third_party_unittests'? This looks somewhat awkward.
On Thu, Apr 18, 2013 at 4:48 PM, Satoru Takabayashi <sat...@chromium.org> wrote:
On Fri, Apr 19, 2013 at 8:40 AM, John Abd-El-Malek <j...@chromium.org> wrote:
On Thu, Apr 18, 2013 at 4:15 PM, Jói Sigurðsson <j...@chromium.org> wrote:
> How I think about it is that src/components is the the place for gettingThanks John, that definition for //components would also make sense
> extra functionality to add to your browser. So it's not just content that
> can't include it, but also other low-level directories like src/net, src/ui
> etc.. The only places that should include stuff from components would be
> browser apps, i.e. src/chrome, src/android_webview, and
> src/wherever_we_upstream_ios_code.
and is perhaps more intuitive. As Alec has said, that leaves the
question of where to put things that are not "features for your
browser" so to speak. I guess we could doge that question now by
putting the zip wrapper code in third_party/zip as has been suggested.Thanks, that sounds best to me. I suspect that the zip example is a one-off, and it would be very rare that we need to share code between content and chrome that can't go into base.Sorry for coming late, but I found it rather awkward to have this in third_party/zip. Here's why:1) "components/zip" is built on top of 'zlib' but also uses 'base' and 'net' (for FileStream). Somewhat awkward to use 'base' and 'net' from third_party.2) The code consists of 1752 lines of C++ code including unit tests. This is not a trivial wrapper.I'm not sure why the size of the wrapper affects where it should go?
My feeling is that if it's non trivial, it's more like a first class library of Chromium project hence not in third_party, but I don't feel strongly about it.If we are to put this in third_party/zip, what about 'sql' and 'dbus' in the top level directory? These can also be considered wrappers for libsqlite and libdbus. For consistency, should they also be moved to third_party? I think it'd make sense to have 'sql', 'dbus', and 'zip' in the same directory.
On Thu, Apr 18, 2013 at 5:54 PM, Satoru Takabayashi <sat...@chromium.org> wrote:
My feeling is that if it's non trivial, it's more like a first class library of Chromium project hence not in third_party, but I don't feel strongly about it.If we are to put this in third_party/zip, what about 'sql' and 'dbus' in the top level directory? These can also be considered wrappers for libsqlite and libdbus. For consistency, should they also be moved to third_party? I think it'd make sense to have 'sql', 'dbus', and 'zip' in the same directory.third_party is beginning to sound strange to me. Other suggestions:
- lib/
- wrappers/
- support/
John, unless I have missed something, the problems mentioned are:
1. Difficulty of writing DEPS files. I believe this is not the case with my proposal. Existing components/DEPS would move to components/content/DEPS . components/base and components/net would have their own DEPS files, equally easy to verify as current components/DEPS. Does anyone disagree about that?
2. components becoming the new base, i.e. other toplevel directories starting to depend on components. I agree that would be bad. I think most cases, if they arise, could be solved by actually putting said toplevel directories inside components (at the right level, which could well be components/base).
> How I think about it is that src/components is the the place for gettingThanks John, that definition for //components would also make sense
> extra functionality to add to your browser. So it's not just content that
> can't include it, but also other low-level directories like src/net, src/ui
> etc.. The only places that should include stuff from components would be
> browser apps, i.e. src/chrome, src/android_webview, and
> src/wherever_we_upstream_ios_code.
and is perhaps more intuitive. As Alec has said, that leaves the
question of where to put things that are not "features for your
browser" so to speak. I guess we could doge that question now by
putting the zip wrapper code in third_party/zip as has been suggested.
I recalled one thing. I think the purpose of third_party directory is to make a clear boundary between chromium code and third_party code. Moving code like 'zip' to third_party may make the boundary unclear.As described in https://sites.google.com/a/chromium.org/dev/developers/adding-3rd-party-libraries it'd be nice to contact open-source-thi...@google.com on this change.
On Mon, Apr 22, 2013 at 4:57 PM, Satoru Takabayashi <sat...@chromium.org> wrote:
I recalled one thing. I think the purpose of third_party directory is to make a clear boundary between chromium code and third_party code. Moving code like 'zip' to third_party may make the boundary unclear.As described in https://sites.google.com/a/chromium.org/dev/developers/adding-3rd-party-libraries it'd be nice to contact open-source-thi...@google.com on this change.Note: those instructions are when adding third party code to this directory.
On Mon, Apr 22, 2013 at 4:57 PM, Satoru Takabayashi <sat...@chromium.org> wrote:I recalled one thing. I think the purpose of third_party directory is to make a clear boundary between chromium code and third_party code. Moving code like 'zip' to third_party may make the boundary unclear.As described in https://sites.google.com/a/chromium.org/dev/developers/adding-3rd-party-libraries it'd be nice to contact open-source-thi...@google.com on this change.Note: those instructions are when adding third party code to this directory.
Also, note that there are 300 hits for includes from base/ in src/third_party: https://code.google.com/p/chromium/codesearch#search/&q=%22%5C%22base/%22%20file:src/third_party&sq=package:chromium&type=cs
On Mon, Apr 22, 2013 at 5:31 PM, John Abd-El-Malek <j...@chromium.org> wrote:
On Mon, Apr 22, 2013 at 4:57 PM, Satoru Takabayashi <sat...@chromium.org> wrote:I recalled one thing. I think the purpose of third_party directory is to make a clear boundary between chromium code and third_party code. Moving code like 'zip' to third_party may make the boundary unclear.As described in https://sites.google.com/a/chromium.org/dev/developers/adding-3rd-party-libraries it'd be nice to contact open-source-thi...@google.com on this change.Note: those instructions are when adding third party code to this directory.I think Satoru has a good point (in fact I share the same concern). When third_party becomes a mix of real third party and Chromium code, it starts to diminish the value of a separate third_party directory.
Also, note that there are 300 hits for includes from base/ in src/third_party: https://code.google.com/p/chromium/codesearch#search/&q=%22%5C%22base/%22%20file:src/third_party&sq=package:chromium&type=csThe above is not exactly accurate. cld seems to have a directory called "base" right in it. Then multiple projects have been patched to use src/base, but are otherwise not Chromium code.
On Tue, Apr 23, 2013 at 10:32 AM, John Abd-El-Malek <j...@chromium.org> wrote:
my point is there's a lot of precedentOn Tue, Apr 23, 2013 at 10:26 AM, Paweł Hajdan, Jr. <phajd...@chromium.org> wrote:
On Mon, Apr 22, 2013 at 5:31 PM, John Abd-El-Malek <j...@chromium.org> wrote:
On Mon, Apr 22, 2013 at 4:57 PM, Satoru Takabayashi <sat...@chromium.org> wrote:I recalled one thing. I think the purpose of third_party directory is to make a clear boundary between chromium code and third_party code. Moving code like 'zip' to third_party may make the boundary unclear.As described in https://sites.google.com/a/chromium.org/dev/developers/adding-3rd-party-libraries it'd be nice to contact open-source-thi...@google.com on this change.Note: those instructions are when adding third party code to this directory.I think Satoru has a good point (in fact I share the same concern). When third_party becomes a mix of real third party and Chromium code, it starts to diminish the value of a separate third_party directory.The value of third_party isn't that it's only third_party _code_. It's that third_party code must go there. There's nothing to say that we can't put our own code there. A bunch of the projects there is by chromium devs anyways, just pulled in from google code etc.Also, note that there are 300 hits for includes from base/ in src/third_party: https://code.google.com/p/chromium/codesearch#search/&q=%22%5C%22base/%22%20file:src/third_party&sq=package:chromium&type=csThe above is not exactly accurate. cld seems to have a directory called "base" right in it. Then multiple projects have been patched to use src/base, but are otherwise not Chromium code.excluding third_party/cld, there are 272In the first few pages, this is mostly tcmalloc, which has its own base/ directory. Excluding that, leveldb is the next big block, which has chromium code in its upstream repo