From da59c0f58b044b0b13aa0a522272489ada2a60fe Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Mon, 7 Mar 2016 21:38:56 -0800 Subject: [PATCH 1/8] basictypes.h => macros.h --- brightray/browser/devtools_contents_resizing_strategy.h | 2 +- brightray/browser/devtools_manager_delegate.h | 2 +- brightray/browser/inspectable_web_contents_impl.cc | 4 ++-- brightray/browser/inspectable_web_contents_impl.h | 4 ++-- brightray/browser/net/devtools_network_interceptor.cc | 2 +- brightray/browser/web_ui_controller_factory.h | 2 +- brightray/browser/win/scoped_hstring.h | 2 +- brightray/browser/win/windows_toast_notification.cc | 4 ++-- brightray/browser/win/windows_toast_notification.h | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/brightray/browser/devtools_contents_resizing_strategy.h b/brightray/browser/devtools_contents_resizing_strategy.h index 9c82c060b1e7..c48272f79774 100644 --- a/brightray/browser/devtools_contents_resizing_strategy.h +++ b/brightray/browser/devtools_contents_resizing_strategy.h @@ -5,7 +5,7 @@ #ifndef BRIGHTRAY_BROWSER_DEVTOOLS_CONTENTS_RESIZING_STRATEGY_H_ #define BRIGHTRAY_BROWSER_DEVTOOLS_CONTENTS_RESIZING_STRATEGY_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" diff --git a/brightray/browser/devtools_manager_delegate.h b/brightray/browser/devtools_manager_delegate.h index ed8e357482b2..12eedc66082f 100644 --- a/brightray/browser/devtools_manager_delegate.h +++ b/brightray/browser/devtools_manager_delegate.h @@ -5,7 +5,7 @@ #ifndef BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ #define BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "base/compiler_specific.h" #include "components/devtools_http_handler/devtools_http_handler_delegate.h" #include "content/public/browser/devtools_manager_delegate.h" diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 1ff21b694a05..b876ef86288d 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -592,9 +592,9 @@ void InspectableWebContentsImpl::WebContentsDestroyed() { bool InspectableWebContentsImpl::AddMessageToConsole( content::WebContents* source, - int32 level, + int32_t level, const base::string16& message, - int32 line_no, + int32_t line_no, const base::string16& source_id) { logging::LogMessage("CONSOLE", line_no, level).stream() << "\"" << message << "\", source: " << source_id << " (" << line_no << ")"; diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 9b985bbc6c96..8543f5e99e77 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -134,9 +134,9 @@ class InspectableWebContentsImpl : // content::WebContentsDelegate: bool AddMessageToConsole(content::WebContents* source, - int32 level, + int32_t level, const base::string16& message, - int32 line_no, + int32_t line_no, const base::string16& source_id) override; bool ShouldCreateWebContents( content::WebContents* web_contents, diff --git a/brightray/browser/net/devtools_network_interceptor.cc b/brightray/browser/net/devtools_network_interceptor.cc index 78afb00a09a5..2535ed74bd3c 100644 --- a/brightray/browser/net/devtools_network_interceptor.cc +++ b/brightray/browser/net/devtools_network_interceptor.cc @@ -207,7 +207,7 @@ void DevToolsNetworkInterceptor::ArmTimer(base::TimeTicks now) { base::TimeTicks desired_time = offset_ + tick_length_ * (last_tick_ + min_ticks_left); - int64_t min_baseline = std::numeric_limits::max(); + int64_t min_baseline = std::numeric_limits::max(); for (size_t i = 0; i < suspend_count; ++i) { if (suspended_transactions_[i].second < min_baseline) min_baseline = suspended_transactions_[i].second; diff --git a/brightray/browser/web_ui_controller_factory.h b/brightray/browser/web_ui_controller_factory.h index 44a77da5f1ea..ca86de6baa65 100644 --- a/brightray/browser/web_ui_controller_factory.h +++ b/brightray/browser/web_ui_controller_factory.h @@ -5,7 +5,7 @@ #ifndef BRIGHTRAY_BROWSER_WEB_UI_CONTROLLER_FACTORY_H_ #define BRIGHTRAY_BROWSER_WEB_UI_CONTROLLER_FACTORY_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_controller_factory.h" diff --git a/brightray/browser/win/scoped_hstring.h b/brightray/browser/win/scoped_hstring.h index 5494df2fc5ce..67e4fe67fd07 100644 --- a/brightray/browser/win/scoped_hstring.h +++ b/brightray/browser/win/scoped_hstring.h @@ -10,7 +10,7 @@ #include #include -#include "base/basictypes.h" +#include "base/macros.h" class ScopedHString { public: diff --git a/brightray/browser/win/windows_toast_notification.cc b/brightray/browser/win/windows_toast_notification.cc index c1be87223cd1..badd4f2254b0 100644 --- a/brightray/browser/win/windows_toast_notification.cc +++ b/brightray/browser/win/windows_toast_notification.cc @@ -330,7 +330,7 @@ bool WindowsToastNotification::GetTextNodeList( ScopedHString* tag, IXmlDocument* doc, IXmlNodeList** node_list, - UINT32 req_length) { + Uint32_t req_length) { tag->Reset(L"text"); if (!tag->success()) return false; @@ -338,7 +338,7 @@ bool WindowsToastNotification::GetTextNodeList( if (FAILED(doc->GetElementsByTagName(*tag, node_list))) return false; - UINT32 node_length; + Uint32_t node_length; if (FAILED((*node_list)->get_Length(&node_length))) return false; diff --git a/brightray/browser/win/windows_toast_notification.h b/brightray/browser/win/windows_toast_notification.h index cb69d3da2a14..6cd7bafe876c 100644 --- a/brightray/browser/win/windows_toast_notification.h +++ b/brightray/browser/win/windows_toast_notification.h @@ -70,7 +70,7 @@ class WindowsToastNotification : public Notification { bool GetTextNodeList(ScopedHString* tag, ABI::Windows::Data::Xml::Dom::IXmlDocument* doc, ABI::Windows::Data::Xml::Dom::IXmlNodeList** nodeList, - UINT32 reqLength); + Uint32_t reqLength); bool AppendTextToXml(ABI::Windows::Data::Xml::Dom::IXmlDocument* doc, ABI::Windows::Data::Xml::Dom::IXmlNode* node, const std::wstring& text); From e901b1c6caae54144805a1add9453a4636d8283e Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Mon, 7 Mar 2016 21:59:14 -0800 Subject: [PATCH 2/8] Update NetworkDelegate --- brightray/browser/network_delegate.cc | 13 +++++++------ brightray/browser/network_delegate.h | 9 +++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/brightray/browser/network_delegate.cc b/brightray/browser/network_delegate.cc index 8a1f8ee828ce..e03adba65a17 100644 --- a/brightray/browser/network_delegate.cc +++ b/brightray/browser/network_delegate.cc @@ -92,14 +92,11 @@ void NetworkDelegate::OnBeforeRedirect(net::URLRequest* request, void NetworkDelegate::OnResponseStarted(net::URLRequest* request) { } -void NetworkDelegate::OnURLRequestJobOrphaned(net::URLRequest* request) { -} - -void NetworkDelegate::OnNetworkBytesReceived(const net::URLRequest& request, +void NetworkDelegate::OnNetworkBytesReceived(net::URLRequest* request, int64_t bytes_read) { } -void NetworkDelegate::OnNetworkBytesSent(const net::URLRequest& request, +void NetworkDelegate::OnNetworkBytesSent(net::URLRequest* request, int64_t bytes_sent) { } @@ -143,7 +140,11 @@ bool NetworkDelegate::OnCanEnablePrivacyMode( return false; } -bool NetworkDelegate::OnFirstPartyOnlyCookieExperimentEnabled() const { +bool OnAreStrictSecureCookiesEnabled() { + return true; +} + +bool OnAreExperimentalCookieFeaturesEnabled() { return true; } diff --git a/brightray/browser/network_delegate.h b/brightray/browser/network_delegate.h index b10cabadd229..113587540080 100644 --- a/brightray/browser/network_delegate.h +++ b/brightray/browser/network_delegate.h @@ -43,10 +43,9 @@ class NetworkDelegate : public net::NetworkDelegate { void OnBeforeRedirect(net::URLRequest* request, const GURL& new_location) override; void OnResponseStarted(net::URLRequest* request) override; - void OnURLRequestJobOrphaned(net::URLRequest* request) override; - void OnNetworkBytesReceived(const net::URLRequest& request, + void OnNetworkBytesReceived(net::URLRequest* request, int64_t bytes_read) override; - void OnNetworkBytesSent(const net::URLRequest& request, + void OnNetworkBytesSent(net::URLRequest* request, int64_t bytes_sent) override; void OnCompleted(net::URLRequest* request, bool started) override; void OnURLRequestDestroyed(net::URLRequest* request) override; @@ -67,7 +66,9 @@ class NetworkDelegate : public net::NetworkDelegate { bool OnCanEnablePrivacyMode( const GURL& url, const GURL& first_party_for_cookies) const override; - bool OnFirstPartyOnlyCookieExperimentEnabled() const override; + + virtual bool OnAreStrictSecureCookiesEnabled() const override; + virtual bool OnAreExperimentalCookieFeaturesEnabled() const override; bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( const net::URLRequest& request, const GURL& target_url, From 157f3abe64a7845f5ccba34435e77dbd4e7ebc29 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Mon, 7 Mar 2016 22:02:42 -0800 Subject: [PATCH 3/8] Not quite sure how this ever worked --- .../browser/win/windows_toast_notification.cc | 28 +++++++++---------- .../browser/win/windows_toast_notification.h | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/brightray/browser/win/windows_toast_notification.cc b/brightray/browser/win/windows_toast_notification.cc index badd4f2254b0..74cd74ecebdc 100644 --- a/brightray/browser/win/windows_toast_notification.cc +++ b/brightray/browser/win/windows_toast_notification.cc @@ -173,10 +173,10 @@ bool WindowsToastNotification::GetToastXml( if (!SetXmlText(*toast_xml, title, msg)) return false; } - + // Configure the toast's notification sound if (silent) { - if (FAILED(SetXmlAudioSilent(*toast_xml))) + if (FAILED(SetXmlAudioSilent(*toast_xml))) return false; } @@ -200,40 +200,40 @@ bool WindowsToastNotification::SetXmlAudioSilent( ComPtr root; if (FAILED(node_list->Item(0, &root))) return false; - + ComPtr audio_element; ScopedHString audio_str(L"audio"); if (FAILED(doc->CreateElement(audio_str, &audio_element))) return false; - + ComPtr audio_node_tmp; if (FAILED(audio_element.As(&audio_node_tmp))) return false; - + // Append audio node to toast xml ComPtr audio_node; if (FAILED(root->AppendChild(audio_node_tmp.Get(), &audio_node))) return false; - + // Create silent attribute ComPtr attributes; if (FAILED(audio_node->get_Attributes(&attributes))) return false; - + ComPtr silent_attribute; ScopedHString silent_str(L"silent"); if (FAILED(doc->CreateAttribute(silent_str, &silent_attribute))) return false; - + ComPtr silent_attribute_node; if (FAILED(silent_attribute.As(&silent_attribute_node))) return false; - + // Set silent attribute to true ScopedHString silent_value(L"true"); if (!silent_value.success()) return false; - + ComPtr silent_text; if (FAILED(doc->CreateTextNode(silent_value, &silent_text))) return false; @@ -241,11 +241,11 @@ bool WindowsToastNotification::SetXmlAudioSilent( ComPtr silent_node; if (FAILED(silent_text.As(&silent_node))) return false; - + ComPtr child_node; if (FAILED(silent_attribute_node->AppendChild(silent_node.Get(), &child_node))) return false; - + ComPtr silent_attribute_pnode; return SUCCEEDED(attributes.Get()->SetNamedItem(silent_attribute_node.Get(), &silent_attribute_pnode)); } @@ -330,7 +330,7 @@ bool WindowsToastNotification::GetTextNodeList( ScopedHString* tag, IXmlDocument* doc, IXmlNodeList** node_list, - Uint32_t req_length) { + uint32_t req_length) { tag->Reset(L"text"); if (!tag->success()) return false; @@ -338,7 +338,7 @@ bool WindowsToastNotification::GetTextNodeList( if (FAILED(doc->GetElementsByTagName(*tag, node_list))) return false; - Uint32_t node_length; + uint32_t node_length; if (FAILED((*node_list)->get_Length(&node_length))) return false; diff --git a/brightray/browser/win/windows_toast_notification.h b/brightray/browser/win/windows_toast_notification.h index 6cd7bafe876c..d5e5f2a82cf8 100644 --- a/brightray/browser/win/windows_toast_notification.h +++ b/brightray/browser/win/windows_toast_notification.h @@ -70,7 +70,7 @@ class WindowsToastNotification : public Notification { bool GetTextNodeList(ScopedHString* tag, ABI::Windows::Data::Xml::Dom::IXmlDocument* doc, ABI::Windows::Data::Xml::Dom::IXmlNodeList** nodeList, - Uint32_t reqLength); + uint32_t reqLength); bool AppendTextToXml(ABI::Windows::Data::Xml::Dom::IXmlDocument* doc, ABI::Windows::Data::Xml::Dom::IXmlNode* node, const std::wstring& text); From 40c98381abbb6792f9ba0986127b4ece603968e8 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Mon, 7 Mar 2016 22:18:16 -0800 Subject: [PATCH 4/8] Update headers for InspectableWebContentsImpl --- brightray/browser/inspectable_web_contents_impl.cc | 7 ++++--- brightray/browser/inspectable_web_contents_impl.h | 13 ++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index b876ef86288d..76972b654e9f 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -573,7 +573,7 @@ void InspectableWebContentsImpl::AgentHostClosed( content::DevToolsAgentHost* agent_host, bool replaced) { } -void InspectableWebContentsImpl::AboutToNavigateRenderFrame( +void InspectableWebContentsImpl::RenderFrameHostChanged( content::RenderFrameHost* old_host, content::RenderFrameHost* new_host) { if (new_host->GetParent()) @@ -603,8 +603,9 @@ bool InspectableWebContentsImpl::AddMessageToConsole( bool InspectableWebContentsImpl::ShouldCreateWebContents( content::WebContents* web_contents, - int route_id, - int main_frame_route_id, + int32_t route_id, + int32_t main_frame_route_id, + int32_t main_frame_widget_route_id, WindowContainerType window_container_type, const std::string& frame_name, const GURL& target_url, diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 8543f5e99e77..7edf9ce96e83 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -33,7 +33,6 @@ class InspectableWebContentsView; class InspectableWebContentsImpl : public InspectableWebContents, - public content::DevToolsFrontendHost::Delegate, public content::DevToolsAgentHostClient, public content::WebContentsObserver, public content::WebContentsDelegate, @@ -117,8 +116,7 @@ class InspectableWebContentsImpl : void ClearPreferences() override; // content::DevToolsFrontendHostDelegate: - void HandleMessageFromDevToolsFrontend(const std::string& message) override; - void HandleMessageFromDevToolsFrontendToBackend(const std::string& message) override; + void HandleMessageFromDevToolsFrontend(const std::string& message); // content::DevToolsAgentHostClient: void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, @@ -127,8 +125,8 @@ class InspectableWebContentsImpl : bool replaced) override; // content::WebContentsObserver: - void AboutToNavigateRenderFrame(content::RenderFrameHost* old_host, - content::RenderFrameHost* new_host) override; + void RenderFrameHostChanged(content::RenderFrameHost* old_host, + content::RenderFrameHost* new_host) override; void WebContentsDestroyed() override; void OnWebContentsFocused() override; @@ -140,8 +138,9 @@ class InspectableWebContentsImpl : const base::string16& source_id) override; bool ShouldCreateWebContents( content::WebContents* web_contents, - int route_id, - int main_frame_route_id, + int32_t route_id, + int32_t main_frame_route_id, + int32_t main_frame_widget_route_id, WindowContainerType window_container_type, const std::string& frame_name, const GURL& target_url, From d204febecfc1546b49e343eecb2b6161117a6ccf Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Mon, 7 Mar 2016 22:29:23 -0800 Subject: [PATCH 5/8] Update DevtoolsNetworkTransaction --- brightray/browser/net/devtools_network_transaction.cc | 8 +++++++- brightray/browser/net/devtools_network_transaction.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/brightray/browser/net/devtools_network_transaction.cc b/brightray/browser/net/devtools_network_transaction.cc index fa3343ef9879..c65230d6f5aa 100644 --- a/brightray/browser/net/devtools_network_transaction.cc +++ b/brightray/browser/net/devtools_network_transaction.cc @@ -106,10 +106,11 @@ int DevToolsNetworkTransaction::RestartIgnoringLastError( int DevToolsNetworkTransaction::RestartWithCertificate( net::X509Certificate* client_certificate, + net::SSLPrivateKey* client_private_key, const net::CompletionCallback& callback) { if (failed_) return net::ERR_INTERNET_DISCONNECTED; - int rv = transaction_->RestartWithCertificate(client_certificate, proxy_callback_); + int rv = transaction_->RestartWithCertificate(client_certificate, client_private_key, proxy_callback_); return SetupCallback(callback, rv, RESTART_WITH_CERTIFICATE); } @@ -185,6 +186,11 @@ bool DevToolsNetworkTransaction::GetRemoteEndpoint( return transaction_->GetRemoteEndpoint(endpoint); } +void DevToolsNetworkTransaction::PopulateNetErrorDetails( + net::NetErrorDetails* details) const { + return transaction_->PopulateNetErrorDetails(details); +} + void DevToolsNetworkTransaction::SetPriority(net::RequestPriority priority) { transaction_->SetPriority(priority); } diff --git a/brightray/browser/net/devtools_network_transaction.h b/brightray/browser/net/devtools_network_transaction.h index 3e16db0f2c2c..f8e54e67775f 100644 --- a/brightray/browser/net/devtools_network_transaction.h +++ b/brightray/browser/net/devtools_network_transaction.h @@ -46,6 +46,7 @@ class DevToolsNetworkTransaction : public net::HttpTransaction { int RestartIgnoringLastError( const net::CompletionCallback& callback) override; int RestartWithCertificate(net::X509Certificate* client_cert, + net::SSLPrivateKey* client_private_key, const net::CompletionCallback& callback) override; int RestartWithAuth(const net::AuthCredentials& credentials, const net::CompletionCallback& callback) override; @@ -65,6 +66,7 @@ class DevToolsNetworkTransaction : public net::HttpTransaction { void SetQuicServerInfo(net::QuicServerInfo* quic_server_info) override; bool GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override; bool GetRemoteEndpoint(net::IPEndPoint* endpoint) const override; + void PopulateNetErrorDetails(net::NetErrorDetails* details) const override; void SetPriority(net::RequestPriority priority) override; void SetWebSocketHandshakeStreamCreateHelper( net::WebSocketHandshakeStreamBase::CreateHelper* create_helper) override; From 18a75b5124a0d6eb26aa9c54691be771fdb9c6dc Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Mon, 7 Mar 2016 22:38:48 -0800 Subject: [PATCH 6/8] Renamed enum in MediaStreamDeviceRequest --- brightray/browser/devtools_manager_delegate.cc | 2 +- brightray/browser/media/media_stream_devices_controller.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/brightray/browser/devtools_manager_delegate.cc b/brightray/browser/devtools_manager_delegate.cc index ca8f1cf2d84b..cf266f01811c 100644 --- a/brightray/browser/devtools_manager_delegate.cc +++ b/brightray/browser/devtools_manager_delegate.cc @@ -55,7 +55,7 @@ class TCPServerSocketFactory } std::string address_; - uint16 port_; + uint16_t port_; DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory); }; diff --git a/brightray/browser/media/media_stream_devices_controller.cc b/brightray/browser/media/media_stream_devices_controller.cc index 3d4f4cc3328c..1a205f1ed775 100644 --- a/brightray/browser/media/media_stream_devices_controller.cc +++ b/brightray/browser/media/media_stream_devices_controller.cc @@ -33,10 +33,10 @@ MediaStreamDevicesController::MediaStreamDevicesController( // and microphone to avoid popping two infobars. microphone_requested_( request.audio_type == content::MEDIA_DEVICE_AUDIO_CAPTURE || - request.request_type == content::MEDIA_OPEN_DEVICE), + request.request_type == content::MEDIA_OPEN_DEVICE_PEPPER_ONLY), webcam_requested_( request.video_type == content::MEDIA_DEVICE_VIDEO_CAPTURE || - request.request_type == content::MEDIA_OPEN_DEVICE) { + request.request_type == content::MEDIA_OPEN_DEVICE_PEPPER_ONLY) { } MediaStreamDevicesController::~MediaStreamDevicesController() { @@ -72,7 +72,7 @@ void MediaStreamDevicesController::Accept() { content::MediaStreamDevices devices; if (microphone_requested_ || webcam_requested_) { switch (request_.request_type) { - case content::MEDIA_OPEN_DEVICE: { + case content::MEDIA_OPEN_DEVICE_PEPPER_ONLY: { const content::MediaStreamDevice* device = NULL; // For open device request pick the desired device or fall back to the // first available of the given type. From 6517dffa04f3f9c052762774fa6113b986654572 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Mon, 7 Mar 2016 22:58:25 -0800 Subject: [PATCH 7/8] Start to update UrlRequestContextGetter --- brightray/browser/url_request_context_getter.cc | 10 +++++++++- brightray/browser/url_request_context_getter.h | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index 5c0d7828a96f..d585b1d12b7c 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -104,8 +104,16 @@ bool URLRequestContextGetter::DelegateURLSecurityManager::CanDelegate return delegate_->CanDelegateURLSecurity(auth_origin); } +void URLRequestContextGetter::DelegateURLSecurityManager::SetDefaultWhitelist( + scoped_ptr whitelist_default) { +} + +void URLRequestContextGetter::DelegateURLSecurityManager::SetDelegateWhitelist( + scoped_ptr whitelist_delegate) { +} + URLRequestContextGetter::Delegate::Delegate() : - orig_url_sec_mgr_(net::URLSecurityManager::Create(NULL, NULL)) {} + orig_url_sec_mgr_(net::URLSecurityManager::Create()) {} std::string URLRequestContextGetter::Delegate::GetUserAgent() { return base::EmptyString(); diff --git a/brightray/browser/url_request_context_getter.h b/brightray/browser/url_request_context_getter.h index cf647cf7b512..cb9af8c6f7f2 100644 --- a/brightray/browser/url_request_context_getter.h +++ b/brightray/browser/url_request_context_getter.h @@ -59,6 +59,10 @@ class URLRequestContextGetter : public net::URLRequestContextGetter { bool CanUseDefaultCredentials(const GURL& auth_origin) const override; bool CanDelegate(const GURL& auth_origin) const override; + void SetDefaultWhitelist( + scoped_ptr whitelist_default) override; + void SetDelegateWhitelist( + scoped_ptr whitelist_delegate) override; private: URLRequestContextGetter::Delegate* delegate_; From dba668057816743533891019e35b0966f06ef552 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Mon, 7 Mar 2016 23:09:25 -0800 Subject: [PATCH 8/8] Everyone gets permission --- brightray/browser/permission_manager.cc | 21 +++++++++++++++++++++ brightray/browser/permission_manager.h | 7 +++++++ 2 files changed, 28 insertions(+) diff --git a/brightray/browser/permission_manager.cc b/brightray/browser/permission_manager.cc index c5d1ac9a9cd5..eff85ddc1200 100644 --- a/brightray/browser/permission_manager.cc +++ b/brightray/browser/permission_manager.cc @@ -32,6 +32,27 @@ int PermissionManager::RequestPermission( return kNoPendingOperation; } +int PermissionManager::RequestPermissions( + const std::vector& permissions, + content::RenderFrameHost* render_frame_host, + const GURL& requesting_origin, + bool user_gesture, + const base::Callback&)>& callback) { + std::vector permissionStatuses; + + for (auto permission : permissions) { + if (permission == content::PermissionType::MIDI_SYSEX) { + content::ChildProcessSecurityPolicy::GetInstance()-> + GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID()); + } + + permissionStatuses.push_back(content::PERMISSION_STATUS_GRANTED); + } + + callback.Run(permissionStatuses); + return kNoPendingOperation; +} void PermissionManager::CancelPermissionRequest(int request_id) { } diff --git a/brightray/browser/permission_manager.h b/brightray/browser/permission_manager.h index 778605c51ec1..f3ed51d3c1a8 100644 --- a/brightray/browser/permission_manager.h +++ b/brightray/browser/permission_manager.h @@ -23,6 +23,13 @@ class PermissionManager : public content::PermissionManager { const GURL& requesting_origin, bool user_gesture, const base::Callback& callback) override; + int RequestPermissions( + const std::vector& permissions, + content::RenderFrameHost* render_frame_host, + const GURL& requesting_origin, + bool user_gesture, + const base::Callback&)>& callback) override; void CancelPermissionRequest(int request_id) override; void ResetPermission(content::PermissionType permission, const GURL& requesting_origin,