| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 return m_private->size(); | 57 return m_private->size(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 const char* WebData::data() const | 60 const char* WebData::data() const |
| 61 { | 61 { |
| 62 if (m_private.isNull()) | 62 if (m_private.isNull()) |
| 63 return 0; | 63 return 0; |
| 64 return m_private->data(); | 64 return m_private->data(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 #if INSIDE_BLINK |
| 68 String WebData::toASCIIString() const |
| 69 { |
| 70 String result(data(), size()); |
| 71 ASSERT(result.containsOnlyASCII()); |
| 72 return result; |
| 73 } |
| 74 #endif |
| 75 |
| 67 WebData::WebData(const PassRefPtr<SharedBuffer>& buffer) | 76 WebData::WebData(const PassRefPtr<SharedBuffer>& buffer) |
| 68 : m_private(buffer) | 77 : m_private(buffer) |
| 69 { | 78 { |
| 70 } | 79 } |
| 71 | 80 |
| 72 WebData& WebData::operator=(const PassRefPtr<SharedBuffer>& buffer) | 81 WebData& WebData::operator=(const PassRefPtr<SharedBuffer>& buffer) |
| 73 { | 82 { |
| 74 m_private = buffer; | 83 m_private = buffer; |
| 75 return *this; | 84 return *this; |
| 76 } | 85 } |
| 77 | 86 |
| 78 WebData::operator PassRefPtr<SharedBuffer>() const | 87 WebData::operator PassRefPtr<SharedBuffer>() const |
| 79 { | 88 { |
| 80 return PassRefPtr<SharedBuffer>(m_private.get()); | 89 return PassRefPtr<SharedBuffer>(m_private.get()); |
| 81 } | 90 } |
| 82 | 91 |
| 83 } // namespace blink | 92 } // namespace blink |
| OLD | NEW |