| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // FIXME: add support for comments. | 46 // FIXME: add support for comments. |
| 47 class PLATFORM_EXPORT ParsedContentType final { | 47 class PLATFORM_EXPORT ParsedContentType final { |
| 48 STACK_ALLOCATED(); | 48 STACK_ALLOCATED(); |
| 49 | 49 |
| 50 public: | 50 public: |
| 51 explicit ParsedContentType(const String&); | 51 explicit ParsedContentType(const String&); |
| 52 | 52 |
| 53 String mimeType() const { return m_mimeType; } | 53 String mimeType() const { return m_mimeType; } |
| 54 String charset() const; | 54 String charset() const; |
| 55 | 55 |
| 56 // Note that in the case of multiple values for the same name, the last value
is returned. | 56 // Note that in the case of multiple values for the same name, the last value |
| 57 // is returned. |
| 57 String parameterValueForName(const String&) const; | 58 String parameterValueForName(const String&) const; |
| 58 size_t parameterCount() const; | 59 size_t parameterCount() const; |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 template <class ReceiverType> | 62 template <class ReceiverType> |
| 62 friend bool parseContentType(const String&, ReceiverType&); | 63 friend bool parseContentType(const String&, ReceiverType&); |
| 63 void setContentType(const SubstringRange&); | 64 void setContentType(const SubstringRange&); |
| 64 void setContentTypeParameter(const SubstringRange&, const SubstringRange&); | 65 void setContentTypeParameter(const SubstringRange&, const SubstringRange&); |
| 65 | 66 |
| 66 typedef HashMap<String, String> KeyValuePairs; | 67 typedef HashMap<String, String> KeyValuePairs; |
| 67 String m_contentType; | 68 String m_contentType; |
| 68 KeyValuePairs m_parameters; | 69 KeyValuePairs m_parameters; |
| 69 String m_mimeType; | 70 String m_mimeType; |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 } // namespace blink | 73 } // namespace blink |
| 73 | 74 |
| 74 #endif | 75 #endif |
| OLD | NEW |