Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. | 3 // found in the LICENSE file. |
| 4 * (http://www.torchmobile.com/) | |
| 5 * Copyright (C) 2009 Google Inc. All rights reserved. | |
| 6 * | |
| 7 * Redistribution and use in source and binary forms, with or without | |
| 8 * modification, are permitted provided that the following conditions | |
| 9 * are met: | |
| 10 * 1. Redistributions of source code must retain the above copyright | |
| 11 * notice, this list of conditions and the following disclaimer. | |
| 12 * 2. Redistributions in binary form must reproduce the above copyright | |
| 13 * notice, this list of conditions and the following disclaimer in the | |
| 14 * documentation and/or other materials provided with the distribution. | |
| 15 * | |
| 16 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | |
| 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
| 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | |
| 20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
| 21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
| 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | |
| 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | |
| 24 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 27 */ | |
|
Mike West
2016/12/06 13:44:35
Nit: If you're just moving the file, don't change
kinuko
2016/12/07 15:33:36
Done.
| |
| 28 | 4 |
| 29 #include "platform/ContentType.h" | 5 #include "platform/network/mime/ContentType.h" |
| 30 | 6 |
| 31 namespace blink { | 7 namespace blink { |
| 32 | 8 |
| 33 ContentType::ContentType(const String& contentType) : m_type(contentType) {} | 9 ContentType::ContentType(const String& contentType) : m_type(contentType) {} |
| 34 | 10 |
| 35 String ContentType::parameter(const String& parameterName) const { | 11 String ContentType::parameter(const String& parameterName) const { |
| 36 String parameterValue; | 12 String parameterValue; |
| 37 String strippedType = m_type.stripWhiteSpace(); | 13 String strippedType = m_type.stripWhiteSpace(); |
| 38 | 14 |
| 39 // a MIME type can have one or more "param=value" after a semi-colon, and | 15 // a MIME type can have one or more "param=value" after a semi-colon, and |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 68 | 44 |
| 69 // "type" can have parameters after a semi-colon, strip them | 45 // "type" can have parameters after a semi-colon, strip them |
| 70 size_t semi = strippedType.find(';'); | 46 size_t semi = strippedType.find(';'); |
| 71 if (semi != kNotFound) | 47 if (semi != kNotFound) |
| 72 strippedType = strippedType.left(semi).stripWhiteSpace(); | 48 strippedType = strippedType.left(semi).stripWhiteSpace(); |
| 73 | 49 |
| 74 return strippedType; | 50 return strippedType; |
| 75 } | 51 } |
| 76 | 52 |
| 77 } // namespace blink | 53 } // namespace blink |
| OLD | NEW |