[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:30:26 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit d13bfc408348c95b16333fefce9520fd1c9e3cae
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 9 23:08:44 2009 +0000

    2009-12-09  Chris Jerdonek  <chris.jerdonek at gmail.com>
    
            Reviewed by Darin Adler.
    
            Added the "using std::foo" rule to the coding style guidelines.
    
            https://bugs.webkit.org/show_bug.cgi?id=32301
    
            Added to the coding style guidelines the "using std::foo" rule
            checked by the check-webkit-style script.  Also clarified the
            "using" statement guidelines that apply to implementation files.
    
            * coding/coding-style.html:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51929 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitSite/ChangeLog b/WebKitSite/ChangeLog
index b33c14d..d7a23e3 100644
--- a/WebKitSite/ChangeLog
+++ b/WebKitSite/ChangeLog
@@ -1,3 +1,17 @@
+2009-12-09  Chris Jerdonek  <chris.jerdonek at gmail.com>
+
+        Reviewed by Darin Adler.
+
+        Added the "using std::foo" rule to the coding style guidelines.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=32301
+        
+        Added to the coding style guidelines the "using std::foo" rule
+        checked by the check-webkit-style script.  Also clarified the
+        "using" statement guidelines that apply to implementation files.
+
+        * coding/coding-style.html:
+
 2009-12-05  Chris Jerdonek  <chris.jerdonek at gmail.com>
 
         Reviewed by Darin Adler.
diff --git a/WebKitSite/coding/coding-style.html b/WebKitSite/coding/coding-style.html
index d8c740b..7e5e61b 100644
--- a/WebKitSite/coding/coding-style.html
+++ b/WebKitSite/coding/coding-style.html
@@ -709,8 +709,8 @@ Don't bother to organize them in a logical order.
 
 <ol>
 
-<li>In header files, do not use "using" statements in global or 
-"namespace" scope.
+<li>In header files, do not use "using" statements in namespace
+(or global) scope.
 
 <h4 class="right">Right:</h4>
 <pre class="code">
@@ -741,9 +741,9 @@ class VectorBuffer {
 </pre>
 </li>
 
-<li>It is acceptable, however, to use "using" declarations at the end of 
-header files in the WTF sub-library to include one or more names in 
-the WTF namespace into the global scope.
+<li>In header files in the WTF sub-library, however, it is acceptable
+to use "using" declarations at the end of the file to import one
+or more names in the WTF namespace into the global scope.
 
 <h4 class="right">Right:</h4>
 <pre class="code">
@@ -777,8 +777,36 @@ using WTF::PlacementNewAdopt;
 </pre>
 </li>
 
-<li>Any "using namespace" statements for a nested namespace whose parent namespace 
-is also defined in a file must be declared within that namespace definition.
+<li>In C++ implementation files, do not use statements of the form
+"using std::foo" to import names in the standard template library.
+Use "using namespace std" instead.
+
+<h4 class="right">Right:</h4>
+<pre class="code">
+// HTMLBaseElement.cpp
+
+using namespace std;
+
+namespace WebCore {
+
+} // namespace WebCore
+</pre>
+
+<h4 class="wrong">Wrong:</h4>
+<pre class="code">
+// HTMLBaseElement.cpp
+
+using std::swap;
+
+namespace WebCore {
+
+} // namespace WebCore
+</pre>
+</li>
+
+<li>In implementation files, if a "using namespace" statement is
+for a nested namespace whose parent namespace is defined in the file,
+put the statement inside that namespace definition.
 
 <h4 class="right">Right:</h4>
 <pre class="code">
@@ -803,8 +831,10 @@ namespace WebCore {
 </pre>
 </li>
 
-<li>Any other "using namespace" statements must be declared before the first namespace 
-definition in the file.
+<li>In implementation files, put all other "using" statements
+at the beginning of the file, before any namespace definitions and
+after any "include" statements.
+
 <h4 class="right">Right:</h4>
 <pre class="code">
 // HTMLSelectElement.cpp

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list