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

Side by Side Diff: net/ftp/ftp_ctrl_response_buffer.cc

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 years, 8 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
« no previous file with comments | « net/filter/sdch_filter_unittest.cc ('k') | net/ftp/ftp_network_layer.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ftp/ftp_ctrl_response_buffer.h" 5 #include "net/ftp/ftp_ctrl_response_buffer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 line_buf_.clear(); 76 line_buf_.clear();
77 } 77 }
78 } 78 }
79 } 79 }
80 80
81 return OK; 81 return OK;
82 } 82 }
83 83
84 namespace { 84 namespace {
85 85
86 scoped_ptr<base::Value> NetLogFtpCtrlResponseCallback( 86 std::unique_ptr<base::Value> NetLogFtpCtrlResponseCallback(
87 const FtpCtrlResponse* response, 87 const FtpCtrlResponse* response,
88 NetLogCaptureMode capture_mode) { 88 NetLogCaptureMode capture_mode) {
89 scoped_ptr<base::ListValue> lines(new base::ListValue()); 89 std::unique_ptr<base::ListValue> lines(new base::ListValue());
90 lines->AppendStrings(response->lines); 90 lines->AppendStrings(response->lines);
91 91
92 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 92 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
93 dict->SetInteger("status_code", response->status_code); 93 dict->SetInteger("status_code", response->status_code);
94 dict->Set("lines", std::move(lines)); 94 dict->Set("lines", std::move(lines));
95 return std::move(dict); 95 return std::move(dict);
96 } 96 }
97 97
98 } // namespace 98 } // namespace
99 99
100 FtpCtrlResponse FtpCtrlResponseBuffer::PopResponse() { 100 FtpCtrlResponse FtpCtrlResponseBuffer::PopResponse() {
101 FtpCtrlResponse result = responses_.front(); 101 FtpCtrlResponse result = responses_.front();
102 responses_.pop(); 102 responses_.pop();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 for (size_t i = 0; i < buffer_.length(); i++) { 152 for (size_t i = 0; i < buffer_.length(); i++) {
153 if (i >= 1 && buffer_[i - 1] == '\r' && buffer_[i] == '\n') { 153 if (i >= 1 && buffer_[i - 1] == '\r' && buffer_[i] == '\n') {
154 lines_.push(ParseLine(buffer_.substr(cut_pos, i - cut_pos - 1))); 154 lines_.push(ParseLine(buffer_.substr(cut_pos, i - cut_pos - 1)));
155 cut_pos = i + 1; 155 cut_pos = i + 1;
156 } 156 }
157 } 157 }
158 buffer_.erase(0, cut_pos); 158 buffer_.erase(0, cut_pos);
159 } 159 }
160 160
161 } // namespace net 161 } // namespace net
OLDNEW
« no previous file with comments | « net/filter/sdch_filter_unittest.cc ('k') | net/ftp/ftp_network_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698