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

Unified Diff: extensions/browser/guest_view/web_view/web_view_permission_helper.cc

Issue 586223002: Add new media request result MEDIA_DEVICE_FAILED_DUE_TO_SHUTDOWN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/media_stream_request.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/guest_view/web_view/web_view_permission_helper.cc
diff --git a/extensions/browser/guest_view/web_view/web_view_permission_helper.cc b/extensions/browser/guest_view/web_view/web_view_permission_helper.cc
index c99eddea501c7783d193dcc4b24678d1f3527f19..855ade185c346c4cd080cd5378f08f3768535b5c 100644
--- a/extensions/browser/guest_view/web_view/web_view_permission_helper.cc
+++ b/extensions/browser/guest_view/web_view/web_view_permission_helper.cc
@@ -196,6 +196,10 @@ bool WebViewPermissionHelper::CheckMediaAccessPermission(
content::WebContents* source,
const GURL& security_origin,
content::MediaStreamType type) {
+ if (!web_view_guest()->attached() ||
+ !web_view_guest()->embedder_web_contents()->GetDelegate()) {
+ return false;
+ }
return web_view_guest()
->embedder_web_contents()
->GetDelegate()
@@ -208,15 +212,19 @@ void WebViewPermissionHelper::OnMediaPermissionResponse(
const content::MediaResponseCallback& callback,
bool allow,
const std::string& user_input) {
- if (!allow || !web_view_guest()->attached()) {
- // Deny the request.
+ if (!allow) {
callback.Run(content::MediaStreamDevices(),
- content::MEDIA_DEVICE_INVALID_STATE,
+ content::MEDIA_DEVICE_PERMISSION_DENIED,
scoped_ptr<content::MediaStreamUI>());
return;
}
- if (!web_view_guest()->embedder_web_contents()->GetDelegate())
+ if (!web_view_guest()->attached() ||
+ !web_view_guest()->embedder_web_contents()->GetDelegate()) {
+ callback.Run(content::MediaStreamDevices(),
+ content::MEDIA_DEVICE_INVALID_STATE,
+ scoped_ptr<content::MediaStreamUI>());
return;
+ }
web_view_guest()
->embedder_web_contents()
« no previous file with comments | « content/public/common/media_stream_request.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698