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

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

Issue 48743008: Pepper: specify the security origin when enumerating media devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer_ppapi_host_impl.h" 5 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 base::MessageLoop::current()->PostTask(FROM_HERE, 238 base::MessageLoop::current()->PostTask(FROM_HERE,
239 base::Bind(callback, std::vector<int>(nested_msgs.size(), 0))); 239 base::Bind(callback, std::vector<int>(nested_msgs.size(), 0)));
240 } else { 240 } else {
241 browser_connection->SendBrowserCreate(module_->GetPluginChildId(), 241 browser_connection->SendBrowserCreate(module_->GetPluginChildId(),
242 instance, 242 instance,
243 nested_msgs, 243 nested_msgs,
244 callback); 244 callback);
245 } 245 }
246 } 246 }
247 247
248 GURL RendererPpapiHostImpl::GetDocumentURL(PP_Instance instance) const {
249 PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance);
250 if (!instance_object)
251 return GURL();
252
253 return instance_object->container()->element().document().url();
254 }
255
248 PepperPluginInstanceImpl* RendererPpapiHostImpl::GetAndValidateInstance( 256 PepperPluginInstanceImpl* RendererPpapiHostImpl::GetAndValidateInstance(
249 PP_Instance pp_instance) const { 257 PP_Instance pp_instance) const {
250 PepperPluginInstanceImpl* instance = 258 PepperPluginInstanceImpl* instance =
251 HostGlobals::Get()->GetInstance(pp_instance); 259 HostGlobals::Get()->GetInstance(pp_instance);
252 if (!instance) 260 if (!instance)
253 return NULL; 261 return NULL;
254 if (!instance->IsValidInstanceOf(module_)) 262 if (!instance->IsValidInstanceOf(module_))
255 return NULL; 263 return NULL;
256 return instance; 264 return instance;
257 } 265 }
258 266
259 } // namespace content 267 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698