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_BROWSER_MANIFEST_MANIFEST_MANAGER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_MANIFEST_MANIFEST_MANAGER_HOST_H_ |
6 #define CONTENT_BROWSER_MANIFEST_MANIFEST_MANAGER_HOST_H_ | 6 #define CONTENT_BROWSER_MANIFEST_MANIFEST_MANAGER_HOST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // Calls the given callback with the manifest associated with the | 32 // Calls the given callback with the manifest associated with the |
33 // given RenderFrameHost. If the frame has no manifest or if getting it failed | 33 // given RenderFrameHost. If the frame has no manifest or if getting it failed |
34 // the callback will have an empty manifest. | 34 // the callback will have an empty manifest. |
35 void GetManifest(RenderFrameHost*, const GetManifestCallback&); | 35 void GetManifest(RenderFrameHost*, const GetManifestCallback&); |
36 | 36 |
37 // WebContentsObserver | 37 // WebContentsObserver |
38 bool OnMessageReceived(const IPC::Message&, RenderFrameHost*) override; | 38 bool OnMessageReceived(const IPC::Message&, RenderFrameHost*) override; |
39 void RenderFrameDeleted(RenderFrameHost*) override; | 39 void RenderFrameDeleted(RenderFrameHost*) override; |
40 | 40 |
41 private: | 41 private: |
42 using GetCallbackMap = IDMap<GetManifestCallback, IDMapOwnPointer>; | 42 using GetCallbackMap = IDMap<std::unique_ptr<GetManifestCallback>>; |
43 | 43 |
44 void OnRequestManifestResponse( | 44 void OnRequestManifestResponse( |
45 RenderFrameHost*, int request_id, const GURL&, const Manifest&); | 45 RenderFrameHost*, int request_id, const GURL&, const Manifest&); |
46 | 46 |
47 // Returns the CallbackMap associated with the given RenderFrameHost, or null. | 47 // Returns the CallbackMap associated with the given RenderFrameHost, or null. |
48 GetCallbackMap* GetCallbackMapForFrame(RenderFrameHost*); | 48 GetCallbackMap* GetCallbackMapForFrame(RenderFrameHost*); |
49 | 49 |
50 base::hash_map<RenderFrameHost*, std::unique_ptr<GetCallbackMap>> | 50 base::hash_map<RenderFrameHost*, std::unique_ptr<GetCallbackMap>> |
51 pending_get_callbacks_; | 51 pending_get_callbacks_; |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(ManifestManagerHost); | 53 DISALLOW_COPY_AND_ASSIGN(ManifestManagerHost); |
54 }; | 54 }; |
55 | 55 |
56 } // namespace content | 56 } // namespace content |
57 | 57 |
58 #endif // CONTENT_BROWSER_MANIFEST_MANIFEST_MANAGER_HOST_H_ | 58 #endif // CONTENT_BROWSER_MANIFEST_MANIFEST_MANAGER_HOST_H_ |
OLD | NEW |