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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 371 |
372 RenderViewHost* RenderFrameHostImpl::GetRenderViewHost() { | 372 RenderViewHost* RenderFrameHostImpl::GetRenderViewHost() { |
373 return render_view_host_; | 373 return render_view_host_; |
374 } | 374 } |
375 | 375 |
376 ServiceRegistry* RenderFrameHostImpl::GetServiceRegistry() { | 376 ServiceRegistry* RenderFrameHostImpl::GetServiceRegistry() { |
377 return service_registry_.get(); | 377 return service_registry_.get(); |
378 } | 378 } |
379 | 379 |
380 blink::WebPageVisibilityState RenderFrameHostImpl::GetVisibilityState() { | 380 blink::WebPageVisibilityState RenderFrameHostImpl::GetVisibilityState() { |
| 381 // Works around the crashes seen in https://crbug.com/501863, where the |
| 382 // active WebContents from a browser iterator may contain a render frame |
| 383 // detached from the frame tree. |
| 384 RenderWidgetHostView* view = RenderFrameHostImpl::GetView(); |
| 385 if (!view || !view->GetRenderWidgetHost()) |
| 386 return blink::WebPageVisibilityStateHidden; |
| 387 |
381 // TODO(mlamouri,kenrb): call GetRenderWidgetHost() directly when it stops | 388 // TODO(mlamouri,kenrb): call GetRenderWidgetHost() directly when it stops |
382 // returning nullptr in some cases. See https://crbug.com/455245. | 389 // returning nullptr in some cases. See https://crbug.com/455245. |
383 blink::WebPageVisibilityState visibility_state = | 390 blink::WebPageVisibilityState visibility_state = |
384 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost())->is_hidden() | 391 RenderWidgetHostImpl::From(view->GetRenderWidgetHost())->is_hidden() |
385 ? blink::WebPageVisibilityStateHidden | 392 ? blink::WebPageVisibilityStateHidden |
386 : blink::WebPageVisibilityStateVisible; | 393 : blink::WebPageVisibilityStateVisible; |
387 GetContentClient()->browser()->OverridePageVisibilityState(this, | 394 GetContentClient()->browser()->OverridePageVisibilityState(this, |
388 &visibility_state); | 395 &visibility_state); |
389 return visibility_state; | 396 return visibility_state; |
390 } | 397 } |
391 | 398 |
392 bool RenderFrameHostImpl::Send(IPC::Message* message) { | 399 bool RenderFrameHostImpl::Send(IPC::Message* message) { |
393 if (IPC_MESSAGE_ID_CLASS(message->type()) == InputMsgStart) { | 400 if (IPC_MESSAGE_ID_CLASS(message->type()) == InputMsgStart) { |
394 return render_view_host_->input_router()->SendInput( | 401 return render_view_host_->input_router()->SendInput( |
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2242 BrowserPluginInstanceIDToAXTreeID(value))); | 2249 BrowserPluginInstanceIDToAXTreeID(value))); |
2243 break; | 2250 break; |
2244 case AX_CONTENT_INT_ATTRIBUTE_LAST: | 2251 case AX_CONTENT_INT_ATTRIBUTE_LAST: |
2245 NOTREACHED(); | 2252 NOTREACHED(); |
2246 break; | 2253 break; |
2247 } | 2254 } |
2248 } | 2255 } |
2249 } | 2256 } |
2250 | 2257 |
2251 } // namespace content | 2258 } // namespace content |
OLD | NEW |