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

Side by Side Diff: base/memory/ref_counted_memory.cc

Issue 10165020: Move RefCountedStaticMemory to base namespace (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « base/memory/ref_counted_memory.h ('k') | chrome/browser/icon_loader_chromeos.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/memory/ref_counted_memory.h" 5 #include "base/memory/ref_counted_memory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 RefCountedMemory::RefCountedMemory() { 9 RefCountedMemory::RefCountedMemory() {
10 } 10 }
11 11
12 RefCountedMemory::~RefCountedMemory() { 12 RefCountedMemory::~RefCountedMemory() {
13 } 13 }
14 14
15 namespace base {
16
15 const unsigned char* RefCountedStaticMemory::front() const { 17 const unsigned char* RefCountedStaticMemory::front() const {
16 return data_; 18 return data_;
17 } 19 }
18 20
19 size_t RefCountedStaticMemory::size() const { 21 size_t RefCountedStaticMemory::size() const {
20 return length_; 22 return length_;
21 } 23 }
22 24
23 namespace base {
24
25 RefCountedBytes::RefCountedBytes() { 25 RefCountedBytes::RefCountedBytes() {
26 } 26 }
27 27
28 RefCountedBytes::RefCountedBytes(const std::vector<unsigned char>& initializer) 28 RefCountedBytes::RefCountedBytes(const std::vector<unsigned char>& initializer)
29 : data_(initializer) { 29 : data_(initializer) {
30 } 30 }
31 31
32 RefCountedBytes* RefCountedBytes::TakeVector( 32 RefCountedBytes* RefCountedBytes::TakeVector(
33 std::vector<unsigned char>* to_destroy) { 33 std::vector<unsigned char>* to_destroy) {
34 RefCountedBytes* bytes = new RefCountedBytes; 34 RefCountedBytes* bytes = new RefCountedBytes;
(...skipping 28 matching lines...) Expand all
63 const unsigned char* RefCountedString::front() const { 63 const unsigned char* RefCountedString::front() const {
64 return data_.empty() ? NULL : 64 return data_.empty() ? NULL :
65 reinterpret_cast<const unsigned char*>(data_.data()); 65 reinterpret_cast<const unsigned char*>(data_.data());
66 } 66 }
67 67
68 size_t RefCountedString::size() const { 68 size_t RefCountedString::size() const {
69 return data_.size(); 69 return data_.size();
70 } 70 }
71 71
72 } // namespace base 72 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/ref_counted_memory.h ('k') | chrome/browser/icon_loader_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698