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

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

Issue 1873293002: Report if video capturing meets output protection requirement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed oshima and nasko's comments, and rebased. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/capture_access_handler_base.h
diff --git a/chrome/browser/media/capture_access_handler_base.h b/chrome/browser/media/capture_access_handler_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..7e22fe9caeb058dc7a556b31c2a962bdc61d9fe5
--- /dev/null
+++ b/chrome/browser/media/capture_access_handler_base.h
@@ -0,0 +1,70 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MEDIA_CAPTURE_ACCESS_HANDLER_BASE_H_
+#define CHROME_BROWSER_MEDIA_CAPTURE_ACCESS_HANDLER_BASE_H_
+
+#include <list>
+
+#include "chrome/browser/media/media_access_handler.h"
+#include "content/public/browser/media_request_state.h"
+#include "content/public/common/media_stream_request.h"
+
+// Base class for DesktopCaptureAccessHandler and TabCaptureAccessHandler. This
+// class tracks active capturing sessions, and provides API to check if there is
+// ongoing insecure video capturing.
+class CaptureAccessHandlerBase : public MediaAccessHandler {
+ public:
+ CaptureAccessHandlerBase();
+ ~CaptureAccessHandlerBase() override;
+
+ // MediaAccessHandler implementation.
+ void UpdateMediaRequestState(int render_process_id,
+ int render_frame_id,
+ int page_request_id,
+ content::MediaStreamType stream_type,
+ content::MediaRequestState state) override;
+
+ // Return true if there is any ongoing insecured capturing. The capturing is
+ // deemed secure if all connected video sinks are reported secure and the
+ // connections to the sinks are being managed by a trusted extension.
+ bool IsInsecureCapturingInProgress(int render_process_id,
+ int render_frame_id);
+
+ void UpdateCapturingLinkSecured(int render_process_id,
+ int render_frame_id,
+ int page_request_id,
+ bool is_secure);
+
+ protected:
+ static bool IsExtensionWhitelistedForScreenCapture(
+ const extensions::Extension* extension);
+
+ static bool IsBuiltInExtension(const GURL& origin);
+
+ void UpdateExtensionTrusted(const content::MediaStreamRequest& request,
+ const extensions::Extension* extension);
+
+ private:
+ struct Session;
+
+ void AddCaptureSession(int render_process_id,
+ int render_frame_id,
+ int page_request_id,
+ bool is_extension_trusted);
+
+ void RemoveCaptureSession(int render_process_id,
+ int render_frame_id,
+ int page_request_id);
+
+ std::list<Session>::iterator FindSession(int render_process_id,
+ int render_frame_id,
+ int page_request_id);
+
+ std::list<Session> sessions_;
+
+ DISALLOW_COPY_AND_ASSIGN(CaptureAccessHandlerBase);
+};
+
+#endif // CHROME_BROWSER_MEDIA_CAPTURE_ACCESS_HANDLER_BASE_H_
« no previous file with comments | « chrome/browser/chromeos/display/output_protection_delegate.cc ('k') | chrome/browser/media/capture_access_handler_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698