| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // the loop. Otherwise, return. | 559 // the loop. Otherwise, return. |
| 560 if (save_next_cookie_running_) | 560 if (save_next_cookie_running_) |
| 561 return; | 561 return; |
| 562 | 562 |
| 563 SaveNextCookie(); | 563 SaveNextCookie(); |
| 564 } | 564 } |
| 565 | 565 |
| 566 GURL WebSocketJob::GetURLForCookies() const { | 566 GURL WebSocketJob::GetURLForCookies() const { |
| 567 GURL url = socket_->url(); | 567 GURL url = socket_->url(); |
| 568 std::string scheme = socket_->is_secure() ? "https" : "http"; | 568 std::string scheme = socket_->is_secure() ? "https" : "http"; |
| 569 url_canon::Replacements<char> replacements; | 569 url::Replacements<char> replacements; |
| 570 replacements.SetScheme(scheme.c_str(), | 570 replacements.SetScheme(scheme.c_str(), url::Component(0, scheme.length())); |
| 571 url_parse::Component(0, scheme.length())); | |
| 572 return url.ReplaceComponents(replacements); | 571 return url.ReplaceComponents(replacements); |
| 573 } | 572 } |
| 574 | 573 |
| 575 const AddressList& WebSocketJob::address_list() const { | 574 const AddressList& WebSocketJob::address_list() const { |
| 576 return addresses_; | 575 return addresses_; |
| 577 } | 576 } |
| 578 | 577 |
| 579 int WebSocketJob::TrySpdyStream() { | 578 int WebSocketJob::TrySpdyStream() { |
| 580 if (!socket_.get()) | 579 if (!socket_.get()) |
| 581 return ERR_FAILED; | 580 return ERR_FAILED; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 | 694 |
| 696 scoped_refptr<IOBufferWithSize> next_buffer = send_buffer_queue_.front(); | 695 scoped_refptr<IOBufferWithSize> next_buffer = send_buffer_queue_.front(); |
| 697 send_buffer_queue_.pop_front(); | 696 send_buffer_queue_.pop_front(); |
| 698 current_send_buffer_ = | 697 current_send_buffer_ = |
| 699 new DrainableIOBuffer(next_buffer.get(), next_buffer->size()); | 698 new DrainableIOBuffer(next_buffer.get(), next_buffer->size()); |
| 700 SendDataInternal(current_send_buffer_->data(), | 699 SendDataInternal(current_send_buffer_->data(), |
| 701 current_send_buffer_->BytesRemaining()); | 700 current_send_buffer_->BytesRemaining()); |
| 702 } | 701 } |
| 703 | 702 |
| 704 } // namespace net | 703 } // namespace net |
| OLD | NEW |