OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 child->didShareLoader(); | 113 child->didShareLoader(); |
114 return child; | 114 return child; |
115 } | 115 } |
116 | 116 |
117 bool sameOriginRequest = master()->securityOrigin()->canRequest(request.url(
)); | 117 bool sameOriginRequest = master()->securityOrigin()->canRequest(request.url(
)); |
118 request.setCrossOriginAccessControl( | 118 request.setCrossOriginAccessControl( |
119 master()->securityOrigin(), sameOriginRequest ? AllowStoredCredentials :
DoNotAllowStoredCredentials, | 119 master()->securityOrigin(), sameOriginRequest ? AllowStoredCredentials :
DoNotAllowStoredCredentials, |
120 ClientDidNotRequestCredentials); | 120 ClientDidNotRequestCredentials); |
121 ResourcePtr<RawResource> resource = parent->document()->fetcher()->fetchImpo
rt(request); | 121 ResourcePtr<RawResource> resource = parent->document()->fetcher()->fetchImpo
rt(request); |
122 if (!resource) | 122 if (!resource) |
123 return 0; | 123 return nullptr; |
124 | 124 |
125 HTMLImportLoader* loader = createLoader(); | 125 HTMLImportLoader* loader = createLoader(); |
126 HTMLImportChild* child = createChild(request.url(), loader, parent, client); | 126 HTMLImportChild* child = createChild(request.url(), loader, parent, client); |
127 // We set resource after the import tree is built since | 127 // We set resource after the import tree is built since |
128 // Resource::addClient() immediately calls back to feed the bytes when the r
esource is cached. | 128 // Resource::addClient() immediately calls back to feed the bytes when the r
esource is cached. |
129 loader->startLoading(resource); | 129 loader->startLoading(resource); |
130 child->didStartLoading(); | 130 child->didStartLoading(); |
131 return child; | 131 return child; |
132 } | 132 } |
133 | 133 |
(...skipping 16 matching lines...) Expand all Loading... |
150 return m_loaders.last().get(); | 150 return m_loaders.last().get(); |
151 } | 151 } |
152 | 152 |
153 HTMLImportLoader* HTMLImportsController::loaderFor(const Document& document) con
st | 153 HTMLImportLoader* HTMLImportsController::loaderFor(const Document& document) con
st |
154 { | 154 { |
155 for (size_t i = 0; i < m_loaders.size(); ++i) { | 155 for (size_t i = 0; i < m_loaders.size(); ++i) { |
156 if (m_loaders[i]->document() == &document) | 156 if (m_loaders[i]->document() == &document) |
157 return m_loaders[i].get(); | 157 return m_loaders[i].get(); |
158 } | 158 } |
159 | 159 |
160 return 0; | 160 return nullptr; |
161 } | 161 } |
162 | 162 |
163 Document* HTMLImportsController::loaderDocumentAt(size_t i) const | 163 Document* HTMLImportsController::loaderDocumentAt(size_t i) const |
164 { | 164 { |
165 return loaderAt(i)->document(); | 165 return loaderAt(i)->document(); |
166 } | 166 } |
167 | 167 |
168 void HTMLImportsController::trace(Visitor* visitor) | 168 void HTMLImportsController::trace(Visitor* visitor) |
169 { | 169 { |
170 visitor->trace(m_root); | 170 visitor->trace(m_root); |
171 visitor->trace(m_loaders); | 171 visitor->trace(m_loaders); |
172 DocumentSupplement::trace(visitor); | 172 DocumentSupplement::trace(visitor); |
173 } | 173 } |
174 | 174 |
175 } // namespace blink | 175 } // namespace blink |
OLD | NEW |