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

Side by Side Diff: base/environment.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 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
« no previous file with comments | « base/debug/stack_trace_win.cc ('k') | base/environment.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef BASE_ENVIRONMENT_H_ 5 #ifndef BASE_ENVIRONMENT_H_
6 #define BASE_ENVIRONMENT_H_ 6 #define BASE_ENVIRONMENT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory>
9 #include <string> 10 #include <string>
10 11
11 #include "base/base_export.h" 12 #include "base/base_export.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 15
16 namespace base { 16 namespace base {
17 17
18 namespace env_vars { 18 namespace env_vars {
19 19
20 #if defined(OS_POSIX) 20 #if defined(OS_POSIX)
21 BASE_EXPORT extern const char kHome[]; 21 BASE_EXPORT extern const char kHome[];
22 #endif 22 #endif
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 typedef std::map<NativeEnvironmentString, NativeEnvironmentString> 72 typedef std::map<NativeEnvironmentString, NativeEnvironmentString>
73 EnvironmentMap; 73 EnvironmentMap;
74 74
75 // See general comments for the Windows version above. 75 // See general comments for the Windows version above.
76 // 76 //
77 // This Posix version takes and returns a Posix-style environment block, which 77 // This Posix version takes and returns a Posix-style environment block, which
78 // is a null-terminated list of pointers to null-terminated strings. The 78 // is a null-terminated list of pointers to null-terminated strings. The
79 // returned array will have appended to it the storage for the array itself so 79 // returned array will have appended to it the storage for the array itself so
80 // there is only one pointer to manage, but this means that you can't copy the 80 // there is only one pointer to manage, but this means that you can't copy the
81 // array without keeping the original around. 81 // array without keeping the original around.
82 BASE_EXPORT scoped_ptr<char*[]> AlterEnvironment( 82 BASE_EXPORT std::unique_ptr<char* []> AlterEnvironment(
83 const char* const* env, 83 const char* const* env,
84 const EnvironmentMap& changes); 84 const EnvironmentMap& changes);
85 85
86 #endif 86 #endif
87 87
88 } // namespace base 88 } // namespace base
89 89
90 #endif // BASE_ENVIRONMENT_H_ 90 #endif // BASE_ENVIRONMENT_H_
OLDNEW
« no previous file with comments | « base/debug/stack_trace_win.cc ('k') | base/environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698