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

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

Issue 2251893002: Add destroyDecodedDataIfPossible to ScriptResource to stop ScriptStreaming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org>
4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class ResourceFetcher; 43 class ResourceFetcher;
44 class ScriptResource; 44 class ScriptResource;
45 45
46 class CORE_EXPORT ScriptResourceClient : public GarbageCollectedMixin, public Re sourceClient { 46 class CORE_EXPORT ScriptResourceClient : public GarbageCollectedMixin, public Re sourceClient {
47 public: 47 public:
48 ~ScriptResourceClient() override {} 48 ~ScriptResourceClient() override {}
49 static bool isExpectedType(ResourceClient* client) { return client->getResou rceClientType() == ScriptType; } 49 static bool isExpectedType(ResourceClient* client) { return client->getResou rceClientType() == ScriptType; }
50 ResourceClientType getResourceClientType() const final { return ScriptType; } 50 ResourceClientType getResourceClientType() const final { return ScriptType; }
51 51
52 virtual void notifyAppendData(ScriptResource* resource) { } 52 virtual void notifyAppendData(ScriptResource* resource) { }
53 virtual void notifyCancel(ScriptResource* resource) { }
53 54
54 DEFINE_INLINE_VIRTUAL_TRACE() {} 55 DEFINE_INLINE_VIRTUAL_TRACE() {}
55 }; 56 };
56 57
57 class CORE_EXPORT ScriptResource final : public TextResource { 58 class CORE_EXPORT ScriptResource final : public TextResource {
58 public: 59 public:
59 using ClientType = ScriptResourceClient; 60 using ClientType = ScriptResourceClient;
60 static ScriptResource* fetch(FetchRequest&, ResourceFetcher*); 61 static ScriptResource* fetch(FetchRequest&, ResourceFetcher*);
61 62
62 // Public for testing 63 // Public for testing
(...skipping 28 matching lines...) Expand all
91 ScriptResourceFactory() 92 ScriptResourceFactory()
92 : ResourceFactory(Resource::Script) { } 93 : ResourceFactory(Resource::Script) { }
93 94
94 Resource* create(const ResourceRequest& request, const ResourceLoaderOpt ions& options, const String& charset) const override 95 Resource* create(const ResourceRequest& request, const ResourceLoaderOpt ions& options, const String& charset) const override
95 { 96 {
96 return new ScriptResource(request, options, charset); 97 return new ScriptResource(request, options, charset);
97 } 98 }
98 }; 99 };
99 100
100 ScriptResource(const ResourceRequest&, const ResourceLoaderOptions&, const S tring& charset); 101 ScriptResource(const ResourceRequest&, const ResourceLoaderOptions&, const S tring& charset);
102 void destroyDecodedDataIfPossible() override;
marja 2016/08/17 08:37:40 I find this name surprising. It's not clear what's
101 103
102 ScriptIntegrityDisposition m_integrityDisposition; 104 ScriptIntegrityDisposition m_integrityDisposition;
103 IntegrityMetadataSet m_integrityMetadata; 105 IntegrityMetadataSet m_integrityMetadata;
104 106
105 AtomicString m_script; 107 AtomicString m_script;
106 }; 108 };
107 109
108 DEFINE_RESOURCE_TYPE_CASTS(Script); 110 DEFINE_RESOURCE_TYPE_CASTS(Script);
109 111
110 } // namespace blink 112 } // namespace blink
111 113
112 #endif 114 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698