Skip to content

Commit

Permalink
Remove <iostream> where possible.
Browse files Browse the repository at this point in the history
<iostream> creates a static initializer. Most people don't need <iostream>
anyway--they really  need <ostream> for operator<< overloads. <iostream>
should *never* be included in a header file; <iosfwd> exists for that purpose.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3014015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53083 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
erg@google.com committed Jul 20, 2010
1 parent e52162e commit f3b1afd
Show file tree
Hide file tree
Showing 39 changed files with 18 additions and 44 deletions.
1 change: 0 additions & 1 deletion base/crypto/rsa_private_key.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "base/crypto/rsa_private_key.h"

#include <iostream>
#include <list>

#include "base/logging.h"
Expand Down
1 change: 0 additions & 1 deletion base/crypto/rsa_private_key_nss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <keyhi.h>
#include <pk11pub.h>

#include <iostream>
#include <list>

#include "base/leak_annotations.h"
Expand Down
1 change: 0 additions & 1 deletion base/crypto/rsa_private_key_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "base/crypto/rsa_private_key.h"

#include <iostream>
#include <list>

#include "base/logging.h"
Expand Down
1 change: 0 additions & 1 deletion base/file_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#endif

#include <fstream>
#include <iostream>
#include <set>

#include "base/base_paths.h"
Expand Down
1 change: 0 additions & 1 deletion base/linked_ptr_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

#include <string>
#include <iostream>

#include "base/linked_ptr.h"

Expand Down
2 changes: 1 addition & 1 deletion base/string_piece.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Copied from strings/stringpiece.cc with modifications

#include <algorithm>
#include <iostream>
#include <ostream>

#include "base/string_piece.h"

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/cocoa/nsmenuitem_additions_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <Carbon/Carbon.h>

#include <iostream>
#include <ostream>

#include "base/scoped_nsobject.h"
#include "base/sys_string_conversions.h"
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/parsers/metadata_parser_filebase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <iostream>
#include <sstream>

#include "chrome/browser/parsers/metadata_parser_filebase.h"

#include "base/file_util.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/process_info_snapshot_mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "chrome/browser/process_info_snapshot.h"

#include <iostream>
#include <sstream>

#include "base/logging.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
// unique views for the URL.

#include <fstream>
#include <iostream>
#include <vector>

#include "base/command_line.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/sync/syncable/syncable_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <sys/types.h>

#include <iostream>
#include <limits>
#include <string>

Expand Down
1 change: 0 additions & 1 deletion chrome/common/logging_chrome.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <windows.h>
#endif

#include <iostream>
#include <fstream>

#include "chrome/common/logging_chrome.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/installer/util/copy_tree_work_item_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <windows.h>

#include <fstream>
#include <iostream>

#include "base/base_paths.h"
#include "base/file_util.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/installer/util/delete_tree_work_item_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <windows.h>

#include <fstream>
#include <iostream>

#include "base/base_paths.h"
#include "base/file_util.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/installer/util/helper_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <windows.h>

#include <fstream>
#include <iostream>

#include "base/base_paths.h"
#include "base/file_util.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/installer/util/move_tree_work_item_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <windows.h>

#include <fstream>
#include <iostream>

#include "base/base_paths.h"
#include "base/file_util.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/installer/util/shell_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <shlobj.h>

#include <fstream>
#include <iostream>

#include "base/file_util.h"
#include "base/path_service.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/test/reliability/page_load_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
// --savedebuglog: save Chrome, V8, and test debug log for each page loaded.

#include <fstream>
#include <iostream>

#include "base/command_line.h"
#include "base/file_path.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/test/test_launcher/test_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "chrome/test/test_launcher/test_runner.h"

#include <iostream>
#include <vector>

#include "base/command_line.h"
Expand Down
2 changes: 0 additions & 2 deletions chrome/test/v8_unit_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <iostream>

#include "base/string_util.h"
#include "chrome/test/v8_unit_test.h"

Expand Down
1 change: 0 additions & 1 deletion chrome/tools/crash_service/crash_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <windows.h>

#include <iostream>
#include <fstream>
#include <map>
#include <sddl.h>
Expand Down
1 change: 0 additions & 1 deletion courgette/disassembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "courgette/disassembler.h"

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

Expand Down
2 changes: 0 additions & 2 deletions gfx/insets_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "gfx/insets.h"

#include <iostream>

#include "testing/gtest/include/gtest/gtest.h"

TEST(InsetsTest, InsetsDefault) {
Expand Down
2 changes: 1 addition & 1 deletion gfx/point.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <windows.h>
#endif

#include <iostream>
#include <ostream>

namespace gfx {

Expand Down
2 changes: 1 addition & 1 deletion gfx/rect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <gdk/gdk.h>
#endif

#include <iostream>
#include <ostream>

#include "base/logging.h"
#include "gfx/insets.h"
Expand Down
2 changes: 1 addition & 1 deletion gfx/size.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <CoreGraphics/CGGeometry.h>
#endif

#include <iostream>
#include <ostream>

#include "base/logging.h"

Expand Down
1 change: 0 additions & 1 deletion ipc/ipc_fuzzing_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

#include <stdio.h>
#include <iostream>
#include <string>
#include <sstream>

Expand Down
1 change: 0 additions & 1 deletion ipc/ipc_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#endif

#include <stdio.h>
#include <iostream>
#include <string>

#include "ipc/ipc_tests.h"
Expand Down
1 change: 0 additions & 1 deletion ipc/sync_socket_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

#include <stdio.h>
#include <iostream>
#include <string>
#include <sstream>

Expand Down
2 changes: 2 additions & 0 deletions net/base/x509_cert_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "net/base/x509_cert_types.h"

#include <ostream>

#include "net/base/x509_certificate.h"
#include "base/logging.h"

Expand Down
2 changes: 1 addition & 1 deletion net/base/x509_cert_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string.h>

#include <functional>
#include <iostream>
#include <iosfwd>
#include <map>
#include <set>
#include <string>
Expand Down
1 change: 0 additions & 1 deletion net/tools/flip_server/balsa_frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <strings.h>

#include <limits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
Expand Down
6 changes: 6 additions & 0 deletions net/tools/flip_server/balsa_headers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ namespace net {

const size_t BalsaBuffer::kDefaultBlocksize;

std::ostream& BalsaHeaders::iterator_base::operator<<(std::ostream& os,
const iterator_base& it) {
os << "[" << it.headers_ << ", " << it.idx_ << "]";
return os;
}

void BalsaHeaders::Clear() {
balsa_buffer_.Clear();
transfer_encoding_is_chunked_ = false;
Expand Down
7 changes: 2 additions & 5 deletions net/tools/flip_server/balsa_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define NET_TOOLS_FLIP_SERVER_BALSA_HEADERS_H_

#include <algorithm>
#include <iostream>
#include <iosfwd>
#include <iterator>
#include <string>
#include <utility>
Expand Down Expand Up @@ -470,10 +470,7 @@ class BalsaHeaders {
// operator<< work for the classes it sees. It would be better if there
// was an additional traits-like system for the gUnit output... but oh
// well.
friend std::ostream& operator<<(std::ostream& os, const iterator_base& it) {
os << "[" << it.headers_ << ", " << it.idx_ << "]";
return os;
}
std::ostream& operator<<(std::ostream& os, const iterator_base& it);

protected:
iterator_base(const BalsaHeaders* headers, HeaderLines::size_type index) :
Expand Down
1 change: 1 addition & 0 deletions net/tools/flip_server/create_listener.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <sys/socket.h> // for getaddrinfo and getnameinfo
#include <sys/types.h> // "
#include <unistd.h> // for exit()
#include <ostream>

#include "net/tools/flip_server/create_listener.h"

Expand Down
2 changes: 1 addition & 1 deletion net/tools/flip_server/create_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef NET_TOOLS_FLIP_SERVER_CREATE_LISTENER_H__
#define NET_TOOLS_FLIP_SERVER_CREATE_LISTENER_H__

#include <iostream>
#include <iosfwd>
#include <string>

namespace net {
Expand Down
1 change: 0 additions & 1 deletion sandbox/linux/seccomp/library.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <errno.h>
#include <errno.h>
#include <fcntl.h>
#include <iostream>
#include <linux/unistd.h>
#include <set>
#include <signal.h>
Expand Down
1 change: 0 additions & 1 deletion sandbox/linux/seccomp/maps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <errno.h>
#include <fcntl.h>
#include <iostream>
#include <linux/unistd.h>
#include <signal.h>
#include <stdarg.h>
Expand Down
1 change: 0 additions & 1 deletion sandbox/linux/seccomp/sandbox_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
({ typeof(x) i__; while ((i__ = (x)) < 0 && sys.my_errno == EINTR); i__;})

#ifdef __cplusplus
#include <iostream>
#include <map>
#include <vector>
#include "sandbox.h"
Expand Down

0 comments on commit f3b1afd

Please sign in to comment.