diff options
author | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 18:39:53 +0000 |
---|---|---|
committer | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 18:39:53 +0000 |
commit | c02cb8017a6b8ba62a88875e2034cf85c0d3c834 (patch) | |
tree | ff96ee0d2b577bb7e04c70a7f7d636d8eea37f00 /net | |
parent | a396b7b69af2d934760838cad25e6579d7d62d77 (diff) | |
download | chromium_src-c02cb8017a6b8ba62a88875e2034cf85c0d3c834.zip chromium_src-c02cb8017a6b8ba62a88875e2034cf85c0d3c834.tar.gz chromium_src-c02cb8017a6b8ba62a88875e2034cf85c0d3c834.tar.bz2 |
Change DCHECK_IS_ON() to DCHECK_IS_ON
DCHECK_IS_ON has been a constant since r255987, and can be used in both
if() and #if. It no more needs to be in function form.
Converted 'if (DCHECK_IS_ON)' to '#if DCHECK_IS_ON' if proper.
BUG=350462
TEST=build
TBR=darin
Review URL: https://codereview.chromium.org/195973002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/spdy/spdy_session.cc | 33 | ||||
-rw-r--r-- | net/spdy/spdy_write_queue.cc | 20 |
2 files changed, 27 insertions, 26 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 88d189b..ac30a52 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -756,17 +756,17 @@ void SpdySession::CancelStreamRequest( CHECK_GE(priority, MINIMUM_PRIORITY); CHECK_LE(priority, MAXIMUM_PRIORITY); - if (DCHECK_IS_ON()) { - // |request| should not be in a queue not matching its priority. - for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { - if (priority == i) - continue; - PendingStreamRequestQueue* queue = &pending_create_stream_queues_[i]; - DCHECK(std::find_if(queue->begin(), - queue->end(), - RequestEquals(request)) == queue->end()); - } +#if DCHECK_IS_ON + // |request| should not be in a queue not matching its priority. + for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { + if (priority == i) + continue; + PendingStreamRequestQueue* queue = &pending_create_stream_queues_[i]; + DCHECK(std::find_if(queue->begin(), + queue->end(), + RequestEquals(request)) == queue->end()); } +#endif PendingStreamRequestQueue* queue = &pending_create_stream_queues_[priority]; @@ -1459,13 +1459,13 @@ int SpdySession::DoWriteComplete(int result) { } void SpdySession::DcheckGoingAway() const { +#if DCHECK_IS_ON DCHECK_GE(availability_state_, STATE_GOING_AWAY); - if (DCHECK_IS_ON()) { - for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { - DCHECK(pending_create_stream_queues_[i].empty()); - } + for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { + DCHECK(pending_create_stream_queues_[i].empty()); } DCHECK(created_streams_.empty()); +#endif } void SpdySession::DcheckClosed() const { @@ -3015,8 +3015,9 @@ void SpdySession::ResumeSendStalledStreams() { while (availability_state_ != STATE_CLOSED && !IsSendStalled()) { size_t old_size = 0; - if (DCHECK_IS_ON()) - old_size = GetTotalSize(stream_send_unstall_queue_); +#if DCHECK_IS_ON + old_size = GetTotalSize(stream_send_unstall_queue_); +#endif SpdyStreamId stream_id = PopStreamToPossiblyResume(); if (stream_id == 0) diff --git a/net/spdy/spdy_write_queue.cc b/net/spdy/spdy_write_queue.cc index ea6eb1f..3a4eef5 100644 --- a/net/spdy/spdy_write_queue.cc +++ b/net/spdy/spdy_write_queue.cc @@ -77,18 +77,18 @@ void SpdyWriteQueue::RemovePendingWritesForStream( CHECK_LE(priority, MAXIMUM_PRIORITY); DCHECK(stream.get()); - if (DCHECK_IS_ON()) { - // |stream| should not have pending writes in a queue not matching - // its priority. - for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { - if (priority == i) - continue; - for (std::deque<PendingWrite>::const_iterator it = queue_[i].begin(); - it != queue_[i].end(); ++it) { - DCHECK_NE(it->stream.get(), stream.get()); - } +#if DCHECK_IS_ON + // |stream| should not have pending writes in a queue not matching + // its priority. + for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { + if (priority == i) + continue; + for (std::deque<PendingWrite>::const_iterator it = queue_[i].begin(); + it != queue_[i].end(); ++it) { + DCHECK_NE(it->stream.get(), stream.get()); } } +#endif // Do the actual deletion and removal, preserving FIFO-ness. std::deque<PendingWrite>* queue = &queue_[priority]; |