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 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 | 1569 |
1570 #if defined(ENABLE_WEBVR) | 1570 #if defined(ENABLE_WEBVR) |
1571 const base::CommandLine& browser_command_line = | 1571 const base::CommandLine& browser_command_line = |
1572 *base::CommandLine::ForCurrentProcess(); | 1572 *base::CommandLine::ForCurrentProcess(); |
1573 | 1573 |
1574 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { | 1574 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { |
1575 GetServiceRegistry()->AddService<VRService>( | 1575 GetServiceRegistry()->AddService<VRService>( |
1576 base::Bind(&VRDeviceManager::BindRequest)); | 1576 base::Bind(&VRDeviceManager::BindRequest)); |
1577 } | 1577 } |
1578 #endif | 1578 #endif |
1579 | |
1580 GetContentClient()->browser()->OverrideRenderFrameMojoServices( | |
1581 GetServiceRegistry(), this); | |
1582 } | 1579 } |
1583 | 1580 |
1584 void RenderFrameHostImpl::SetState(RenderFrameHostImplState rfh_state) { | 1581 void RenderFrameHostImpl::SetState(RenderFrameHostImplState rfh_state) { |
1585 // Only main frames should be swapped out and retained inside a proxy host. | 1582 // Only main frames should be swapped out and retained inside a proxy host. |
1586 if (rfh_state == STATE_SWAPPED_OUT) | 1583 if (rfh_state == STATE_SWAPPED_OUT) |
1587 CHECK(!GetParent()); | 1584 CHECK(!GetParent()); |
1588 | 1585 |
1589 // We update the number of RenderFrameHosts in a SiteInstance when the swapped | 1586 // We update the number of RenderFrameHosts in a SiteInstance when the swapped |
1590 // out status of a RenderFrameHost gets flipped to/from active. | 1587 // out status of a RenderFrameHost gets flipped to/from active. |
1591 if (!IsRFHStateActive(rfh_state_) && IsRFHStateActive(rfh_state)) | 1588 if (!IsRFHStateActive(rfh_state_) && IsRFHStateActive(rfh_state)) |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2122 // We may be returning to an existing NavigationEntry that had been granted | 2119 // We may be returning to an existing NavigationEntry that had been granted |
2123 // file access. If this is a different process, we will need to grant the | 2120 // file access. If this is a different process, we will need to grant the |
2124 // access again. The files listed in the page state are validated when they | 2121 // access again. The files listed in the page state are validated when they |
2125 // are received from the renderer to prevent abuse. | 2122 // are received from the renderer to prevent abuse. |
2126 if (request_params.page_state.IsValid()) { | 2123 if (request_params.page_state.IsValid()) { |
2127 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); | 2124 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); |
2128 } | 2125 } |
2129 } | 2126 } |
2130 | 2127 |
2131 } // namespace content | 2128 } // namespace content |
OLD | NEW |