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

Side by Side Diff: chrome/browser/debugger/extension_ports_remote_service.cc

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 9 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
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 // Implementation of the ExtensionPortsRemoteService. 5 // Implementation of the ExtensionPortsRemoteService.
6 6
7 // Inspired significantly from debugger_remote_service 7 // Inspired significantly from debugger_remote_service
8 // and ../automation/extension_port_container. 8 // and ../automation/extension_port_container.
9 9
10 #include "chrome/browser/debugger/extension_ports_remote_service.h" 10 #include "chrome/browser/debugger/extension_ports_remote_service.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if (!service_) { 167 if (!service_) {
168 // This happens if we failed to obtain an ExtensionMessageService 168 // This happens if we failed to obtain an ExtensionMessageService
169 // during initialization. 169 // during initialization.
170 NOTREACHED(); 170 NOTREACHED();
171 response.SetInteger(kResultKey, RESULT_NO_SERVICE); 171 response.SetInteger(kResultKey, RESULT_NO_SERVICE);
172 SendResponse(response, message.tool(), message.destination()); 172 SendResponse(response, message.tool(), message.destination());
173 return; 173 return;
174 } 174 }
175 175
176 int destination = -1; 176 int destination = -1;
177 if (destinationString.size() != 0) 177 if (!destinationString.empty())
178 base::StringToInt(destinationString, &destination); 178 base::StringToInt(destinationString, &destination);
179 179
180 if (command == kConnect) { 180 if (command == kConnect) {
181 if (destination != -1) // destination should be empty for this command. 181 if (destination != -1) // destination should be empty for this command.
182 response.SetInteger(kResultKey, RESULT_UNKNOWN_COMMAND); 182 response.SetInteger(kResultKey, RESULT_UNKNOWN_COMMAND);
183 else 183 else
184 ConnectCommand(content, &response); 184 ConnectCommand(content, &response);
185 } else if (command == kDisconnect) { 185 } else if (command == kDisconnect) {
186 if (destination == -1) // Destination required for this command. 186 if (destination == -1) // Destination required for this command.
187 response.SetInteger(kResultKey, RESULT_UNKNOWN_COMMAND); 187 response.SetInteger(kResultKey, RESULT_UNKNOWN_COMMAND);
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 VLOG(1) << "unknown port: " << port_id; 379 VLOG(1) << "unknown port: " << port_id;
380 response->SetInteger(kResultKey, RESULT_UNKNOWN_PORT); 380 response->SetInteger(kResultKey, RESULT_UNKNOWN_PORT);
381 return; 381 return;
382 } 382 }
383 // Post the message through the ExtensionMessageService. 383 // Post the message through the ExtensionMessageService.
384 DCHECK(service_); 384 DCHECK(service_);
385 service_->PostMessageFromRenderer(port_id, message); 385 service_->PostMessageFromRenderer(port_id, message);
386 // Confirm to the external client that we sent its message. 386 // Confirm to the external client that we sent its message.
387 response->SetInteger(kResultKey, RESULT_OK); 387 response->SetInteger(kResultKey, RESULT_OK);
388 } 388 }
OLDNEW
« no previous file with comments | « chrome/browser/debugger/devtools_remote_listen_socket.cc ('k') | chrome/browser/debugger/inspectable_tab_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698