| Index: content/renderer/manifest/manifest_manager.h
|
| diff --git a/content/renderer/manifest/manifest_manager.h b/content/renderer/manifest/manifest_manager.h
|
| index 554617cdcbea098623ed78a86be8d3704bd8df4b..445262b0598ea1f7b7bcb2d68a963a2bd00fe99a 100644
|
| --- a/content/renderer/manifest/manifest_manager.h
|
| +++ b/content/renderer/manifest/manifest_manager.h
|
| @@ -5,14 +5,18 @@
|
| #ifndef CONTENT_RENDERER_MANIFEST_MANIFEST_MANAGER_H_
|
| #define CONTENT_RENDERER_MANIFEST_MANIFEST_MANAGER_H_
|
|
|
| -#include <list>
|
| #include <memory>
|
| +#include <string>
|
| +#include <vector>
|
|
|
| #include "base/callback_forward.h"
|
| #include "base/macros.h"
|
| #include "content/public/common/manifest.h"
|
| #include "content/public/renderer/render_frame_observer.h"
|
| #include "content/renderer/manifest/manifest_debug_info.h"
|
| +#include "mojo/public/cpp/bindings/binding_set.h"
|
| +#include "third_party/WebKit/public/platform/modules/manifest/manifest.mojom.h"
|
| +#include "third_party/WebKit/public/platform/modules/manifest/manifest_manager.mojom.h"
|
|
|
| class GURL;
|
|
|
| @@ -30,7 +34,8 @@ class ManifestFetcher;
|
| // There are two expected consumers of this helper: ManifestManagerHost, via IPC
|
| // messages and callers inside the renderer process. The latter should use
|
| // GetManifest().
|
| -class ManifestManager : public RenderFrameObserver {
|
| +class ManifestManager : public RenderFrameObserver,
|
| + public blink::mojom::ManifestManager {
|
| public:
|
| typedef base::Callback<void(const Manifest&,
|
| const ManifestDebugInfo&)> GetManifestCallback;
|
| @@ -43,11 +48,12 @@ class ManifestManager : public RenderFrameObserver {
|
| void GetManifest(const GetManifestCallback& callback);
|
|
|
| // RenderFrameObserver implementation.
|
| - bool OnMessageReceived(const IPC::Message& message) override;
|
| void DidChangeManifest() override;
|
| void DidCommitProvisionalLoad(bool is_new_navigation,
|
| bool is_same_page_navigation) override;
|
|
|
| + void BindToRequest(blink::mojom::ManifestManagerRequest request);
|
| +
|
| private:
|
| enum ResolveState {
|
| ResolveStateSuccess,
|
| @@ -57,11 +63,12 @@ class ManifestManager : public RenderFrameObserver {
|
| // RenderFrameObserver implementation.
|
| void OnDestruct() override;
|
|
|
| - // Called when receiving a ManifestManagerMsg_RequestManifest from the browser
|
| - // process.
|
| - void OnHasManifest(int request_id);
|
| - void OnRequestManifest(int request_id);
|
| - void OnRequestManifestComplete(int request_id,
|
| + // blink::mojom::ManifestManager implementation.
|
| + void HasManifest(const HasManifestCallback& callback) override;
|
| + void RequestManifest(const RequestManifestCallback& callback) override;
|
| +
|
| + // Called when receiving a RequestManifest() call from the browser process.
|
| + void OnRequestManifestComplete(const RequestManifestCallback& callback,
|
| const Manifest&,
|
| const ManifestDebugInfo&);
|
|
|
| @@ -88,11 +95,13 @@ class ManifestManager : public RenderFrameObserver {
|
| // Current Manifest debug information.
|
| ManifestDebugInfo manifest_debug_info_;
|
|
|
| - std::list<GetManifestCallback> pending_callbacks_;
|
| + std::vector<GetManifestCallback> pending_callbacks_;
|
| +
|
| + mojo::BindingSet<blink::mojom::ManifestManager> bindings_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ManifestManager);
|
| };
|
|
|
| -} // namespace content
|
| +} // namespace content
|
|
|
| #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_MANAGER_H_
|
|
|