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

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

Issue 196043002: HTML Imports: Send credentials for same origin requests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Landing again with another fix Created 6 years, 9 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
« no previous file with comments | « Source/core/html/HTMLLinkElement.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 HTMLImportChild* HTMLImportsController::load(HTMLImport* parent, HTMLImportChild Client* client, FetchRequest request) 80 HTMLImportChild* HTMLImportsController::load(HTMLImport* parent, HTMLImportChild Client* client, FetchRequest request)
81 { 81 {
82 ASSERT(!request.url().isEmpty() && request.url().isValid()); 82 ASSERT(!request.url().isEmpty() && request.url().isValid());
83 83
84 if (findLinkFor(request.url())) { 84 if (findLinkFor(request.url())) {
85 HTMLImportChild* child = createChild(request.url(), parent, client); 85 HTMLImportChild* child = createChild(request.url(), parent, client);
86 child->wasAlreadyLoaded(); 86 child->wasAlreadyLoaded();
87 return child; 87 return child;
88 } 88 }
89 89
90 request.setCrossOriginAccessControl(securityOrigin(), DoNotAllowStoredCreden tials); 90 bool sameOriginRequest = securityOrigin()->canRequest(request.url());
91 request.setCrossOriginAccessControl(
92 securityOrigin(), sameOriginRequest ? AllowStoredCredentials : DoNotAllo wStoredCredentials,
93 ClientDidNotRequestCredentials);
91 ResourcePtr<RawResource> resource = parent->document()->fetcher()->fetchImpo rt(request); 94 ResourcePtr<RawResource> resource = parent->document()->fetcher()->fetchImpo rt(request);
92 if (!resource) 95 if (!resource)
93 return 0; 96 return 0;
94 97
95 HTMLImportChild* child = createChild(request.url(), parent, client); 98 HTMLImportChild* child = createChild(request.url(), parent, client);
96 // We set resource after the import tree is built since 99 // We set resource after the import tree is built since
97 // Resource::addClient() immediately calls back to feed the bytes when the r esource is cached. 100 // Resource::addClient() immediately calls back to feed the bytes when the r esource is cached.
98 child->startLoading(resource); 101 child->startLoading(resource);
99 102
100 return child; 103 return child;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 173
171 void HTMLImportsController::recalcTimerFired(Timer<HTMLImportsController>*) 174 void HTMLImportsController::recalcTimerFired(Timer<HTMLImportsController>*)
172 { 175 {
173 do { 176 do {
174 m_recalcTimer.stop(); 177 m_recalcTimer.stop();
175 HTMLImport::recalcTreeState(this); 178 HTMLImport::recalcTreeState(this);
176 } while (m_recalcTimer.isActive()); 179 } while (m_recalcTimer.isActive());
177 } 180 }
178 181
179 } // namespace WebCore 182 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLLinkElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698