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

Side by Side Diff: ppapi/proxy/serialized_var.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
« no previous file with comments | « net/websockets/websocket_job.cc ('k') | remoting/base/compound_buffer.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 "ppapi/proxy/serialized_var.h" 5 #include "ppapi/proxy/serialized_var.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ipc/ipc_message_utils.h" 8 #include "ipc/ipc_message_utils.h"
9 #include "ppapi/proxy/dispatcher.h" 9 #include "ppapi/proxy/dispatcher.h"
10 #include "ppapi/proxy/interface_proxy.h" 10 #include "ppapi/proxy/interface_proxy.h"
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 396
397 serialized_[i].inner_->SetVar( 397 serialized_[i].inner_->SetVar(
398 serialized_[i].inner_->serialization_rules()->BeginReceiveCallerOwned( 398 serialized_[i].inner_->serialization_rules()->BeginReceiveCallerOwned(
399 serialized_[i].inner_->GetIncompleteVar(), 399 serialized_[i].inner_->GetIncompleteVar(),
400 serialized_[i].inner_->GetStringPtr(), 400 serialized_[i].inner_->GetStringPtr(),
401 dispatcher)); 401 dispatcher));
402 deserialized_[i] = serialized_[i].inner_->GetVar(); 402 deserialized_[i] = serialized_[i].inner_->GetVar();
403 } 403 }
404 404
405 *array_size = static_cast<uint32_t>(serialized_.size()); 405 *array_size = static_cast<uint32_t>(serialized_.size());
406 return deserialized_.size() > 0 ? &deserialized_[0] : NULL; 406 return deserialized_.empty() ? NULL : &deserialized_[0];
407 } 407 }
408 408
409 // SerializedVarReturnValue ---------------------------------------------------- 409 // SerializedVarReturnValue ----------------------------------------------------
410 410
411 SerializedVarReturnValue::SerializedVarReturnValue(SerializedVar* serialized) 411 SerializedVarReturnValue::SerializedVarReturnValue(SerializedVar* serialized)
412 : serialized_(serialized) { 412 : serialized_(serialized) {
413 } 413 }
414 414
415 void SerializedVarReturnValue::Return(Dispatcher* dispatcher, 415 void SerializedVarReturnValue::Return(Dispatcher* dispatcher,
416 const PP_Var& var) { 416 const PP_Var& var) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 *inner_->GetStringPtr() = str; 517 *inner_->GetStringPtr() = str;
518 } 518 }
519 519
520 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) 520 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var)
521 : SerializedVar(var) { 521 : SerializedVar(var) {
522 } 522 }
523 523
524 } // namespace proxy 524 } // namespace proxy
525 } // namespace pp 525 } // namespace pp
526 526
OLDNEW
« no previous file with comments | « net/websockets/websocket_job.cc ('k') | remoting/base/compound_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698