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

Side by Side Diff: net/base/mime_util.cc

Issue 471193002: Adding extension/mime mapping for HLS streams (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make the unit test to run on android only Created 6 years, 4 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 | « no previous file | net/base/mime_util_unittest.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 <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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 { "image/x-png", "png"}, 236 { "image/x-png", "png"},
237 { "message/rfc822", "eml" }, 237 { "message/rfc822", "eml" },
238 { "text/plain", "txt,text" }, 238 { "text/plain", "txt,text" },
239 { "text/html", "ehtml" }, 239 { "text/html", "ehtml" },
240 { "application/rss+xml", "rss" }, 240 { "application/rss+xml", "rss" },
241 { "application/rdf+xml", "rdf" }, 241 { "application/rdf+xml", "rdf" },
242 { "text/xml", "xsl,xbl,xslt" }, 242 { "text/xml", "xsl,xbl,xslt" },
243 { "application/vnd.mozilla.xul+xml", "xul" }, 243 { "application/vnd.mozilla.xul+xml", "xul" },
244 { "application/x-shockwave-flash", "swf,swl" }, 244 { "application/x-shockwave-flash", "swf,swl" },
245 { "application/pkcs7-mime", "p7m,p7c,p7z" }, 245 { "application/pkcs7-mime", "p7m,p7c,p7z" },
246 { "application/pkcs7-signature", "p7s" } 246 { "application/pkcs7-signature", "p7s" },
247 { "application/x-mpegurl", "m3u8" },
247 }; 248 };
248 249
249 static const char* FindMimeType(const MimeInfo* mappings, 250 static const char* FindMimeType(const MimeInfo* mappings,
250 size_t mappings_len, 251 size_t mappings_len,
251 const char* ext) { 252 const char* ext) {
252 size_t ext_len = strlen(ext); 253 size_t ext_len = strlen(ext);
253 254
254 for (size_t i = 0; i < mappings_len; ++i) { 255 for (size_t i = 0; i < mappings_len; ++i) {
255 const char* extensions = mappings[i].extensions; 256 const char* extensions = mappings[i].extensions;
256 for (;;) { 257 for (;;) {
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 post_data->append("\r\n" + value + "\r\n"); 1360 post_data->append("\r\n" + value + "\r\n");
1360 } 1361 }
1361 1362
1362 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, 1363 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary,
1363 std::string* post_data) { 1364 std::string* post_data) {
1364 DCHECK(post_data); 1365 DCHECK(post_data);
1365 post_data->append("--" + mime_boundary + "--\r\n"); 1366 post_data->append("--" + mime_boundary + "--\r\n");
1366 } 1367 }
1367 1368
1368 } // namespace net 1369 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/mime_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698