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

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

Issue 6851016: multiple files: Move from DCHECK to DCHECK_EQ (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removed trailing whitespace in net/base/mime_util.cc Created 9 years, 8 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 | « ipc/ipc_channel_posix.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "net/base/mime_util.h" 8 #include "net/base/mime_util.h"
9 #include "net/base/platform_mime_util.h" 9 #include "net/base/platform_mime_util.h"
10 10
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 // Mirrors WebViewImpl::CanShowMIMEType() 378 // Mirrors WebViewImpl::CanShowMIMEType()
379 bool MimeUtil::IsSupportedMimeType(const std::string& mime_type) const { 379 bool MimeUtil::IsSupportedMimeType(const std::string& mime_type) const {
380 return (mime_type.compare(0, 6, "image/") == 0 && 380 return (mime_type.compare(0, 6, "image/") == 0 &&
381 IsSupportedImageMimeType(mime_type.c_str())) || 381 IsSupportedImageMimeType(mime_type.c_str())) ||
382 IsSupportedNonImageMimeType(mime_type.c_str()); 382 IsSupportedNonImageMimeType(mime_type.c_str());
383 } 383 }
384 384
385 bool MimeUtil::MatchesMimeType(const std::string &mime_type_pattern, 385 bool MimeUtil::MatchesMimeType(const std::string &mime_type_pattern,
386 const std::string &mime_type) const { 386 const std::string &mime_type) const {
387 // verify caller is passing lowercase 387 // verify caller is passing lowercase
388 DCHECK(mime_type_pattern == StringToLowerASCII(mime_type_pattern)); 388 DCHECK_EQ(StringToLowerASCII(mime_type_pattern), mime_type_pattern);
389 DCHECK(mime_type == StringToLowerASCII(mime_type)); 389 DCHECK_EQ(StringToLowerASCII(mime_type), mime_type);
390 390
391 // This comparison handles absolute maching and also basic 391 // This comparison handles absolute maching and also basic
392 // wildcards. The plugin mime types could be: 392 // wildcards. The plugin mime types could be:
393 // application/x-foo 393 // application/x-foo
394 // application/* 394 // application/*
395 // application/*+xml 395 // application/*+xml
396 // * 396 // *
397 if (mime_type_pattern.empty()) 397 if (mime_type_pattern.empty())
398 return false; 398 return false;
399 399
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 707
708 GetExtensionsFromHardCodedMappings(secondary_mappings, 708 GetExtensionsFromHardCodedMappings(secondary_mappings,
709 arraysize(secondary_mappings), 709 arraysize(secondary_mappings),
710 mime_type, 710 mime_type,
711 &unique_extensions); 711 &unique_extensions);
712 712
713 HashSetToVector(&unique_extensions, extensions); 713 HashSetToVector(&unique_extensions, extensions);
714 } 714 }
715 715
716 } // namespace net 716 } // namespace net
OLDNEW
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698