| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 , m_mimeType(mimeType) | 38 , m_mimeType(mimeType) |
| 39 , m_textEncoding(textEncoding) | 39 , m_textEncoding(textEncoding) |
| 40 , m_frameName(frameName) | 40 , m_frameName(frameName) |
| 41 { | 41 { |
| 42 ASSERT(m_data); | 42 ASSERT(m_data); |
| 43 } | 43 } |
| 44 | 44 |
| 45 PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> dat
a, const KURL& url, const AtomicString& mimeType, const AtomicString& textEncodi
ng, const String& frameName, const ResourceResponse& response) | 45 PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> dat
a, const KURL& url, const AtomicString& mimeType, const AtomicString& textEncodi
ng, const String& frameName, const ResourceResponse& response) |
| 46 { | 46 { |
| 47 if (!data) | 47 if (!data) |
| 48 return 0; | 48 return nullptr; |
| 49 if (response.isNull()) { | 49 if (response.isNull()) { |
| 50 unsigned dataSize = data->size(); | 50 unsigned dataSize = data->size(); |
| 51 return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, f
rameName, | 51 return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, f
rameName, |
| 52 ResourceResponse(url, mimeType, dataSize, textEncoding, String()))); | 52 ResourceResponse(url, mimeType, dataSize, textEncoding, String()))); |
| 53 } | 53 } |
| 54 return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frame
Name, response)); | 54 return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frame
Name, response)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> dat
a, const KURL& url, const ResourceResponse& response) | 57 PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> dat
a, const KURL& url, const ResourceResponse& response) |
| 58 { | 58 { |
| 59 return create(data, url, response.mimeType(), response.textEncodingName(), S
tring(), response); | 59 return create(data, url, response.mimeType(), response.textEncodingName(), S
tring(), response); |
| 60 } | 60 } |
| 61 | 61 |
| 62 } | 62 } |
| OLD | NEW |