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

Side by Side Diff: net/websockets/websocket_job.cc

Issue 3040016: Net: Convert username and password to string16. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: address comments Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/websockets/websocket_job.h ('k') | net/websockets/websocket_job_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/websockets/websocket_job.h" 5 #include "net/websockets/websocket_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/string_tokenizer.h" 9 #include "base/string_tokenizer.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 state_ = CLOSING; 127 state_ = CLOSING;
128 if (current_buffer_) { 128 if (current_buffer_) {
129 // Will close in SendPending. 129 // Will close in SendPending.
130 return; 130 return;
131 } 131 }
132 state_ = CLOSED; 132 state_ = CLOSED;
133 socket_->Close(); 133 socket_->Close();
134 } 134 }
135 135
136 void WebSocketJob::RestartWithAuth( 136 void WebSocketJob::RestartWithAuth(
137 const std::wstring& username, 137 const string16& username,
138 const std::wstring& password) { 138 const string16& password) {
139 state_ = CONNECTING; 139 state_ = CONNECTING;
140 socket_->RestartWithAuth(username, password); 140 socket_->RestartWithAuth(username, password);
141 } 141 }
142 142
143 void WebSocketJob::DetachDelegate() { 143 void WebSocketJob::DetachDelegate() {
144 state_ = CLOSED; 144 state_ = CLOSED;
145 Singleton<WebSocketThrottle>::get()->RemoveFromQueue(this); 145 Singleton<WebSocketThrottle>::get()->RemoveFromQueue(this);
146 Singleton<WebSocketThrottle>::get()->WakeupSocketIfNecessary(); 146 Singleton<WebSocketThrottle>::get()->WakeupSocketIfNecessary();
147 147
148 scoped_refptr<WebSocketJob> protect(this); 148 scoped_refptr<WebSocketJob> protect(this);
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 socket_->Close(); 489 socket_->Close();
490 return; 490 return;
491 } 491 }
492 current_buffer_ = new DrainableIOBuffer( 492 current_buffer_ = new DrainableIOBuffer(
493 send_frame_handler_->GetCurrentBuffer(), 493 send_frame_handler_->GetCurrentBuffer(),
494 send_frame_handler_->GetCurrentBufferSize()); 494 send_frame_handler_->GetCurrentBufferSize());
495 socket_->SendData(current_buffer_->data(), current_buffer_->BytesRemaining()); 495 socket_->SendData(current_buffer_->data(), current_buffer_->BytesRemaining());
496 } 496 }
497 497
498 } // namespace net 498 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_job.h ('k') | net/websockets/websocket_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698