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

Side by Side Diff: remoting/host/native_messaging/native_messaging_reader.cc

Issue 1609923002: Fix remaining incompatibilities between scoped_ptr and unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "remoting/host/native_messaging/native_messaging_reader.h" 5 #include "remoting/host/native_messaging/native_messaging_reader.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 message_length); 108 message_length);
109 if (read_result != static_cast<int>(message_length)) { 109 if (read_result != static_cast<int>(message_length)) {
110 LOG(ERROR) << "Failed to read message body, read returned " 110 LOG(ERROR) << "Failed to read message body, read returned "
111 << read_result; 111 << read_result;
112 NotifyEof(); 112 NotifyEof();
113 return; 113 return;
114 } 114 }
115 115
116 scoped_ptr<base::Value> message = base::JSONReader::Read(message_json); 116 scoped_ptr<base::Value> message = base::JSONReader::Read(message_json);
117 if (!message) { 117 if (!message) {
118 LOG(ERROR) << "Failed to parse JSON message: " << message; 118 LOG(ERROR) << "Failed to parse JSON message: " << message.get();
119 NotifyEof(); 119 NotifyEof();
120 return; 120 return;
121 } 121 }
122 122
123 // Notify callback of new message. 123 // Notify callback of new message.
124 caller_task_runner_->PostTask( 124 caller_task_runner_->PostTask(
125 FROM_HERE, base::Bind(&NativeMessagingReader::InvokeMessageCallback, 125 FROM_HERE, base::Bind(&NativeMessagingReader::InvokeMessageCallback,
126 reader_, base::Passed(&message))); 126 reader_, base::Passed(&message)));
127 } 127 }
128 } 128 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void NativeMessagingReader::InvokeMessageCallback( 162 void NativeMessagingReader::InvokeMessageCallback(
163 scoped_ptr<base::Value> message) { 163 scoped_ptr<base::Value> message) {
164 message_callback_.Run(std::move(message)); 164 message_callback_.Run(std::move(message));
165 } 165 }
166 166
167 void NativeMessagingReader::InvokeEofCallback() { 167 void NativeMessagingReader::InvokeEofCallback() {
168 eof_callback_.Run(); 168 eof_callback_.Run();
169 } 169 }
170 170
171 } // namespace remoting 171 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698