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 #include "content/browser/manifest/manifest_manager_host.h" | 5 #include "content/browser/manifest/manifest_manager_host.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "content/common/manifest_manager_messages.h" | 10 #include "content/common/manifest_manager_messages.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 false); | 26 false); |
27 } | 27 } |
28 | 28 |
29 } // anonymous namespace | 29 } // anonymous namespace |
30 | 30 |
31 ManifestManagerHost::ManifestManagerHost(WebContents* web_contents) | 31 ManifestManagerHost::ManifestManagerHost(WebContents* web_contents) |
32 : WebContentsObserver(web_contents) { | 32 : WebContentsObserver(web_contents) { |
33 } | 33 } |
34 | 34 |
35 ManifestManagerHost::~ManifestManagerHost() { | 35 ManifestManagerHost::~ManifestManagerHost() { |
36 STLDeleteValues(&pending_get_callbacks_); | 36 base::STLDeleteValues(&pending_get_callbacks_); |
37 } | 37 } |
38 | 38 |
39 ManifestManagerHost::GetCallbackMap* | 39 ManifestManagerHost::GetCallbackMap* |
40 ManifestManagerHost::GetCallbackMapForFrame( | 40 ManifestManagerHost::GetCallbackMapForFrame( |
41 RenderFrameHost* render_frame_host) { | 41 RenderFrameHost* render_frame_host) { |
42 FrameGetCallbackMap::iterator it = | 42 FrameGetCallbackMap::iterator it = |
43 pending_get_callbacks_.find(render_frame_host); | 43 pending_get_callbacks_.find(render_frame_host); |
44 return it != pending_get_callbacks_.end() ? it->second : nullptr; | 44 return it != pending_get_callbacks_.end() ? it->second : nullptr; |
45 } | 45 } |
46 | 46 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 callback->Run(manifest_url, manifest); | 154 callback->Run(manifest_url, manifest); |
155 callbacks->Remove(request_id); | 155 callbacks->Remove(request_id); |
156 if (callbacks->IsEmpty()) { | 156 if (callbacks->IsEmpty()) { |
157 delete callbacks; | 157 delete callbacks; |
158 pending_get_callbacks_.erase(render_frame_host); | 158 pending_get_callbacks_.erase(render_frame_host); |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 } // namespace content | 162 } // namespace content |
OLD | NEW |