Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ManifestLoader_h | |
| 6 #define ManifestLoader_h | |
| 7 | |
| 8 #include "core/fetch/ResourceClient.h" | |
| 9 #include "core/fetch/ResourceOwner.h" | |
| 10 #include "core/frame/LocalFrame.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 class Document; | |
| 15 | |
| 16 // The ManifestLoader is a class that fetches and parses a WebManifest and | |
| 17 // informs the passed ManifestLoaderClient upon completion (success or failure). | |
| 18 // The lifetime of the object is managed by itself. When ::LoadManifest() is | |
| 19 // called an instance of the object is created and as soon as the processing | |
| 20 // is finished, the object will destroy itself. | |
| 21 // The call should make sure that the ManifestLoaderClient passed to | |
| 22 // ::LoadManifest() is not destroyed before getting a result. | |
| 23 class ManifestLoader FINAL : public ResourceOwner<Resource, ResourceClient> { | |
| 24 public: | |
| 25 static void loadManifest(PassRefPtr<LocalFrame>); | |
| 26 | |
| 27 // This is public so we can use OwnPtr<>(this) in various methods. | |
| 28 virtual ~ManifestLoader(); | |
| 29 | |
| 30 protected: | |
| 31 // ResourceClient | |
| 32 virtual void notifyFinished(Resource*) OVERRIDE; | |
| 33 | |
| 34 explicit ManifestLoader(PassRefPtr<LocalFrame>); | |
| 35 | |
| 36 void startLoading(); | |
| 37 | |
| 38 private: | |
| 39 RefPtr<LocalFrame> m_frame; | |
|
Nate Chapin
2014/08/25 20:43:12
Should ManifestLoader be able to keep the frame al
mlamouri (slow - plz ping)
2014/08/26 17:25:23
I tend to prefer to keep the frame alive but as yo
| |
| 40 }; | |
| 41 | |
| 42 } // namespace blink | |
| 43 | |
| 44 #endif | |
| OLD | NEW |