On Thu, Jul 11, 2013 at 5:50 PM, Peter Kasting <
pkas...@chromium.org> wrote:
> On Thu, Jul 11, 2013 at 5:41 PM, Matt Giuca <
mgi...@chromium.org> wrote:
>>
>> I can't find any announcement on chromium-dev about this and none of the
>> CLs link to a particular bug. I was wondering if we could get an explanation
>> on why this is happening.
>
>
> My understanding is that we're trying to move towards things in base/ being
> in base::, and ultimately things in top_level_dir/ being in top_level_dir::
> in general. This is in line with the Google-internal version of the Google
> C++ style guide (unfortunately, the publicly-available version omits the
> directives on choosing namespace names, other than to say "choose the name
> based on the project, and possibly its path"), and is also in line with e.g.
> the cc:: namespace for the compositor.
>
> Classically, our usage of namespaces has been ad-hoc and inconsistent, and
> have a file_util:: namespace for stuff just defined in a random header in
> base/ is certainly a case of this.
Yes, I'm trying to slowly make the base namespace usage consistent,
just like we're doing for content.
I agree some names are vague. I just did a patch to rename Delete ->
DeleteFile, and ContentsEqual is another case like this. Initially I
was avoiding doing this type of renaming at the same time due to a bad
experience at the beginning, but assuming the DeleteFile patch goes
OK, I will probably be more aggressive about doing renaming at the
same time as moving namespaces.
I wouldn't expect chromium-dev announcements every time a file changes
namespaces. And the base cleanup (fixing namespaces, splitting apart
huge *_util files, categorizing the directory hierarchy) has been
happening in the background for >2 years and I expect will (slowly)
continue for quite some time.
My recommended namespace usage is that it should match the toplevel
module (base, net, content, etc.) and that you can use the two common
Google sub-namespace ones ("subtle" and "internal") as necessary, but
try to avoid random per-file namespaces. However, if a different
namespace is the right answer for your problem, go ahead. We're
probably not doing a "chrome" namespace, both for practicality and
because chrome should be a leaf node so a namespace isn't so useful.
Brett