Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: Source/core/html/imports/HTMLImportsController.cpp

Issue 274213003: HTML Imports: Make sure new imports being added to the "first child" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Ready to review Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 OwnPtr<HTMLImportChild> loader = adoptPtr(new HTMLImportChild(*m_master, url , mode)); 95 OwnPtr<HTMLImportChild> loader = adoptPtr(new HTMLImportChild(*m_master, url , mode));
96 loader->setClient(client); 96 loader->setClient(client);
97 parent->appendImport(loader.get()); 97 parent->appendImport(loader.get());
98 m_imports.append(loader.release()); 98 m_imports.append(loader.release());
99 return m_imports.last().get(); 99 return m_imports.last().get();
100 } 100 }
101 101
102 HTMLImportChild* HTMLImportsController::load(HTMLImport* parent, HTMLImportChild Client* client, FetchRequest request) 102 HTMLImportChild* HTMLImportsController::load(HTMLImport* parent, HTMLImportChild Client* client, FetchRequest request)
103 { 103 {
104 ASSERT(!request.url().isEmpty() && request.url().isValid()); 104 ASSERT(!request.url().isEmpty() && request.url().isValid());
105 ASSERT(parent == this || toHTMLImportChild(parent)->loader()->isFirstImport( toHTMLImportChild(parent)));
105 106
106 if (findLinkFor(request.url())) { 107 if (findLinkFor(request.url())) {
107 HTMLImportChild* child = createChild(request.url(), parent, client); 108 HTMLImportChild* child = createChild(request.url(), parent, client);
108 child->wasAlreadyLoaded(); 109 child->wasAlreadyLoaded();
109 return child; 110 return child;
110 } 111 }
111 112
112 bool sameOriginRequest = securityOrigin()->canRequest(request.url()); 113 bool sameOriginRequest = securityOrigin()->canRequest(request.url());
113 request.setCrossOriginAccessControl( 114 request.setCrossOriginAccessControl(
114 securityOrigin(), sameOriginRequest ? AllowStoredCredentials : DoNotAllo wStoredCredentials, 115 securityOrigin(), sameOriginRequest ? AllowStoredCredentials : DoNotAllo wStoredCredentials,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 { 224 {
224 for (size_t i = 0; i < m_loaders.size(); ++i) { 225 for (size_t i = 0; i < m_loaders.size(); ++i) {
225 if (m_loaders[i]->document() == &document) 226 if (m_loaders[i]->document() == &document)
226 return m_loaders[i].get(); 227 return m_loaders[i].get();
227 } 228 }
228 229
229 return 0; 230 return 0;
230 } 231 }
231 232
232 } // namespace WebCore 233 } // namespace WebCore
OLDNEW
« Source/core/html/imports/HTMLImportChild.cpp ('K') | « Source/core/html/imports/HTMLImportLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698