OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. 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 | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
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 10 matching lines...) Expand all Loading... |
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "ResourceResponse.h" | 28 #include "ResourceResponse.h" |
29 | 29 |
30 #include "HTTPParsers.h" | 30 #include "HTTPParsers.h" |
31 #include "PlatformMemoryInstrumentation.h" | |
32 #include "ResourceResponse.h" | 31 #include "ResourceResponse.h" |
33 #include <wtf/CurrentTime.h> | 32 #include <wtf/CurrentTime.h> |
34 #include <wtf/MathExtras.h> | 33 #include <wtf/MathExtras.h> |
35 #include <wtf/MemoryInstrumentationHashMap.h> | |
36 #include <wtf/StdLibExtras.h> | 34 #include <wtf/StdLibExtras.h> |
37 | 35 |
38 namespace WebCore { | 36 namespace WebCore { |
39 | 37 |
40 static void parseCacheHeader(const String& header, Vector<pair<String, String> >
& result); | 38 static void parseCacheHeader(const String& header, Vector<pair<String, String> >
& result); |
41 | 39 |
42 ResourceResponse::ResourceResponse() | 40 ResourceResponse::ResourceResponse() |
43 : m_expectedContentLength(0) | 41 : m_expectedContentLength(0) |
44 , m_httpStatusCode(0) | 42 , m_httpStatusCode(0) |
45 , m_lastModifiedDate(0) | 43 , m_lastModifiedDate(0) |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 PassRefPtr<ResourceLoadInfo> ResourceResponse::resourceLoadInfo() const | 532 PassRefPtr<ResourceLoadInfo> ResourceResponse::resourceLoadInfo() const |
535 { | 533 { |
536 return m_resourceLoadInfo.get(); | 534 return m_resourceLoadInfo.get(); |
537 } | 535 } |
538 | 536 |
539 void ResourceResponse::setResourceLoadInfo(PassRefPtr<ResourceLoadInfo> loadInfo
) | 537 void ResourceResponse::setResourceLoadInfo(PassRefPtr<ResourceLoadInfo> loadInfo
) |
540 { | 538 { |
541 m_resourceLoadInfo = loadInfo; | 539 m_resourceLoadInfo = loadInfo; |
542 } | 540 } |
543 | 541 |
544 void ResourceResponse::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) con
st | |
545 { | |
546 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Loader); | |
547 info.addMember(m_url, "url"); | |
548 info.addMember(m_mimeType, "mimeType"); | |
549 info.addMember(m_textEncodingName, "textEncodingName"); | |
550 info.addMember(m_suggestedFilename, "suggestedFilename"); | |
551 info.addMember(m_httpStatusText, "httpStatusText"); | |
552 info.addMember(m_httpHeaderFields, "httpHeaderFields"); | |
553 info.addMember(m_resourceLoadTiming, "resourceLoadTiming"); | |
554 info.addMember(m_resourceLoadInfo, "resourceLoadInfo"); | |
555 } | |
556 | |
557 bool ResourceResponse::compare(const ResourceResponse& a, const ResourceResponse
& b) | 542 bool ResourceResponse::compare(const ResourceResponse& a, const ResourceResponse
& b) |
558 { | 543 { |
559 if (a.isNull() != b.isNull()) | 544 if (a.isNull() != b.isNull()) |
560 return false; | 545 return false; |
561 if (a.url() != b.url()) | 546 if (a.url() != b.url()) |
562 return false; | 547 return false; |
563 if (a.mimeType() != b.mimeType()) | 548 if (a.mimeType() != b.mimeType()) |
564 return false; | 549 return false; |
565 if (a.expectedContentLength() != b.expectedContentLength()) | 550 if (a.expectedContentLength() != b.expectedContentLength()) |
566 return false; | 551 return false; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 pos += nextCommaPosition - pos + 1; | 655 pos += nextCommaPosition - pos + 1; |
671 } else { | 656 } else { |
672 // Add last directive to map with empty string as value | 657 // Add last directive to map with empty string as value |
673 result.append(pair<String, String>(trimToNextSeparator(safeHeader.su
bstring(pos, max - pos).stripWhiteSpace()), "")); | 658 result.append(pair<String, String>(trimToNextSeparator(safeHeader.su
bstring(pos, max - pos).stripWhiteSpace()), "")); |
674 return; | 659 return; |
675 } | 660 } |
676 } | 661 } |
677 } | 662 } |
678 | 663 |
679 } | 664 } |
OLD | NEW |