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

Side by Side Diff: Source/core/loader/appcache/ApplicationCacheHost.h

Issue 1194003004: Oilpan: enable appcache + move DocumentLoader to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add outer loader protection Created 5 years, 6 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) 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2009, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 25 matching lines...) Expand all
36 #include "public/platform/WebApplicationCacheHostClient.h" 36 #include "public/platform/WebApplicationCacheHostClient.h"
37 #include "wtf/OwnPtr.h" 37 #include "wtf/OwnPtr.h"
38 #include "wtf/Vector.h" 38 #include "wtf/Vector.h"
39 39
40 namespace blink { 40 namespace blink {
41 class ApplicationCache; 41 class ApplicationCache;
42 class DocumentLoader; 42 class DocumentLoader;
43 class ResourceRequest; 43 class ResourceRequest;
44 class ResourceResponse; 44 class ResourceResponse;
45 45
46 class ApplicationCacheHost final : public NoBaseWillBeGarbageCollectedFinali zed<ApplicationCacheHost>, public WebApplicationCacheHostClient { 46 class ApplicationCacheHost final : public GarbageCollectedFinalized<Applicat ionCacheHost>, public WebApplicationCacheHostClient {
47 WTF_MAKE_NONCOPYABLE(ApplicationCacheHost); 47 WTF_MAKE_NONCOPYABLE(ApplicationCacheHost);
48 public: 48 public:
49 static PassOwnPtrWillBeRawPtr<ApplicationCacheHost> create(DocumentLoade r* loader) 49 static ApplicationCacheHost* create(DocumentLoader* loader)
50 { 50 {
51 return adoptPtrWillBeNoop(new ApplicationCacheHost(loader)); 51 return new ApplicationCacheHost(loader);
52 } 52 }
53 virtual ~ApplicationCacheHost(); 53 virtual ~ApplicationCacheHost();
54 54
55 void dispose(); 55 void dispose();
56 56
57 // The Status numeric values are specified in the HTML5 spec. 57 // The Status numeric values are specified in the HTML5 spec.
58 enum Status { 58 enum Status {
59 UNCACHED = 0, 59 UNCACHED = 0,
60 IDLE = 1, 60 IDLE = 1,
61 CHECKING = 2, 61 CHECKING = 2,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void abort(); 124 void abort();
125 125
126 void setApplicationCache(ApplicationCache*); 126 void setApplicationCache(ApplicationCache*);
127 void notifyApplicationCache(EventID, int progressTotal, int progressDone , WebApplicationCacheHost::ErrorReason, const String& errorURL, int errorStatus, const String& errorMessage); 127 void notifyApplicationCache(EventID, int progressTotal, int progressDone , WebApplicationCacheHost::ErrorReason, const String& errorURL, int errorStatus, const String& errorMessage);
128 128
129 void stopDeferringEvents(); // Also raises the events that have been que ued up. 129 void stopDeferringEvents(); // Also raises the events that have been que ued up.
130 130
131 void fillResourceList(ResourceInfoList*); 131 void fillResourceList(ResourceInfoList*);
132 CacheInfo applicationCacheInfo(); 132 CacheInfo applicationCacheInfo();
133 133
134 EAGERLY_FINALIZE();
haraken 2015/06/22 01:57:59 Add a comment why this needs to be eagerly finaliz
sof 2015/06/22 06:49:18 No longer needed; asserted for that in the destruc
134 DECLARE_TRACE(); 135 DECLARE_TRACE();
135 136
136 private: 137 private:
137 explicit ApplicationCacheHost(DocumentLoader*); 138 explicit ApplicationCacheHost(DocumentLoader*);
138 139
139 // WebApplicationCacheHostClient implementation 140 // WebApplicationCacheHostClient implementation
140 virtual void didChangeCacheAssociation() override final; 141 virtual void didChangeCacheAssociation() override final;
141 virtual void notifyEventListener(WebApplicationCacheHost::EventID) overr ide final; 142 virtual void notifyEventListener(WebApplicationCacheHost::EventID) overr ide final;
142 virtual void notifyProgressEventListener(const WebURL&, int progressTota l, int progressDone) override final; 143 virtual void notifyProgressEventListener(const WebURL&, int progressTota l, int progressDone) override final;
143 virtual void notifyErrorEventListener(WebApplicationCacheHost::ErrorReas on, const WebURL&, int status, const WebString& message) override final; 144 virtual void notifyErrorEventListener(WebApplicationCacheHost::ErrorReas on, const WebURL&, int status, const WebString& message) override final;
(...skipping 14 matching lines...) Expand all
158 , progressTotal(progressTotal) 159 , progressTotal(progressTotal)
159 , progressDone(progressDone) 160 , progressDone(progressDone)
160 , errorReason(errorReason) 161 , errorReason(errorReason)
161 , errorURL(errorURL) 162 , errorURL(errorURL)
162 , errorStatus(errorStatus) 163 , errorStatus(errorStatus)
163 , errorMessage(errorMessage) 164 , errorMessage(errorMessage)
164 { 165 {
165 } 166 }
166 }; 167 };
167 168
168 RawPtrWillBeWeakMember<ApplicationCache> m_domApplicationCache; 169 WeakMember<ApplicationCache> m_domApplicationCache;
169 DocumentLoader* m_documentLoader; 170 RawPtrWillBeMember<DocumentLoader> m_documentLoader;
170 bool m_defersEvents; // Events are deferred until after document onload. 171 bool m_defersEvents; // Events are deferred until after document onload.
171 Vector<DeferredEvent> m_deferredEvents; 172 Vector<DeferredEvent> m_deferredEvents;
172 173
173 void dispatchDOMEvent(EventID, int progressTotal, int progressDone, WebA pplicationCacheHost::ErrorReason, const String& errorURL, int errorStatus, const String& errorMessage); 174 void dispatchDOMEvent(EventID, int progressTotal, int progressDone, WebA pplicationCacheHost::ErrorReason, const String& errorURL, int errorStatus, const String& errorMessage);
174 175
175 OwnPtr<WebApplicationCacheHost> m_host; 176 OwnPtr<WebApplicationCacheHost> m_host;
176 }; 177 };
177 178
178 } // namespace blink 179 } // namespace blink
179 180
180 #endif // ApplicationCacheHost_h 181 #endif // ApplicationCacheHost_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698