| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 return m_request; | 138 return m_request; |
| 139 } | 139 } |
| 140 | 140 |
| 141 const KURL& DocumentLoader::url() const | 141 const KURL& DocumentLoader::url() const |
| 142 { | 142 { |
| 143 return m_request.url(); | 143 return m_request.url(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void DocumentLoader::startPreload(Resource::Type type, FetchRequest& request) | 146 void DocumentLoader::startPreload(Resource::Type type, FetchRequest& request) |
| 147 { | 147 { |
| 148 ASSERT(type == Resource::Script || type == Resource::CSSStyleSheet || type =
= Resource::Image); | 148 ASSERT(type == Resource::Script || type == Resource::CSSStyleSheet || type =
= Resource::Image || type == Resource::ImportResource); |
| 149 ResourcePtr<Resource> resource; | 149 ResourcePtr<Resource> resource; |
| 150 if (type == Resource::Image) | 150 switch (type) { |
| 151 case Resource::Image: |
| 151 resource = ImageResource::fetch(request, fetcher()); | 152 resource = ImageResource::fetch(request, fetcher()); |
| 152 else if (type == Resource::Script) | 153 break; |
| 154 case Resource::Script: |
| 153 resource = ScriptResource::fetch(request, fetcher()); | 155 resource = ScriptResource::fetch(request, fetcher()); |
| 154 else | 156 break; |
| 157 case Resource::CSSStyleSheet: |
| 155 resource = CSSStyleSheetResource::fetch(request, fetcher()); | 158 resource = CSSStyleSheetResource::fetch(request, fetcher()); |
| 159 break; |
| 160 default: // Resource::ImportResource |
| 161 resource = RawResource::fetchImport(request, fetcher()); |
| 162 break; |
| 163 } |
| 156 | 164 |
| 157 if (resource) | 165 if (resource) |
| 158 fetcher()->preloadStarted(resource.get()); | 166 fetcher()->preloadStarted(resource.get()); |
| 159 } | 167 } |
| 160 | 168 |
| 161 void DocumentLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDoc
umentNavigationSource sameDocumentNavigationSource) | 169 void DocumentLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDoc
umentNavigationSource sameDocumentNavigationSource) |
| 162 { | 170 { |
| 163 KURL oldURL = m_request.url(); | 171 KURL oldURL = m_request.url(); |
| 164 m_originalRequest.setURL(newURL); | 172 m_originalRequest.setURL(newURL); |
| 165 m_request.setURL(newURL); | 173 m_request.setURL(newURL); |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR
L() | 799 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR
L() |
| 792 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn
it& init, const String& source, Document* ownerDocument) | 800 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn
it& init, const String& source, Document* ownerDocument) |
| 793 { | 801 { |
| 794 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); | 802 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); |
| 795 if (!source.isNull()) | 803 if (!source.isNull()) |
| 796 m_writer->appendReplacingData(source); | 804 m_writer->appendReplacingData(source); |
| 797 endWriting(m_writer.get()); | 805 endWriting(m_writer.get()); |
| 798 } | 806 } |
| 799 | 807 |
| 800 } // namespace blink | 808 } // namespace blink |
| OLD | NEW |