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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1228113004: Put the RenderFrame's ID into a per-frame WebBluetooth, and plumb that back to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@store-request-device-state-in-dispatcher
Patch Set: Initial Created 5 years, 5 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/debug/alias.h" 12 #include "base/debug/alias.h"
13 #include "base/debug/asan_invalid_access.h" 13 #include "base/debug/asan_invalid_access.h"
14 #include "base/debug/dump_without_crashing.h" 14 #include "base/debug/dump_without_crashing.h"
15 #include "base/i18n/char_iterator.h" 15 #include "base/i18n/char_iterator.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/process/process.h" 17 #include "base/process/process.h"
18 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
19 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
20 #include "base/thread_task_runner_handle.h" 20 #include "base/thread_task_runner_handle.h"
21 #include "base/time/time.h" 21 #include "base/time/time.h"
22 #include "cc/base/switches.h" 22 #include "cc/base/switches.h"
23 #include "content/child/appcache/appcache_dispatcher.h" 23 #include "content/child/appcache/appcache_dispatcher.h"
24 #include "content/child/bluetooth/web_bluetooth_impl.h"
24 #include "content/child/permissions/permission_dispatcher.h" 25 #include "content/child/permissions/permission_dispatcher.h"
25 #include "content/child/plugin_messages.h" 26 #include "content/child/plugin_messages.h"
26 #include "content/child/quota_dispatcher.h" 27 #include "content/child/quota_dispatcher.h"
27 #include "content/child/request_extra_data.h" 28 #include "content/child/request_extra_data.h"
28 #include "content/child/service_worker/service_worker_handle_reference.h" 29 #include "content/child/service_worker/service_worker_handle_reference.h"
29 #include "content/child/service_worker/service_worker_network_provider.h" 30 #include "content/child/service_worker/service_worker_network_provider.h"
30 #include "content/child/service_worker/service_worker_provider_context.h" 31 #include "content/child/service_worker/service_worker_provider_context.h"
31 #include "content/child/service_worker/web_service_worker_provider_impl.h" 32 #include "content/child/service_worker/web_service_worker_provider_impl.h"
32 #include "content/child/v8_value_converter_impl.h" 33 #include "content/child/v8_value_converter_impl.h"
33 #include "content/child/web_url_loader_impl.h" 34 #include "content/child/web_url_loader_impl.h"
(...skipping 3781 matching lines...) Expand 10 before | Expand all | Expand 10 after
3815 3816
3816 void RenderFrameImpl::unregisterProtocolHandler(const WebString& scheme, 3817 void RenderFrameImpl::unregisterProtocolHandler(const WebString& scheme,
3817 const WebURL& url) { 3818 const WebURL& url) {
3818 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); 3819 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture();
3819 Send(new FrameHostMsg_UnregisterProtocolHandler(routing_id_, 3820 Send(new FrameHostMsg_UnregisterProtocolHandler(routing_id_,
3820 base::UTF16ToUTF8(scheme), 3821 base::UTF16ToUTF8(scheme),
3821 url, 3822 url,
3822 user_gesture)); 3823 user_gesture));
3823 } 3824 }
3824 3825
3826 blink::WebBluetooth* RenderFrameImpl::bluetooth() {
3827 if (!bluetooth_) {
3828 bluetooth_.reset(new WebBluetoothImpl(
3829 ChildThreadImpl::current()->thread_safe_sender(), routing_id_));
3830 }
3831
3832 return bluetooth_.get();
3833 }
3834
3825 #if defined(ENABLE_WEBVR) 3835 #if defined(ENABLE_WEBVR)
3826 blink::WebVRClient* RenderFrameImpl::webVRClient() { 3836 blink::WebVRClient* RenderFrameImpl::webVRClient() {
3827 if (!vr_dispatcher_) 3837 if (!vr_dispatcher_)
3828 vr_dispatcher_.reset(new VRDispatcher(GetServiceRegistry())); 3838 vr_dispatcher_.reset(new VRDispatcher(GetServiceRegistry()));
3829 3839
3830 return vr_dispatcher_.get(); 3840 return vr_dispatcher_.get();
3831 } 3841 }
3832 #endif 3842 #endif
3833 3843
3834 void RenderFrameImpl::DidPlay(WebMediaPlayer* player) { 3844 void RenderFrameImpl::DidPlay(WebMediaPlayer* player) {
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
5070 void RenderFrameImpl::RegisterMojoServices() { 5080 void RenderFrameImpl::RegisterMojoServices() {
5071 // Only main frame have ImageDownloader service. 5081 // Only main frame have ImageDownloader service.
5072 if (!frame_->parent()) { 5082 if (!frame_->parent()) {
5073 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>( 5083 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>(
5074 base::Bind(&ImageDownloaderImpl::CreateMojoService, 5084 base::Bind(&ImageDownloaderImpl::CreateMojoService,
5075 base::Unretained(this))); 5085 base::Unretained(this)));
5076 } 5086 }
5077 } 5087 }
5078 5088
5079 } // namespace content 5089 } // namespace content
OLDNEW
« content/child/bluetooth/web_bluetooth_impl.cc ('K') | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698