From c8b4944b44f10dc92209737015d81ca5eac9c1e7 Mon Sep 17 00:00:00 2001 From: "wtc@chromium.org" Date: Thu, 12 Nov 2009 21:20:40 +0000 Subject: Fix Coverity defects in the FLIP code. CID=6816 PASS_BY_VALUE CID=6817 PASS_BY_VALUE CID=7523 UNINIT_CTOR R=mbelshe BUG=none TEST=none Review URL: http://codereview.chromium.org/392012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31828 0039d316-1c4b-4281-b951-d872f2087c98 --- net/flip/flip_io_buffer.h | 2 +- net/flip/flip_session.cc | 4 ++-- net/flip/flip_session.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'net') diff --git a/net/flip/flip_io_buffer.h b/net/flip/flip_io_buffer.h index c7b6155..ce3d6367 100644 --- a/net/flip/flip_io_buffer.h +++ b/net/flip/flip_io_buffer.h @@ -29,7 +29,7 @@ class FlipIOBuffer { position_(++order_), stream_(stream) { } - FlipIOBuffer() : priority_(0), stream_(NULL) {} + FlipIOBuffer() : priority_(0), position_(0), stream_(NULL) {} // Accessors. IOBuffer* buffer() const { return buffer_; } diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc index b777bed..9a1a1c7 100644 --- a/net/flip/flip_session.cc +++ b/net/flip/flip_session.cc @@ -28,7 +28,7 @@ namespace net { // static bool FlipSession::use_ssl_ = true; -FlipSession::FlipSession(std::string host, HttpNetworkSession* session) +FlipSession::FlipSession(const std::string& host, HttpNetworkSession* session) : ALLOW_THIS_IN_INITIALIZER_LIST( connect_callback_(this, &FlipSession::OnTCPConnect)), ALLOW_THIS_IN_INITIALIZER_LIST( @@ -551,7 +551,7 @@ void FlipSession::DeactivateStream(flip::FlipStreamId id) { active_streams_.erase(id); } -FlipStream* FlipSession::GetPushStream(std::string path) { +FlipStream* FlipSession::GetPushStream(const std::string& path) { static StatsCounter used_push_streams("flip.claimed_push_streams"); LOG(INFO) << "Looking for push stream: " << path; diff --git a/net/flip/flip_session.h b/net/flip/flip_session.h index d3adfca..f381b20 100644 --- a/net/flip/flip_session.h +++ b/net/flip/flip_session.h @@ -125,7 +125,7 @@ class FlipSession : public base::RefCounted, // Create a new FlipSession. // |host| is the hostname that this session connects to. - FlipSession(std::string host, HttpNetworkSession* session); + FlipSession(const std::string& host, HttpNetworkSession* session); // Closes all open streams. Used as part of shutdown. void CloseAllStreams(net::Error code); @@ -171,7 +171,7 @@ class FlipSession : public base::RefCounted, // Check if we have a pending pushed-stream for this url // Returns the stream if found (and returns it from the pending // list), returns NULL otherwise. - FlipStream* GetPushStream(std::string url); + FlipStream* GetPushStream(const std::string& url); // Callbacks for the Flip session. CompletionCallbackImpl connect_callback_; -- cgit v1.1