Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(970)

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 829803003: Adding Chrome-side WebVR interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to use Mojo as requested by eng review Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 #if defined(OS_MACOSX) 74 #if defined(OS_MACOSX)
75 #include "content/browser/frame_host/popup_menu_helper_mac.h" 75 #include "content/browser/frame_host/popup_menu_helper_mac.h"
76 #endif 76 #endif
77 77
78 #if defined(ENABLE_MEDIA_MOJO_RENDERER) 78 #if defined(ENABLE_MEDIA_MOJO_RENDERER)
79 #include "media/mojo/interfaces/media_renderer.mojom.h" 79 #include "media/mojo/interfaces/media_renderer.mojom.h"
80 #include "media/mojo/services/mojo_renderer_service.h" 80 #include "media/mojo/services/mojo_renderer_service.h"
81 #endif 81 #endif
82 82
83 #if defined(ENABLE_WEBVR)
84 #include "content/browser/vr/vr_service_impl.h"
85 #endif
86
83 using base::TimeDelta; 87 using base::TimeDelta;
84 88
85 namespace content { 89 namespace content {
86 90
87 namespace { 91 namespace {
88 92
89 // The next value to use for the accessibility reset token. 93 // The next value to use for the accessibility reset token.
90 int g_next_accessibility_reset_token = 1; 94 int g_next_accessibility_reset_token = 1;
91 95
92 // The next value to use for the javascript callback id. 96 // The next value to use for the javascript callback id.
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 1554
1551 GetServiceRegistry()->AddService<presentation::PresentationService>( 1555 GetServiceRegistry()->AddService<presentation::PresentationService>(
1552 base::Bind(&PresentationServiceImpl::CreateMojoService, 1556 base::Bind(&PresentationServiceImpl::CreateMojoService,
1553 base::Unretained(this))); 1557 base::Unretained(this)));
1554 1558
1555 #if defined(ENABLE_MEDIA_MOJO_RENDERER) 1559 #if defined(ENABLE_MEDIA_MOJO_RENDERER)
1556 GetServiceRegistry()->AddService<mojo::MediaRenderer>( 1560 GetServiceRegistry()->AddService<mojo::MediaRenderer>(
1557 base::Bind(&CreateMediaRendererService)); 1561 base::Bind(&CreateMediaRendererService));
1558 #endif 1562 #endif
1559 1563
1564 #if defined(ENABLE_WEBVR)
1565 const base::CommandLine& browser_command_line =
1566 *base::CommandLine::ForCurrentProcess();
1567
1568 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) {
1569 GetServiceRegistry()->AddService<VRService>(
1570 base::Bind(&VRServiceImpl::Create));
1571 }
1572 #endif
1573
1560 GetContentClient()->browser()->OverrideRenderFrameMojoServices( 1574 GetContentClient()->browser()->OverrideRenderFrameMojoServices(
1561 GetServiceRegistry(), this); 1575 GetServiceRegistry(), this);
1562 } 1576 }
1563 1577
1564 void RenderFrameHostImpl::SetState(RenderFrameHostImplState rfh_state) { 1578 void RenderFrameHostImpl::SetState(RenderFrameHostImplState rfh_state) {
1565 // Only main frames should be swapped out and retained inside a proxy host. 1579 // Only main frames should be swapped out and retained inside a proxy host.
1566 if (rfh_state == STATE_SWAPPED_OUT) 1580 if (rfh_state == STATE_SWAPPED_OUT)
1567 CHECK(!GetParent()); 1581 CHECK(!GetParent());
1568 1582
1569 // We update the number of RenderFrameHosts in a SiteInstance when the swapped 1583 // We update the number of RenderFrameHosts in a SiteInstance when the swapped
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 // We may be returning to an existing NavigationEntry that had been granted 2083 // We may be returning to an existing NavigationEntry that had been granted
2070 // file access. If this is a different process, we will need to grant the 2084 // file access. If this is a different process, we will need to grant the
2071 // access again. The files listed in the page state are validated when they 2085 // access again. The files listed in the page state are validated when they
2072 // are received from the renderer to prevent abuse. 2086 // are received from the renderer to prevent abuse.
2073 if (request_params.page_state.IsValid()) { 2087 if (request_params.page_state.IsValid()) {
2074 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); 2088 render_view_host_->GrantFileAccessFromPageState(request_params.page_state);
2075 } 2089 }
2076 } 2090 }
2077 2091
2078 } // namespace content 2092 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698