| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 #include "core/platform/SharedBuffer.h" | 32 #include "core/platform/SharedBuffer.h" |
| 33 | 33 |
| 34 namespace WebCore { | 34 namespace WebCore { |
| 35 | 35 |
| 36 inline ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KUR
L& url, const String& mimeType, const String& textEncoding, const String& frameN
ame, const ResourceResponse& response) | 36 inline ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KUR
L& url, const String& mimeType, const String& textEncoding, const String& frameN
ame, const ResourceResponse& response) |
| 37 : SubstituteResource(url, response, data) | 37 : SubstituteResource(url, response, data) |
| 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 , m_shouldIgnoreWhenUnarchiving(false) | |
| 42 { | 41 { |
| 43 } | 42 } |
| 44 | 43 |
| 45 PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> dat
a, const KURL& url, const String& mimeType, const String& textEncoding, const St
ring& frameName, const ResourceResponse& response) | 44 PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> dat
a, const KURL& url, const String& mimeType, const String& textEncoding, const St
ring& frameName, const ResourceResponse& response) |
| 46 { | 45 { |
| 47 if (!data) | 46 if (!data) |
| 48 return 0; | 47 return 0; |
| 49 if (response.isNull()) { | 48 if (response.isNull()) { |
| 50 unsigned dataSize = data->size(); | 49 unsigned dataSize = data->size(); |
| 51 return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, f
rameName, | 50 return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, f
rameName, |
| 52 ResourceResponse(url, mimeType, dataSize, textEncoding, String()))); | 51 ResourceResponse(url, mimeType, dataSize, textEncoding, String()))); |
| 53 } | 52 } |
| 54 return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frame
Name, response)); | 53 return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frame
Name, response)); |
| 55 } | 54 } |
| 56 | 55 |
| 57 PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> dat
a, const KURL& url, const ResourceResponse& response) | 56 PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> dat
a, const KURL& url, const ResourceResponse& response) |
| 58 { | 57 { |
| 59 return create(data, url, response.mimeType(), response.textEncodingName(), S
tring(), response); | 58 return create(data, url, response.mimeType(), response.textEncodingName(), S
tring(), response); |
| 60 } | 59 } |
| 61 | 60 |
| 62 } | 61 } |
| OLD | NEW |