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

Side by Side Diff: third_party/WebKit/Source/core/fetch/LinkFetchResource.h

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + address review comments Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 5
6 #ifndef LinkFetchResource_h 6 #ifndef LinkFetchResource_h
7 #define LinkFetchResource_h 7 #define LinkFetchResource_h
8 8
9 #include "core/fetch/Resource.h" 9 #include "core/fetch/Resource.h"
10 #include "core/fetch/ResourceClient.h" 10 #include "core/fetch/ResourceClient.h"
11 #include "core/fetch/ResourcePtr.h"
12 11
13 namespace blink { 12 namespace blink {
14 13
15 class FetchRequest; 14 class FetchRequest;
16 class ResourceFetcher; 15 class ResourceFetcher;
17 16
18 class LinkFetchResource final : public Resource { 17 class LinkFetchResource final : public Resource {
19 public: 18 public:
20 using ClientType = ResourceClient; 19 using ClientType = ResourceClient;
21 20
22 static ResourcePtr<Resource> fetch(Resource::Type, FetchRequest&, ResourceFe tcher*); 21 static PassRefPtrWillBeRawPtr<Resource> fetch(Resource::Type, FetchRequest&, ResourceFetcher*);
23 ~LinkFetchResource() override; 22 ~LinkFetchResource() override;
24 23
25 private: 24 private:
26 class LinkResourceFactory : public ResourceFactory { 25 class LinkResourceFactory : public ResourceFactory {
27 public: 26 public:
28 LinkResourceFactory(Resource::Type type) 27 LinkResourceFactory(Resource::Type type)
29 : ResourceFactory(type) { } 28 : ResourceFactory(type) { }
30 29
31 Resource* create(const ResourceRequest& request, const String& charset) const override 30 PassRefPtrWillBeRawPtr<Resource> create(const ResourceRequest& request, const String& charset) const override
32 { 31 {
33 return new LinkFetchResource(request, type()); 32 return adoptRefWillBeNoop(new LinkFetchResource(request, type()));
34 } 33 }
35 }; 34 };
36 LinkFetchResource(const ResourceRequest&, Type); 35 LinkFetchResource(const ResourceRequest&, Type);
37 }; 36 };
38 37
39 } // namespace blink 38 } // namespace blink
40 39
41 #endif // LinkFetchResource_h 40 #endif // LinkFetchResource_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp ('k') | third_party/WebKit/Source/core/fetch/LinkFetchResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698