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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 for (size_t i = 0; i < arraysize(supported_non_image_types); ++i) | 440 for (size_t i = 0; i < arraysize(supported_non_image_types); ++i) |
441 non_image_map_.insert(supported_non_image_types[i]); | 441 non_image_map_.insert(supported_non_image_types[i]); |
442 for (size_t i = 0; i < arraysize(supported_certificate_types); ++i) | 442 for (size_t i = 0; i < arraysize(supported_certificate_types); ++i) |
443 non_image_map_.insert(supported_certificate_types[i].mime_type); | 443 non_image_map_.insert(supported_certificate_types[i].mime_type); |
444 for (size_t i = 0; i < arraysize(unsupported_text_types); ++i) | 444 for (size_t i = 0; i < arraysize(unsupported_text_types); ++i) |
445 unsupported_text_map_.insert(unsupported_text_types[i]); | 445 unsupported_text_map_.insert(unsupported_text_types[i]); |
446 for (size_t i = 0; i < arraysize(supported_javascript_types); ++i) | 446 for (size_t i = 0; i < arraysize(supported_javascript_types); ++i) |
447 non_image_map_.insert(supported_javascript_types[i]); | 447 non_image_map_.insert(supported_javascript_types[i]); |
448 for (size_t i = 0; i < arraysize(common_media_types); ++i) | 448 for (size_t i = 0; i < arraysize(common_media_types); ++i) |
449 non_image_map_.insert(common_media_types[i]); | 449 non_image_map_.insert(common_media_types[i]); |
450 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) | 450 #if defined(USE_PROPRIETARY_CODECS) |
451 for (size_t i = 0; i < arraysize(proprietary_media_types); ++i) | 451 for (size_t i = 0; i < arraysize(proprietary_media_types); ++i) |
452 non_image_map_.insert(proprietary_media_types[i]); | 452 non_image_map_.insert(proprietary_media_types[i]); |
453 #endif | 453 #endif |
454 | 454 |
455 // Initialize the supported media types. | 455 // Initialize the supported media types. |
456 for (size_t i = 0; i < arraysize(common_media_types); ++i) | 456 for (size_t i = 0; i < arraysize(common_media_types); ++i) |
457 media_map_.insert(common_media_types[i]); | 457 media_map_.insert(common_media_types[i]); |
458 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) | 458 #if defined(USE_PROPRIETARY_CODECS) |
459 for (size_t i = 0; i < arraysize(proprietary_media_types); ++i) | 459 for (size_t i = 0; i < arraysize(proprietary_media_types); ++i) |
460 media_map_.insert(proprietary_media_types[i]); | 460 media_map_.insert(proprietary_media_types[i]); |
461 #endif | 461 #endif |
462 | 462 |
463 for (size_t i = 0; i < arraysize(supported_javascript_types); ++i) | 463 for (size_t i = 0; i < arraysize(supported_javascript_types); ++i) |
464 javascript_map_.insert(supported_javascript_types[i]); | 464 javascript_map_.insert(supported_javascript_types[i]); |
465 | 465 |
466 for (size_t i = 0; i < arraysize(common_media_codecs); ++i) | 466 for (size_t i = 0; i < arraysize(common_media_codecs); ++i) |
467 codecs_map_.insert(common_media_codecs[i]); | 467 codecs_map_.insert(common_media_codecs[i]); |
468 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) | 468 #if defined(USE_PROPRIETARY_CODECS) |
469 for (size_t i = 0; i < arraysize(proprietary_media_codecs); ++i) | 469 for (size_t i = 0; i < arraysize(proprietary_media_codecs); ++i) |
470 codecs_map_.insert(proprietary_media_codecs[i]); | 470 codecs_map_.insert(proprietary_media_codecs[i]); |
471 #endif | 471 #endif |
472 | 472 |
473 // Initialize the strict supported media types. | 473 // Initialize the strict supported media types. |
474 for (size_t i = 0; i < arraysize(format_codec_mappings); ++i) { | 474 for (size_t i = 0; i < arraysize(format_codec_mappings); ++i) { |
475 std::vector<std::string> mime_type_codecs; | 475 std::vector<std::string> mime_type_codecs; |
476 ParseCodecString(format_codec_mappings[i].codecs_list, | 476 ParseCodecString(format_codec_mappings[i].codecs_list, |
477 &mime_type_codecs, | 477 &mime_type_codecs, |
478 false); | 478 false); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 post_data->append("\r\n" + value + "\r\n"); | 994 post_data->append("\r\n" + value + "\r\n"); |
995 } | 995 } |
996 | 996 |
997 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, | 997 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, |
998 std::string* post_data) { | 998 std::string* post_data) { |
999 DCHECK(post_data); | 999 DCHECK(post_data); |
1000 post_data->append("--" + mime_boundary + "--\r\n"); | 1000 post_data->append("--" + mime_boundary + "--\r\n"); |
1001 } | 1001 } |
1002 | 1002 |
1003 } // namespace net | 1003 } // namespace net |
OLD | NEW |