| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_RENDERER_MANIFEST_MANIFEST_MANAGER_H_ | 5 #ifndef CONTENT_RENDERER_MANIFEST_MANIFEST_MANAGER_H_ |
| 6 #define CONTENT_RENDERER_MANIFEST_MANIFEST_MANAGER_H_ | 6 #define CONTENT_RENDERER_MANIFEST_MANIFEST_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> |
| 9 | 10 |
| 10 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "content/public/common/manifest.h" | 13 #include "content/public/common/manifest.h" |
| 14 #include "content/public/renderer/render_frame_observer.h" | 14 #include "content/public/renderer/render_frame_observer.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 class WebURLResponse; | 19 class WebURLResponse; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void OnHasManifest(int request_id); | 57 void OnHasManifest(int request_id); |
| 58 void OnRequestManifest(int request_id); | 58 void OnRequestManifest(int request_id); |
| 59 void OnRequestManifestComplete(int request_id, const Manifest&); | 59 void OnRequestManifestComplete(int request_id, const Manifest&); |
| 60 | 60 |
| 61 void FetchManifest(); | 61 void FetchManifest(); |
| 62 void OnManifestFetchComplete(const GURL& document_url, | 62 void OnManifestFetchComplete(const GURL& document_url, |
| 63 const blink::WebURLResponse& response, | 63 const blink::WebURLResponse& response, |
| 64 const std::string& data); | 64 const std::string& data); |
| 65 void ResolveCallbacks(ResolveState state); | 65 void ResolveCallbacks(ResolveState state); |
| 66 | 66 |
| 67 scoped_ptr<ManifestFetcher> fetcher_; | 67 std::unique_ptr<ManifestFetcher> fetcher_; |
| 68 | 68 |
| 69 // Whether the RenderFrame may have an associated Manifest. If true, the frame | 69 // Whether the RenderFrame may have an associated Manifest. If true, the frame |
| 70 // may have a manifest, if false, it can't have one. This boolean is true when | 70 // may have a manifest, if false, it can't have one. This boolean is true when |
| 71 // DidChangeManifest() is called, if it is never called, it means that the | 71 // DidChangeManifest() is called, if it is never called, it means that the |
| 72 // associated document has no <link rel='manifest'>. | 72 // associated document has no <link rel='manifest'>. |
| 73 bool may_have_manifest_; | 73 bool may_have_manifest_; |
| 74 | 74 |
| 75 // Whether the current Manifest is dirty. | 75 // Whether the current Manifest is dirty. |
| 76 bool manifest_dirty_; | 76 bool manifest_dirty_; |
| 77 | 77 |
| 78 // Current Manifest. Might be outdated if manifest_dirty_ is true. | 78 // Current Manifest. Might be outdated if manifest_dirty_ is true. |
| 79 Manifest manifest_; | 79 Manifest manifest_; |
| 80 | 80 |
| 81 std::list<GetManifestCallback> pending_callbacks_; | 81 std::list<GetManifestCallback> pending_callbacks_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(ManifestManager); | 83 DISALLOW_COPY_AND_ASSIGN(ManifestManager); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace content | 86 } // namespace content |
| 87 | 87 |
| 88 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_MANAGER_H_ | 88 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_MANAGER_H_ |
| OLD | NEW |