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

Side by Side Diff: content/renderer/pepper/pepper_camera_device_host.cc

Issue 2882133002: Block insecure pepper media requests in the renderer (Closed)
Patch Set: Block insecure pepper media requests Created 3 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/pepper/pepper_camera_device_host.h" 5 #include "content/renderer/pepper/pepper_camera_device_host.h"
6 6
7 #include "content/renderer/pepper/pepper_platform_camera_device.h" 7 #include "content/renderer/pepper/pepper_platform_camera_device.h"
8 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" 8 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
9 #include "content/renderer/render_frame_impl.h" 9 #include "content/renderer/render_frame_impl.h"
10 #include "ppapi/host/dispatch_host_message.h" 10 #include "ppapi/host/dispatch_host_message.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 if (platform_camera_device_.get()) 83 if (platform_camera_device_.get())
84 return PP_ERROR_FAILED; 84 return PP_ERROR_FAILED;
85 85
86 GURL document_url = renderer_ppapi_host_->GetDocumentURL(pp_instance()); 86 GURL document_url = renderer_ppapi_host_->GetDocumentURL(pp_instance());
87 if (!document_url.is_valid()) 87 if (!document_url.is_valid())
88 return PP_ERROR_FAILED; 88 return PP_ERROR_FAILED;
89 89
90 platform_camera_device_.reset(new PepperPlatformCameraDevice( 90 platform_camera_device_.reset(new PepperPlatformCameraDevice(
91 renderer_ppapi_host_->GetRenderFrameForInstance(pp_instance()) 91 renderer_ppapi_host_->GetRenderFrameForInstance(pp_instance())
92 ->GetRoutingID(), 92 ->GetRoutingID(),
93 device_id, document_url, this)); 93 device_id, this));
94 94
95 open_reply_context_ = context->MakeReplyMessageContext(); 95 open_reply_context_ = context->MakeReplyMessageContext();
96 96
97 return PP_OK_COMPLETIONPENDING; 97 return PP_OK_COMPLETIONPENDING;
98 } 98 }
99 99
100 int32_t PepperCameraDeviceHost::OnClose( 100 int32_t PepperCameraDeviceHost::OnClose(
101 ppapi::host::HostMessageContext* context) { 101 ppapi::host::HostMessageContext* context) {
102 DetachPlatformCameraDevice(); 102 DetachPlatformCameraDevice();
103 return PP_OK; 103 return PP_OK;
(...skipping 13 matching lines...) Expand all
117 } 117 }
118 118
119 void PepperCameraDeviceHost::DetachPlatformCameraDevice() { 119 void PepperCameraDeviceHost::DetachPlatformCameraDevice() {
120 if (platform_camera_device_) { 120 if (platform_camera_device_) {
121 platform_camera_device_->DetachEventHandler(); 121 platform_camera_device_->DetachEventHandler();
122 platform_camera_device_.reset(); 122 platform_camera_device_.reset();
123 } 123 }
124 } 124 }
125 125
126 } // namespace content 126 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_audio_input_host.cc ('k') | content/renderer/pepper/pepper_media_device_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698