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

Unified Diff: content/renderer/manifest/manifest_manager.h

Issue 1913043002: Convert ManifestManager IPCs to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/manifest/manifest_manager.h
diff --git a/content/renderer/manifest/manifest_manager.h b/content/renderer/manifest/manifest_manager.h
index 88304bbe39c72c368bfb1063be656524ecb292a4..9c50aa79aaf86ce28f2241495b6e687b9b9f463e 100644
--- a/content/renderer/manifest/manifest_manager.h
+++ b/content/renderer/manifest/manifest_manager.h
@@ -5,13 +5,17 @@
#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 "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;
@@ -29,7 +33,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&)> GetManifestCallback;
@@ -41,22 +46,25 @@ 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,
ResolveStateFailure
};
- // 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, const Manifest&);
+ // 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&);
void FetchManifest();
void OnManifestFetchComplete(const GURL& document_url,
@@ -78,11 +86,13 @@ class ManifestManager : public RenderFrameObserver {
// Current Manifest. Might be outdated if manifest_dirty_ is true.
Manifest manifest_;
- 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_

Powered by Google App Engine
This is Rietveld 408576698