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

Side by Side Diff: chrome/browser/chromeos/system/syslogs_provider.cc

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to base namespace. (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
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 "chrome/browser/chromeos/system/syslogs_provider.h" 5 #include "chrome/browser/chromeos/system/syslogs_provider.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // value, you have to place the multi-line quote on the same line as 72 // value, you have to place the multi-line quote on the same line as
73 // the equal sign. 73 // the equal sign.
74 // 74 //
75 // Why not use TrimWhitespace? Consider the following input: 75 // Why not use TrimWhitespace? Consider the following input:
76 // 76 //
77 // KEY1= 77 // KEY1=
78 // KEY2=VALUE 78 // KEY2=VALUE
79 // 79 //
80 // If we use TrimWhitespace, we will incorrectly trim the new line 80 // If we use TrimWhitespace, we will incorrectly trim the new line
81 // and assume that KEY1's value is "KEY2=VALUE" rather than empty. 81 // and assume that KEY1's value is "KEY2=VALUE" rather than empty.
82 TrimString(*data, " \t", data); 82 base::TrimString(*data, " \t", data);
83 83
84 // If multiline value 84 // If multiline value
85 if (StartsWithASCII(*data, std::string(kMultilineQuote), false)) { 85 if (StartsWithASCII(*data, std::string(kMultilineQuote), false)) {
86 data->erase(0, strlen(kMultilineQuote)); 86 data->erase(0, strlen(kMultilineQuote));
87 size_t next_multi = data->find(kMultilineQuote); 87 size_t next_multi = data->find(kMultilineQuote);
88 if (next_multi == std::string::npos) { 88 if (next_multi == std::string::npos) {
89 // Error condition, clear data to stop further processing 89 // Error condition, clear data to stop further processing
90 data->erase(); 90 data->erase();
91 return std::string(); 91 return std::string();
92 } 92 }
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 return Singleton<SyslogsProviderImpl, 397 return Singleton<SyslogsProviderImpl,
398 DefaultSingletonTraits<SyslogsProviderImpl> >::get(); 398 DefaultSingletonTraits<SyslogsProviderImpl> >::get();
399 } 399 }
400 400
401 SyslogsProvider* SyslogsProvider::GetInstance() { 401 SyslogsProvider* SyslogsProvider::GetInstance() {
402 return SyslogsProviderImpl::GetInstance(); 402 return SyslogsProviderImpl::GetInstance();
403 } 403 }
404 404
405 } // namespace system 405 } // namespace system
406 } // namespace chromeos 406 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698