| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 3 * Copyright (C) 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Lesser General Public | 6 * modify it under the terms of the GNU Lesser General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 unsigned DOMMimeTypeArray::length() const | 41 unsigned DOMMimeTypeArray::length() const |
| 42 { | 42 { |
| 43 PluginData* data = getPluginData(); | 43 PluginData* data = getPluginData(); |
| 44 if (!data) | 44 if (!data) |
| 45 return 0; | 45 return 0; |
| 46 return data->mimes().size(); | 46 return data->mimes().size(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 PassRefPtrWillBeRawPtr<DOMMimeType> DOMMimeTypeArray::item(unsigned index) | 49 DOMMimeType* DOMMimeTypeArray::item(unsigned index) |
| 50 { | 50 { |
| 51 PluginData* data = getPluginData(); | 51 PluginData* data = getPluginData(); |
| 52 if (!data) | 52 if (!data) |
| 53 return nullptr; | 53 return nullptr; |
| 54 const Vector<MimeClassInfo>& mimes = data->mimes(); | 54 const Vector<MimeClassInfo>& mimes = data->mimes(); |
| 55 if (index >= mimes.size()) | 55 if (index >= mimes.size()) |
| 56 return nullptr; | 56 return nullptr; |
| 57 return DOMMimeType::create(data, m_frame, index); | 57 return DOMMimeType::create(data, m_frame, index); |
| 58 } | 58 } |
| 59 | 59 |
| 60 PassRefPtrWillBeRawPtr<DOMMimeType> DOMMimeTypeArray::namedItem(const AtomicStri
ng& propertyName) | 60 DOMMimeType* DOMMimeTypeArray::namedItem(const AtomicString& propertyName) |
| 61 { | 61 { |
| 62 PluginData* data = getPluginData(); | 62 PluginData* data = getPluginData(); |
| 63 if (!data) | 63 if (!data) |
| 64 return nullptr; | 64 return nullptr; |
| 65 const Vector<MimeClassInfo>& mimes = data->mimes(); | 65 const Vector<MimeClassInfo>& mimes = data->mimes(); |
| 66 for (unsigned i = 0; i < mimes.size(); ++i) { | 66 for (unsigned i = 0; i < mimes.size(); ++i) { |
| 67 if (mimes[i].type == propertyName) | 67 if (mimes[i].type == propertyName) |
| 68 return DOMMimeType::create(data, m_frame, i); | 68 return DOMMimeType::create(data, m_frame, i); |
| 69 } | 69 } |
| 70 return nullptr; | 70 return nullptr; |
| 71 } | 71 } |
| 72 | 72 |
| 73 PluginData* DOMMimeTypeArray::getPluginData() const | 73 PluginData* DOMMimeTypeArray::getPluginData() const |
| 74 { | 74 { |
| 75 if (!m_frame) | 75 if (!m_frame) |
| 76 return nullptr; | 76 return nullptr; |
| 77 Page* p = m_frame->page(); | 77 Page* p = m_frame->page(); |
| 78 if (!p) | 78 if (!p) |
| 79 return nullptr; | 79 return nullptr; |
| 80 return p->pluginData(); | 80 return p->pluginData(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| OLD | NEW |