OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. | 2 * Copyright (c) 2013, Opera Software ASA. 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 Vector<SerializedResource>& getResources() | 130 Vector<SerializedResource>& getResources() |
131 { | 131 { |
132 return m_resources; | 132 return m_resources; |
133 } | 133 } |
134 | 134 |
135 const SerializedResource* getResource(const char* url, const char* mimeType) | 135 const SerializedResource* getResource(const char* url, const char* mimeType) |
136 { | 136 { |
137 KURL kURL = KURL(m_baseUrl, url); | 137 const KURL kURL = KURL(m_baseUrl, url); |
138 String mime(mimeType); | 138 String mime(mimeType); |
139 for (size_t i = 0; i < m_resources.size(); ++i) { | 139 for (size_t i = 0; i < m_resources.size(); ++i) { |
140 const SerializedResource& resource = m_resources[i]; | 140 const SerializedResource& resource = m_resources[i]; |
141 if (resource.url == kURL && !resource.data->isEmpty() | 141 if (resource.url == kURL && !resource.data->isEmpty() |
142 && (mime.isNull() || equalIgnoringCase(resource.mimeType, mime))
) | 142 && (mime.isNull() || equalIgnoringCase(resource.mimeType, mime))
) |
143 return &resource; | 143 return &resource; |
144 } | 144 } |
145 return nullptr; | 145 return nullptr; |
146 } | 146 } |
147 | 147 |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 EXPECT_EQ("saved from url=(0015)http://foo.com/", FrameSerializer::markOfThe
WebDeclaration(KURL(ParsedURLString, "http://foo.com"))); | 524 EXPECT_EQ("saved from url=(0015)http://foo.com/", FrameSerializer::markOfThe
WebDeclaration(KURL(ParsedURLString, "http://foo.com"))); |
525 EXPECT_EQ("saved from url=(0015)http://f-o.com/", FrameSerializer::markOfThe
WebDeclaration(KURL(ParsedURLString, "http://f-o.com"))); | 525 EXPECT_EQ("saved from url=(0015)http://f-o.com/", FrameSerializer::markOfThe
WebDeclaration(KURL(ParsedURLString, "http://f-o.com"))); |
526 EXPECT_EQ("saved from url=(0019)http://foo.com-%2D/", FrameSerializer::markO
fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com--"))); | 526 EXPECT_EQ("saved from url=(0019)http://foo.com-%2D/", FrameSerializer::markO
fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com--"))); |
527 EXPECT_EQ("saved from url=(0024)http://f-%2D.com-%2D%3E/", FrameSerializer::
markOfTheWebDeclaration(KURL(ParsedURLString, "http://f--.com-->"))); | 527 EXPECT_EQ("saved from url=(0024)http://f-%2D.com-%2D%3E/", FrameSerializer::
markOfTheWebDeclaration(KURL(ParsedURLString, "http://f--.com-->"))); |
528 EXPECT_EQ("saved from url=(0020)http://foo.com/?-%2D", FrameSerializer::mark
OfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com?--"))); | 528 EXPECT_EQ("saved from url=(0020)http://foo.com/?-%2D", FrameSerializer::mark
OfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com?--"))); |
529 EXPECT_EQ("saved from url=(0020)http://foo.com/#-%2D", FrameSerializer::mark
OfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#--"))); | 529 EXPECT_EQ("saved from url=(0020)http://foo.com/#-%2D", FrameSerializer::mark
OfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#--"))); |
530 EXPECT_EQ("saved from url=(0026)http://foo.com/#bar-%2Dbaz", FrameSerializer
::markOfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#bar--baz"))); | 530 EXPECT_EQ("saved from url=(0026)http://foo.com/#bar-%2Dbaz", FrameSerializer
::markOfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#bar--baz"))); |
531 } | 531 } |
532 | 532 |
533 } // namespace blink | 533 } // namespace blink |
OLD | NEW |