Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 GetSiteInstance()->decrement_active_frame_count(); | 195 GetSiteInstance()->decrement_active_frame_count(); |
| 196 | 196 |
| 197 // Notify the FrameTree that this RFH is going away, allowing it to shut down | 197 // Notify the FrameTree that this RFH is going away, allowing it to shut down |
| 198 // the corresponding RenderViewHost if it is no longer needed. | 198 // the corresponding RenderViewHost if it is no longer needed. |
| 199 frame_tree_->UnregisterRenderFrameHost(this); | 199 frame_tree_->UnregisterRenderFrameHost(this); |
| 200 | 200 |
| 201 // NULL out the swapout timer; in crash dumps this member will be null only if | 201 // NULL out the swapout timer; in crash dumps this member will be null only if |
| 202 // the dtor has run. | 202 // the dtor has run. |
| 203 swapout_event_monitor_timeout_.reset(); | 203 swapout_event_monitor_timeout_.reset(); |
| 204 | 204 |
| 205 for (const auto& iter: visual_state_callbacks_) { | |
| 206 iter.second.Run(false); | |
| 207 } | |
|
boliu
2015/02/19 18:43:41
There's a bit inconsistent between renderer and br
Ignacio Solla
2015/02/20 11:10:41
Thanks, good catch.
So how about do not deliver
boliu
2015/02/20 16:50:55
+piman to decide
I like hard guarantees over sile
Ignacio Solla
2015/02/24 12:49:35
Done.
| |
| 208 | |
| 209 if (render_widget_host_) | 205 if (render_widget_host_) |
| 210 render_widget_host_->Cleanup(); | 206 render_widget_host_->Cleanup(); |
| 211 } | 207 } |
| 212 | 208 |
| 213 int RenderFrameHostImpl::GetRoutingID() { | 209 int RenderFrameHostImpl::GetRoutingID() { |
| 214 return routing_id_; | 210 return routing_id_; |
| 215 } | 211 } |
| 216 | 212 |
| 217 SiteInstanceImpl* RenderFrameHostImpl::GetSiteInstance() { | 213 SiteInstanceImpl* RenderFrameHostImpl::GetSiteInstance() { |
| 218 return site_instance_.get(); | 214 return site_instance_.get(); |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1120 it->second.Run(result_value); | 1116 it->second.Run(result_value); |
| 1121 javascript_callbacks_.erase(it); | 1117 javascript_callbacks_.erase(it); |
| 1122 } else { | 1118 } else { |
| 1123 NOTREACHED() << "Received script response for unknown request"; | 1119 NOTREACHED() << "Received script response for unknown request"; |
| 1124 } | 1120 } |
| 1125 } | 1121 } |
| 1126 | 1122 |
| 1127 void RenderFrameHostImpl::OnVisualStateResponse(uint64 id) { | 1123 void RenderFrameHostImpl::OnVisualStateResponse(uint64 id) { |
| 1128 auto it = visual_state_callbacks_.find(id); | 1124 auto it = visual_state_callbacks_.find(id); |
| 1129 if (it != visual_state_callbacks_.end()) { | 1125 if (it != visual_state_callbacks_.end()) { |
| 1130 it->second.Run(true); | 1126 it->second.Run(); |
| 1131 visual_state_callbacks_.erase(it); | 1127 visual_state_callbacks_.erase(it); |
| 1132 } else { | 1128 } else { |
| 1133 NOTREACHED() << "Received script response for unknown request"; | 1129 NOTREACHED() << "Received script response for unknown request"; |
| 1134 } | 1130 } |
| 1135 } | 1131 } |
| 1136 | 1132 |
| 1137 void RenderFrameHostImpl::OnRunJavaScriptMessage( | 1133 void RenderFrameHostImpl::OnRunJavaScriptMessage( |
| 1138 const base::string16& message, | 1134 const base::string16& message, |
| 1139 const base::string16& default_prompt, | 1135 const base::string16& default_prompt, |
| 1140 const GURL& frame_url, | 1136 const GURL& frame_url, |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1886 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1882 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
| 1887 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1883 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
| 1888 GetContentClient()->browser()->RegisterPermissionUsage( | 1884 GetContentClient()->browser()->RegisterPermissionUsage( |
| 1889 PERMISSION_GEOLOCATION, | 1885 PERMISSION_GEOLOCATION, |
| 1890 delegate_->GetAsWebContents(), | 1886 delegate_->GetAsWebContents(), |
| 1891 GetLastCommittedURL().GetOrigin(), | 1887 GetLastCommittedURL().GetOrigin(), |
| 1892 top_frame->GetLastCommittedURL().GetOrigin()); | 1888 top_frame->GetLastCommittedURL().GetOrigin()); |
| 1893 } | 1889 } |
| 1894 | 1890 |
| 1895 } // namespace content | 1891 } // namespace content |
| OLD | NEW |