Currently, the style guidelines specify "The contents of an outermost namespace 
block (and any nested namespaces with the same scope) should not be indented."

I like this rule - *most* of the time.

A common pattern throughout the project is forward declaring types from 
different namespaces in headers.  And traditionally, we've indented these 
declarations.

While it's not difficult to find this pattern in WebCore itself, it is quite 
pervasive in the WebKit layers where WebCore:: types often need to be forward 
declared.  To be clear, I'm talking about situations like this from 
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:

namespace WebCore {
    class AuthenticationChallenge;
    class CachedFrame;
    class HistoryItem;
    class ProtectionSpace;
    class ResourceLoader;
    class ResourceRequest;
}

class WebFrameLoaderClient : public WebCore::FrameLoaderClient {
    ...
}

...which I think is far superior in the header to:

namespace WebCore {
class AuthenticationChallenge;
class CachedFrame;
class HistoryItem;
class ProtectionSpace;
class ResourceLoader;
class ResourceRequest;
}

class WebFrameLoaderClient : public WebCore::FrameLoaderClient {
    ...
}

I think this pattern increases readability of forward declarations in headers 
and we should change the style guidelines to specify its continued use.

Thoughts?

~Brady
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to