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

Side by Side Diff: base/pickle.cc

Issue 100303003: Move more uses of string16 to specify base:: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « base/pickle.h ('k') | base/pickle_unittest.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) 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 "base/pickle.h" 5 #include "base/pickle.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <algorithm> // for max() 9 #include <algorithm> // for max()
10 10
11 //------------------------------------------------------------------------------ 11 //------------------------------------------------------------------------------
12 12
13 using base::char16;
14 using base::string16;
15
13 // static 16 // static
14 const int Pickle::kPayloadUnit = 64; 17 const int Pickle::kPayloadUnit = 64;
15 18
16 static const size_t kCapacityReadOnly = static_cast<size_t>(-1); 19 static const size_t kCapacityReadOnly = static_cast<size_t>(-1);
17 20
18 PickleIterator::PickleIterator(const Pickle& pickle) 21 PickleIterator::PickleIterator(const Pickle& pickle)
19 : read_ptr_(pickle.payload()), 22 : read_ptr_(pickle.payload()),
20 read_end_ptr_(pickle.end_of_payload()) { 23 read_end_ptr_(pickle.end_of_payload()) {
21 } 24 }
22 25
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 if (new_size > capacity_after_header_) { 328 if (new_size > capacity_after_header_) {
326 Resize(std::max(capacity_after_header_ * 2, new_size)); 329 Resize(std::max(capacity_after_header_ * 2, new_size));
327 } 330 }
328 331
329 char* write = mutable_payload() + write_offset_; 332 char* write = mutable_payload() + write_offset_;
330 memcpy(write, data, length); 333 memcpy(write, data, length);
331 memset(write + length, 0, data_len - length); 334 memset(write + length, 0, data_len - length);
332 header_->payload_size = static_cast<uint32>(write_offset_ + length); 335 header_->payload_size = static_cast<uint32>(write_offset_ + length);
333 write_offset_ = new_size; 336 write_offset_ = new_size;
334 } 337 }
OLDNEW
« no previous file with comments | « base/pickle.h ('k') | base/pickle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698