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

Unified Diff: chrome/browser/extensions/api/webrtc_desktop_capture_private/webrtc_desktop_capture_private_api.cc

Issue 1138383007: Switch private WebRTC desktop capture API to use IsOriginSecure() instead of SchemeIsSecure(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/webrtc_desktop_capture_private/webrtc_desktop_capture_private_api.cc
diff --git a/chrome/browser/extensions/api/webrtc_desktop_capture_private/webrtc_desktop_capture_private_api.cc b/chrome/browser/extensions/api/webrtc_desktop_capture_private/webrtc_desktop_capture_private_api.cc
index 0ce65ba26e9a1aa6ed743d06e8e027e61cd3a778..bea55a968df7c01f9bf44fc51adfbb71c8d78a18 100644
--- a/chrome/browser/extensions/api/webrtc_desktop_capture_private/webrtc_desktop_capture_private_api.cc
+++ b/chrome/browser/extensions/api/webrtc_desktop_capture_private/webrtc_desktop_capture_private_api.cc
@@ -16,6 +16,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/origin_util.h"
#include "net/base/net_util.h"
namespace extensions {
@@ -75,12 +76,13 @@ bool WebrtcDesktopCapturePrivateChooseDesktopMediaFunction::RunAsync() {
GURL origin = rfh->GetLastCommittedURL().GetOrigin();
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAllowHttpScreenCapture) &&
- !origin.SchemeIsSecure()) {
+ !content::IsOriginSecure(origin)) {
error_ = kUrlNotSecure;
return false;
}
- base::string16 target_name = base::UTF8ToUTF16(origin.SchemeIsSecure() ?
- net::GetHostAndOptionalPort(origin) : origin.spec());
+ base::string16 target_name = base::UTF8ToUTF16(
+ content::IsOriginSecure(origin) ? net::GetHostAndOptionalPort(origin)
+ : origin.spec());
content::WebContents* web_contents =
content::WebContents::FromRenderViewHost(rvh);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698