summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 16:33:14 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 16:33:14 +0000
commit816721e5f44997efdf2fb5280666ccd126f4c00e (patch)
tree0ab3cd5a30d71a16df1d5b0f84d1e576665351a1 /sandbox
parentd75faa8114fe821e65c2c3844729cf10d3c69088 (diff)
downloadchromium_src-816721e5f44997efdf2fb5280666ccd126f4c00e.zip
chromium_src-816721e5f44997efdf2fb5280666ccd126f4c00e.tar.gz
chromium_src-816721e5f44997efdf2fb5280666ccd126f4c00e.tar.bz2
Sync sandbox WriteInto with updated version from base
Review URL: http://codereview.chromium.org/45049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/src/sandbox_utils.h12
-rw-r--r--sandbox/wow_helper/wow_helper.cc18
2 files changed, 13 insertions, 17 deletions
diff --git a/sandbox/src/sandbox_utils.h b/sandbox/src/sandbox_utils.h
index b292ed0..e6cac5d 100644
--- a/sandbox/src/sandbox_utils.h
+++ b/sandbox/src/sandbox_utils.h
@@ -35,13 +35,11 @@ void InitObjectAttribs(const std::wstring& name, ULONG attributes, HANDLE root,
// The next 2 functions are copied from base\string_util.h and have been
// slighty modified because we don't want to depend on ICU.
-template <class char_type>
-inline char_type* WriteInto(
- std::basic_string<char_type, std::char_traits<char_type>,
- std::allocator<char_type> >* str,
- size_t length_including_null) {
- str->reserve(length_including_null);
- str->resize(length_including_null - 1);
+template <class string_type>
+inline typename string_type::value_type* WriteInto(string_type* str,
+ size_t length_with_null) {
+ str->reserve(length_with_null);
+ str->resize(length_with_null - 1);
return &((*str)[0]);
}
diff --git a/sandbox/wow_helper/wow_helper.cc b/sandbox/wow_helper/wow_helper.cc
index 6df4c0e..6c272e4 100644
--- a/sandbox/wow_helper/wow_helper.cc
+++ b/sandbox/wow_helper/wow_helper.cc
@@ -17,18 +17,16 @@
namespace {
-// Grabbed from chrome/common/string_util.h
-template <class char_type>
-inline char_type* WriteInto(
- std::basic_string<char_type, std::char_traits<char_type>,
- std::allocator<char_type> >* str,
- size_t length_including_null) {
- str->reserve(length_including_null);
- str->resize(length_including_null - 1);
+// Grabbed from base/string_util.h
+template <class string_type>
+inline typename string_type::value_type* WriteInto(string_type* str,
+ size_t length_with_null) {
+ str->reserve(length_with_null);
+ str->resize(length_with_null - 1);
return &((*str)[0]);
}
-// Grabbed from chrome/common/string_util.cc
+// Grabbed from base/string_util.cc
std::string WideToMultiByte(const std::wstring& wide, UINT code_page) {
if (wide.length() == 0)
return std::string();
@@ -47,7 +45,7 @@ std::string WideToMultiByte(const std::wstring& wide, UINT code_page) {
return mb;
}
-// Grabbed from chrome/common/string_util.cc
+// Grabbed from base/string_util.cc
std::string WideToUTF8(const std::wstring& wide) {
return WideToMultiByte(wide, CP_UTF8);
}