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

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

Issue 1423663012: Removing x-x509-user-cert mime handler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using MimeType for handler. Created 5 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
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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« content/browser/loader/mime_type_resource_handler.cc ('K') | « content/content_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698