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

Side by Side Diff: net/base/mime_util.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 <algorithm> 5 #include <algorithm>
6 #include <iterator> 6 #include <iterator>
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 661
662 bool MimeUtil::AreSupportedMediaCodecs( 662 bool MimeUtil::AreSupportedMediaCodecs(
663 const std::vector<std::string>& codecs) const { 663 const std::vector<std::string>& codecs) const {
664 return AreSupportedCodecs(codecs_map_, codecs); 664 return AreSupportedCodecs(codecs_map_, codecs);
665 } 665 }
666 666
667 void MimeUtil::ParseCodecString(const std::string& codecs, 667 void MimeUtil::ParseCodecString(const std::string& codecs,
668 std::vector<std::string>* codecs_out, 668 std::vector<std::string>* codecs_out,
669 bool strip) { 669 bool strip) {
670 std::string no_quote_codecs; 670 std::string no_quote_codecs;
671 TrimString(codecs, "\"", &no_quote_codecs); 671 base::TrimString(codecs, "\"", &no_quote_codecs);
672 base::SplitString(no_quote_codecs, ',', codecs_out); 672 base::SplitString(no_quote_codecs, ',', codecs_out);
673 673
674 if (!strip) 674 if (!strip)
675 return; 675 return;
676 676
677 // Strip everything past the first '.' 677 // Strip everything past the first '.'
678 for (std::vector<std::string>::iterator it = codecs_out->begin(); 678 for (std::vector<std::string>::iterator it = codecs_out->begin();
679 it != codecs_out->end(); 679 it != codecs_out->end();
680 ++it) { 680 ++it) {
681 size_t found = it->find_first_of('.'); 681 size_t found = it->find_first_of('.');
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 post_data->append("\r\n" + value + "\r\n"); 1015 post_data->append("\r\n" + value + "\r\n");
1016 } 1016 }
1017 1017
1018 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, 1018 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary,
1019 std::string* post_data) { 1019 std::string* post_data) {
1020 DCHECK(post_data); 1020 DCHECK(post_data);
1021 post_data->append("--" + mime_boundary + "--\r\n"); 1021 post_data->append("--" + mime_boundary + "--\r\n");
1022 } 1022 }
1023 1023
1024 } // namespace net 1024 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698