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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/CSSPreloadScannerTest.cpp

Issue 2307003002: Move collectGarbage* methods to ThreadState (Closed)
Patch Set: fix Created 4 years, 3 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
OLDNEW
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
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 ThreadHeap::collectAllGarbage(); 76 ThreadState::current()-> 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698