Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: base/containers/linked_list.h

Issue 240873003: Create WebSocketTransportClientSocketPool (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor fixes and comment tidying. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/containers/linked_list.h
diff --git a/base/containers/linked_list.h b/base/containers/linked_list.h
index 25bbe762cb759b4eba6c67b00ec0206c3e6bec4f..10d2c445895a3fc1c2e5dc120e44f292544d85b0 100644
--- a/base/containers/linked_list.h
+++ b/base/containers/linked_list.h
@@ -5,6 +5,8 @@
#ifndef BASE_CONTAINERS_LINKED_LIST_H_
#define BASE_CONTAINERS_LINKED_LIST_H_
+#include "base/macros.h"
+
// Simple LinkedList type. (See the Q&A section to understand how this
// differs from std::list).
//
@@ -106,6 +108,8 @@ class LinkNode {
void RemoveFromList() {
this->previous_->next_ = this->next_;
this->next_->previous_ = this->previous_;
+ this->next_ = NULL;
+ this->previous_ = NULL;
tyoshino (SeeGerritForStatus) 2014/05/22 06:04:01 use 0 or NULL for both initializer list and here?
Adam Rice 2014/05/22 06:49:07 Okay, I changed the initialisers to use NULL for s
}
LinkNode<T>* previous() const {
@@ -128,6 +132,8 @@ class LinkNode {
private:
LinkNode<T>* previous_;
LinkNode<T>* next_;
+
+ DISALLOW_COPY_AND_ASSIGN(LinkNode);
};
template <typename T>
@@ -155,8 +161,12 @@ class LinkedList {
return &root_;
}
+ bool empty() const { return head() == end(); }
+
private:
LinkNode<T> root_;
+
+ DISALLOW_COPY_AND_ASSIGN(LinkedList);
};
} // namespace base
« no previous file with comments | « no previous file | base/containers/linked_list_unittest.cc » ('j') | net/socket/client_socket_pool_manager_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698