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

Unified Diff: net/socket_stream/socket_stream.cc

Issue 141683005: Removes MessageLoop::Type checks in favor of IsCurrent on MessageLoops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: base:: Created 6 years, 11 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
« no previous file with comments | « net/cert/cert_database_mac.cc ('k') | remoting/host/desktop_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket_stream/socket_stream.cc
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index 64190f09715de8abf052a70a5742c14e5c627c8d..1682ddcbede9cabf47eb16690cdbb7d96e1bc7f6 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -111,7 +111,7 @@ SocketStream::SocketStream(const GURL& url, Delegate* delegate)
metrics_(new SocketStreamMetrics(url)) {
DCHECK(base::MessageLoop::current())
<< "The current base::MessageLoop must exist";
- DCHECK_EQ(base::MessageLoop::TYPE_IO, base::MessageLoop::current()->type())
+ DCHECK(base::MessageLoopForIO::IsCurrent())
<< "The current base::MessageLoop must be TYPE_IO";
DCHECK(delegate_);
}
@@ -170,7 +170,7 @@ void SocketStream::CheckPrivacyMode() {
void SocketStream::Connect() {
DCHECK(base::MessageLoop::current())
<< "The current base::MessageLoop must exist";
- DCHECK_EQ(base::MessageLoop::TYPE_IO, base::MessageLoop::current()->type())
+ DCHECK(base::MessageLoopForIO::IsCurrent())
<< "The current base::MessageLoop must be TYPE_IO";
if (context_) {
context_->ssl_config_service()->GetSSLConfig(&server_ssl_config_);
@@ -203,7 +203,7 @@ size_t SocketStream::GetTotalSizeOfPendingWriteBufs() const {
bool SocketStream::SendData(const char* data, int len) {
DCHECK(base::MessageLoop::current())
<< "The current base::MessageLoop must exist";
- DCHECK_EQ(base::MessageLoop::TYPE_IO, base::MessageLoop::current()->type())
+ DCHECK(base::MessageLoopForIO::IsCurrent())
<< "The current base::MessageLoop must be TYPE_IO";
DCHECK_GT(len, 0);
@@ -250,7 +250,7 @@ bool SocketStream::SendData(const char* data, int len) {
void SocketStream::Close() {
DCHECK(base::MessageLoop::current())
<< "The current base::MessageLoop must exist";
- DCHECK_EQ(base::MessageLoop::TYPE_IO, base::MessageLoop::current()->type())
+ DCHECK(base::MessageLoopForIO::IsCurrent())
<< "The current base::MessageLoop must be TYPE_IO";
// If next_state_ is STATE_NONE, the socket was not opened, or already
// closed. So, return immediately.
@@ -265,7 +265,7 @@ void SocketStream::Close() {
void SocketStream::RestartWithAuth(const AuthCredentials& credentials) {
DCHECK(base::MessageLoop::current())
<< "The current base::MessageLoop must exist";
- DCHECK_EQ(base::MessageLoop::TYPE_IO, base::MessageLoop::current()->type())
+ DCHECK(base::MessageLoopForIO::IsCurrent())
<< "The current base::MessageLoop must be TYPE_IO";
DCHECK(proxy_auth_controller_.get());
if (!connection_->socket()) {
@@ -358,7 +358,7 @@ void SocketStream::DoClose() {
void SocketStream::Finish(int result) {
DCHECK(base::MessageLoop::current())
<< "The current base::MessageLoop must exist";
- DCHECK_EQ(base::MessageLoop::TYPE_IO, base::MessageLoop::current()->type())
+ DCHECK(base::MessageLoopForIO::IsCurrent())
<< "The current base::MessageLoop must be TYPE_IO";
DCHECK_LE(result, OK);
if (result == OK)
« no previous file with comments | « net/cert/cert_database_mac.cc ('k') | remoting/host/desktop_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698