OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/html/parser/CSSPreloadScanner.h" | 5 #include "core/html/parser/CSSPreloadScanner.h" |
6 | 6 |
7 #include "core/fetch/FetchContext.h" | 7 #include "core/fetch/FetchContext.h" |
8 #include "core/fetch/Resource.h" | 8 #include "core/fetch/Resource.h" |
9 #include "core/fetch/ResourceFetcher.h" | 9 #include "core/fetch/ResourceFetcher.h" |
10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 Persistent<HTMLResourcePreloader> preloader = HTMLResourcePreloader::create(
dummyPageHolder->document()); | 67 Persistent<HTMLResourcePreloader> preloader = HTMLResourcePreloader::create(
dummyPageHolder->document()); |
68 | 68 |
69 KURL url(ParsedURLString, "http://127.0.0.1/foo.css"); | 69 KURL url(ParsedURLString, "http://127.0.0.1/foo.css"); |
70 Persistent<CSSStyleSheetResource> resource = CSSStyleSheetResource::createFo
rTest(ResourceRequest(url), "utf-8"); | 70 Persistent<CSSStyleSheetResource> resource = CSSStyleSheetResource::createFo
rTest(ResourceRequest(url), "utf-8"); |
71 resource->setStatus(Resource::Pending); | 71 resource->setStatus(Resource::Pending); |
72 | 72 |
73 new PreloadSuppressingCSSPreloaderResourceClient(resource, preloader); | 73 new PreloadSuppressingCSSPreloaderResourceClient(resource, preloader); |
74 | 74 |
75 // Destroys the resourceClient. | 75 // Destroys the resourceClient. |
76 ThreadState::current()-> collectAllGarbage(); | 76 ThreadHeap::collectAllGarbage(); |
77 | 77 |
78 const char* data = "@import url('http://127.0.0.1/preload.css');"; | 78 const char* data = "@import url('http://127.0.0.1/preload.css');"; |
79 // Should not crash. | 79 // Should not crash. |
80 resource->appendData(data, strlen(data)); | 80 resource->appendData(data, strlen(data)); |
81 } | 81 } |
82 | 82 |
83 } // namespace blink | 83 } // namespace blink |
OLD | NEW |