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

Unified Diff: chrome/browser/media/protected_media_identifier_permission_context.h

Issue 903873002: media: Support simultaneous permission requests from multiple WebContents in ProtectedMediaIdentifi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 5 years, 10 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 | « no previous file | chrome/browser/media/protected_media_identifier_permission_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/protected_media_identifier_permission_context.h
diff --git a/chrome/browser/media/protected_media_identifier_permission_context.h b/chrome/browser/media/protected_media_identifier_permission_context.h
index 65e9d6b6a2364ae3a97ee1762af666fb437bf472..4cc94f55d2beea10025b9de9975dea2da739e30c 100644
--- a/chrome/browser/media/protected_media_identifier_permission_context.h
+++ b/chrome/browser/media/protected_media_identifier_permission_context.h
@@ -9,6 +9,8 @@
#include "components/content_settings/core/common/permission_request_id.h"
#if defined(OS_CHROMEOS)
+#include <map>
+
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/attestation/platform_verification_dialog.h"
#include "chrome/browser/chromeos/attestation/platform_verification_flow.h"
@@ -58,6 +60,7 @@ class ProtectedMediaIdentifierPermissionContext
#if defined(OS_CHROMEOS)
void OnPlatformVerificationResult(
+ content::WebContents* web_contents,
const PermissionRequestID& id,
const GURL& requesting_origin,
const GURL& embedding_origin,
@@ -65,11 +68,13 @@ class ProtectedMediaIdentifierPermissionContext
chromeos::attestation::PlatformVerificationFlow::ConsentResponse
response);
- // ID for the pending permission request. Invalid when no request is pending,
- // or the request has been canceled.
- PermissionRequestID pending_id_;
-
- views::Widget* widget_;
+ // |this| is shared among multiple WebContents, so we could receive multiple
+ // permission requests. This map tracks all pending requests. Note that we
+ // only allow one request per WebContents.
+ typedef std::map<content::WebContents*,
+ std::pair<views::Widget*, PermissionRequestID>>
+ PendingRequestMap;
+ PendingRequestMap pending_requests_;
// Must be the last member, to ensure that it will be
// destroyed first, which will invalidate weak pointers
« no previous file with comments | « no previous file | chrome/browser/media/protected_media_identifier_permission_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698