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

Side by Side Diff: sky/engine/core/html/imports/HTMLImportsController.cpp

Issue 678683004: HTMLImportLoader should talk directly to mojo::NetworkService (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address reviewer comments Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/html/imports/HTMLImportLoader.cpp ('k') | sky/engine/platform/BUILD.gn » ('j') | 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 ASSERT(parent == root() || toHTMLImportChild(parent)->loader()->isFirstImpor t(toHTMLImportChild(parent))); 107 ASSERT(parent == root() || toHTMLImportChild(parent)->loader()->isFirstImpor t(toHTMLImportChild(parent)));
108 108
109 if (HTMLImportChild* childToShareWith = root()->find(request.url())) { 109 if (HTMLImportChild* childToShareWith = root()->find(request.url())) {
110 HTMLImportLoader* loader = childToShareWith->loader(); 110 HTMLImportLoader* loader = childToShareWith->loader();
111 ASSERT(loader); 111 ASSERT(loader);
112 HTMLImportChild* child = createChild(request.url(), loader, parent, clie nt); 112 HTMLImportChild* child = createChild(request.url(), loader, parent, clie nt);
113 child->didShareLoader(); 113 child->didShareLoader();
114 return child; 114 return child;
115 } 115 }
116 116
117 ResourcePtr<RawResource> resource = parent->document()->fetcher()->fetchImpo rt(request);
118 if (!resource)
119 return 0;
120
121 HTMLImportLoader* loader = createLoader(); 117 HTMLImportLoader* loader = createLoader();
122 HTMLImportChild* child = createChild(request.url(), loader, parent, client); 118 HTMLImportChild* child = createChild(request.url(), loader, parent, client);
123 // We set resource after the import tree is built since 119 // We set resource after the import tree is built since
124 // Resource::addClient() immediately calls back to feed the bytes when the r esource is cached. 120 // Resource::addClient() immediately calls back to feed the bytes when the r esource is cached.
125 loader->startLoading(resource); 121 loader->startLoading(request.url());
126 child->didStartLoading(); 122 child->didStartLoading();
127 return child; 123 return child;
128 } 124 }
129 125
130 Document* HTMLImportsController::master() const 126 Document* HTMLImportsController::master() const
131 { 127 {
132 return root()->document(); 128 return root()->document();
133 } 129 }
134 130
135 bool HTMLImportsController::shouldBlockScriptExecution(const Document& document) const 131 bool HTMLImportsController::shouldBlockScriptExecution(const Document& document) const
(...skipping 26 matching lines...) Expand all
162 } 158 }
163 159
164 void HTMLImportsController::trace(Visitor* visitor) 160 void HTMLImportsController::trace(Visitor* visitor)
165 { 161 {
166 visitor->trace(m_root); 162 visitor->trace(m_root);
167 visitor->trace(m_loaders); 163 visitor->trace(m_loaders);
168 DocumentSupplement::trace(visitor); 164 DocumentSupplement::trace(visitor);
169 } 165 }
170 166
171 } // namespace blink 167 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/html/imports/HTMLImportLoader.cpp ('k') | sky/engine/platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698