OLD | NEW |
---|---|
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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
352 return g_mime_util.Get().GetMimeTypeFromFile(file_path, mime_type); | 352 return g_mime_util.Get().GetMimeTypeFromFile(file_path, mime_type); |
353 } | 353 } |
354 | 354 |
355 bool GetWellKnownMimeTypeFromExtension(const base::FilePath::StringType& ext, | 355 bool GetWellKnownMimeTypeFromExtension(const base::FilePath::StringType& ext, |
356 std::string* mime_type) { | 356 std::string* mime_type) { |
357 return g_mime_util.Get().GetWellKnownMimeTypeFromExtension(ext, mime_type); | 357 return g_mime_util.Get().GetWellKnownMimeTypeFromExtension(ext, mime_type); |
358 } | 358 } |
359 | 359 |
360 bool GetPreferredExtensionForMimeType(const std::string& mime_type, | 360 bool GetPreferredExtensionForMimeType(const std::string& mime_type, |
361 base::FilePath::StringType* extension) { | 361 base::FilePath::StringType* extension) { |
362 // Force .crt extension for client certificates. | |
Ryan Sleevi
2015/12/01 22:45:47
Shouldn't this only be for ChromeOS, and embedded
svaldez
2015/12/01 22:53:36
Not entirely sure whether we want to limit this to
Ryan Sleevi
2015/12/01 23:00:50
My (opinionated, potentially wrong) thinking is th
svaldez
2015/12/01 23:05:22
The problem in that case is that since we'll end u
| |
363 if (mime_type == "application/x-x509-user-cert") { | |
364 *extension = FILE_PATH_LITERAL("crt"); | |
365 return true; | |
366 } | |
367 | |
362 return g_mime_util.Get().GetPreferredExtensionForMimeType(mime_type, | 368 return g_mime_util.Get().GetPreferredExtensionForMimeType(mime_type, |
363 extension); | 369 extension); |
364 } | 370 } |
365 | 371 |
366 bool MatchesMimeType(const std::string& mime_type_pattern, | 372 bool MatchesMimeType(const std::string& mime_type_pattern, |
367 const std::string& mime_type) { | 373 const std::string& mime_type) { |
368 return g_mime_util.Get().MatchesMimeType(mime_type_pattern, mime_type); | 374 return g_mime_util.Get().MatchesMimeType(mime_type_pattern, mime_type); |
369 } | 375 } |
370 | 376 |
371 bool ParseMimeTypeWithoutParameter(const std::string& type_string, | 377 bool ParseMimeTypeWithoutParameter(const std::string& type_string, |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
580 post_data->append("\r\n" + value + "\r\n"); | 586 post_data->append("\r\n" + value + "\r\n"); |
581 } | 587 } |
582 | 588 |
583 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, | 589 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, |
584 std::string* post_data) { | 590 std::string* post_data) { |
585 DCHECK(post_data); | 591 DCHECK(post_data); |
586 post_data->append("--" + mime_boundary + "--\r\n"); | 592 post_data->append("--" + mime_boundary + "--\r\n"); |
587 } | 593 } |
588 | 594 |
589 } // namespace net | 595 } // namespace net |
OLD | NEW |