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

Unified Diff: content/browser/manifest/manifest_manager_host.h

Issue 1913043002: Convert ManifestManager IPCs to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/manifest/manifest_manager_host.h
diff --git a/content/browser/manifest/manifest_manager_host.h b/content/browser/manifest/manifest_manager_host.h
index 069a5303b836091a171cf8b486dd455fa106854f..ee1a840101666743ee0113e307bdfc201a2f226b 100644
--- a/content/browser/manifest/manifest_manager_host.h
+++ b/content/browser/manifest/manifest_manager_host.h
@@ -5,10 +5,13 @@
#ifndef CONTENT_BROWSER_MANIFEST_MANIFEST_MANAGER_HOST_H_
#define CONTENT_BROWSER_MANIFEST_MANIFEST_MANAGER_HOST_H_
+#include <map>
+#include <memory>
+
#include "base/callback_forward.h"
-#include "base/id_map.h"
#include "base/macros.h"
#include "content/public/browser/web_contents_observer.h"
+#include "third_party/WebKit/public/platform/modules/manifest/manifest_manager.mojom.h"
namespace content {
@@ -30,37 +33,33 @@ class ManifestManagerHost : public WebContentsObserver {
// Calls the given callback with the manifest associated with the
// given RenderFrameHost. If the frame has no manifest or if getting it failed
// the callback will have an empty manifest.
- void GetManifest(RenderFrameHost*, const GetManifestCallback&);
+ void GetManifest(RenderFrameHost* render_frame_host,
+ const GetManifestCallback& callback);
// Calls the given callback with a bool indicating whether or not the document
// associated with the given RenderFrameHost has a manifest.
- void HasManifest(RenderFrameHost*, const HasManifestCallback&);
+ void HasManifest(RenderFrameHost* render_frame_host,
+ const HasManifestCallback& callback);
// WebContentsObserver
- bool OnMessageReceived(const IPC::Message&, RenderFrameHost*) override;
- void RenderFrameDeleted(RenderFrameHost*) override;
+ void RenderFrameDeleted(RenderFrameHost* render_frame_host) override;
private:
- using GetCallbackMap = IDMap<GetManifestCallback, IDMapOwnPointer>;
- using HasCallbackMap = IDMap<HasManifestCallback, IDMapOwnPointer>;
- using FrameGetCallbackMap = base::hash_map<RenderFrameHost*, GetCallbackMap*>;
- using FrameHasCallbackMap = base::hash_map<RenderFrameHost*, HasCallbackMap*>;
+ class FrameManifestManagerHost;
void OnRequestManifestResponse(
RenderFrameHost*, int request_id, const Manifest&);
void OnHasManifestResponse(
RenderFrameHost*, int request_id, bool);
- // Returns the CallbackMap associated with the given RenderFrameHost, or null.
- GetCallbackMap* GetCallbackMapForFrame(RenderFrameHost*);
- HasCallbackMap* HasCallbackMapForFrame(RenderFrameHost*);
+ FrameManifestManagerHost& GetOrCreateHostForFrame(
+ RenderFrameHost* render_frame_host);
- FrameGetCallbackMap pending_get_callbacks_;
- FrameHasCallbackMap pending_has_callbacks_;
+ std::map<RenderFrameHost*, std::unique_ptr<FrameManifestManagerHost>> hosts_;
DISALLOW_COPY_AND_ASSIGN(ManifestManagerHost);
};
-} // namespace content
+} // namespace content
#endif // CONTENT_BROWSER_MANIFEST_MANIFEST_MANAGER_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698