Merge pull request #201 from atom/chrome49-win32

Updates to Chrome 49 on Win32
This commit is contained in:
Cheng Zhao 2016-03-08 17:49:02 +09:00
commit d49e240fd4
15 changed files with 92 additions and 42 deletions

View file

@ -55,7 +55,7 @@ class TCPServerSocketFactory
} }
std::string address_; std::string address_;
uint16 port_; uint16_t port_;
DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory); DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
}; };

View file

@ -573,7 +573,7 @@ void InspectableWebContentsImpl::AgentHostClosed(
content::DevToolsAgentHost* agent_host, bool replaced) { content::DevToolsAgentHost* agent_host, bool replaced) {
} }
void InspectableWebContentsImpl::AboutToNavigateRenderFrame( void InspectableWebContentsImpl::RenderFrameHostChanged(
content::RenderFrameHost* old_host, content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) { content::RenderFrameHost* new_host) {
if (new_host->GetParent()) if (new_host->GetParent())
@ -603,8 +603,9 @@ bool InspectableWebContentsImpl::AddMessageToConsole(
bool InspectableWebContentsImpl::ShouldCreateWebContents( bool InspectableWebContentsImpl::ShouldCreateWebContents(
content::WebContents* web_contents, content::WebContents* web_contents,
int route_id, int32_t route_id,
int main_frame_route_id, int32_t main_frame_route_id,
int32_t main_frame_widget_route_id,
WindowContainerType window_container_type, WindowContainerType window_container_type,
const std::string& frame_name, const std::string& frame_name,
const GURL& target_url, const GURL& target_url,

View file

@ -33,7 +33,6 @@ class InspectableWebContentsView;
class InspectableWebContentsImpl : class InspectableWebContentsImpl :
public InspectableWebContents, public InspectableWebContents,
public content::DevToolsFrontendHost::Delegate,
public content::DevToolsAgentHostClient, public content::DevToolsAgentHostClient,
public content::WebContentsObserver, public content::WebContentsObserver,
public content::WebContentsDelegate, public content::WebContentsDelegate,
@ -117,8 +116,7 @@ class InspectableWebContentsImpl :
void ClearPreferences() override; void ClearPreferences() override;
// content::DevToolsFrontendHostDelegate: // content::DevToolsFrontendHostDelegate:
void HandleMessageFromDevToolsFrontend(const std::string& message) override; void HandleMessageFromDevToolsFrontend(const std::string& message);
void HandleMessageFromDevToolsFrontendToBackend(const std::string& message) override;
// content::DevToolsAgentHostClient: // content::DevToolsAgentHostClient:
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host,
@ -127,7 +125,7 @@ class InspectableWebContentsImpl :
bool replaced) override; bool replaced) override;
// content::WebContentsObserver: // content::WebContentsObserver:
void AboutToNavigateRenderFrame(content::RenderFrameHost* old_host, void RenderFrameHostChanged(content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) override; content::RenderFrameHost* new_host) override;
void WebContentsDestroyed() override; void WebContentsDestroyed() override;
void OnWebContentsFocused() override; void OnWebContentsFocused() override;
@ -140,8 +138,9 @@ class InspectableWebContentsImpl :
const base::string16& source_id) override; const base::string16& source_id) override;
bool ShouldCreateWebContents( bool ShouldCreateWebContents(
content::WebContents* web_contents, content::WebContents* web_contents,
int route_id, int32_t route_id,
int main_frame_route_id, int32_t main_frame_route_id,
int32_t main_frame_widget_route_id,
WindowContainerType window_container_type, WindowContainerType window_container_type,
const std::string& frame_name, const std::string& frame_name,
const GURL& target_url, const GURL& target_url,

View file

@ -33,10 +33,10 @@ MediaStreamDevicesController::MediaStreamDevicesController(
// and microphone to avoid popping two infobars. // and microphone to avoid popping two infobars.
microphone_requested_( microphone_requested_(
request.audio_type == content::MEDIA_DEVICE_AUDIO_CAPTURE || 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_( webcam_requested_(
request.video_type == content::MEDIA_DEVICE_VIDEO_CAPTURE || 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() { MediaStreamDevicesController::~MediaStreamDevicesController() {
@ -72,7 +72,7 @@ void MediaStreamDevicesController::Accept() {
content::MediaStreamDevices devices; content::MediaStreamDevices devices;
if (microphone_requested_ || webcam_requested_) { if (microphone_requested_ || webcam_requested_) {
switch (request_.request_type) { switch (request_.request_type) {
case content::MEDIA_OPEN_DEVICE: { case content::MEDIA_OPEN_DEVICE_PEPPER_ONLY: {
const content::MediaStreamDevice* device = NULL; const content::MediaStreamDevice* device = NULL;
// For open device request pick the desired device or fall back to the // For open device request pick the desired device or fall back to the
// first available of the given type. // first available of the given type.

View file

@ -207,7 +207,7 @@ void DevToolsNetworkInterceptor::ArmTimer(base::TimeTicks now) {
base::TimeTicks desired_time = base::TimeTicks desired_time =
offset_ + tick_length_ * (last_tick_ + min_ticks_left); offset_ + tick_length_ * (last_tick_ + min_ticks_left);
int64_t min_baseline = std::numeric_limits<int64>::max(); int64_t min_baseline = std::numeric_limits<int64_t>::max();
for (size_t i = 0; i < suspend_count; ++i) { for (size_t i = 0; i < suspend_count; ++i) {
if (suspended_transactions_[i].second < min_baseline) if (suspended_transactions_[i].second < min_baseline)
min_baseline = suspended_transactions_[i].second; min_baseline = suspended_transactions_[i].second;

View file

@ -106,10 +106,11 @@ int DevToolsNetworkTransaction::RestartIgnoringLastError(
int DevToolsNetworkTransaction::RestartWithCertificate( int DevToolsNetworkTransaction::RestartWithCertificate(
net::X509Certificate* client_certificate, net::X509Certificate* client_certificate,
net::SSLPrivateKey* client_private_key,
const net::CompletionCallback& callback) { const net::CompletionCallback& callback) {
if (failed_) if (failed_)
return net::ERR_INTERNET_DISCONNECTED; 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); return SetupCallback(callback, rv, RESTART_WITH_CERTIFICATE);
} }
@ -185,6 +186,11 @@ bool DevToolsNetworkTransaction::GetRemoteEndpoint(
return transaction_->GetRemoteEndpoint(endpoint); return transaction_->GetRemoteEndpoint(endpoint);
} }
void DevToolsNetworkTransaction::PopulateNetErrorDetails(
net::NetErrorDetails* details) const {
return transaction_->PopulateNetErrorDetails(details);
}
void DevToolsNetworkTransaction::SetPriority(net::RequestPriority priority) { void DevToolsNetworkTransaction::SetPriority(net::RequestPriority priority) {
transaction_->SetPriority(priority); transaction_->SetPriority(priority);
} }

View file

@ -46,6 +46,7 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
int RestartIgnoringLastError( int RestartIgnoringLastError(
const net::CompletionCallback& callback) override; const net::CompletionCallback& callback) override;
int RestartWithCertificate(net::X509Certificate* client_cert, int RestartWithCertificate(net::X509Certificate* client_cert,
net::SSLPrivateKey* client_private_key,
const net::CompletionCallback& callback) override; const net::CompletionCallback& callback) override;
int RestartWithAuth(const net::AuthCredentials& credentials, int RestartWithAuth(const net::AuthCredentials& credentials,
const net::CompletionCallback& callback) override; const net::CompletionCallback& callback) override;
@ -65,6 +66,7 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
void SetQuicServerInfo(net::QuicServerInfo* quic_server_info) override; void SetQuicServerInfo(net::QuicServerInfo* quic_server_info) override;
bool GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override; bool GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override;
bool GetRemoteEndpoint(net::IPEndPoint* endpoint) const override; bool GetRemoteEndpoint(net::IPEndPoint* endpoint) const override;
void PopulateNetErrorDetails(net::NetErrorDetails* details) const override;
void SetPriority(net::RequestPriority priority) override; void SetPriority(net::RequestPriority priority) override;
void SetWebSocketHandshakeStreamCreateHelper( void SetWebSocketHandshakeStreamCreateHelper(
net::WebSocketHandshakeStreamBase::CreateHelper* create_helper) override; net::WebSocketHandshakeStreamBase::CreateHelper* create_helper) override;

View file

@ -92,14 +92,11 @@ void NetworkDelegate::OnBeforeRedirect(net::URLRequest* request,
void NetworkDelegate::OnResponseStarted(net::URLRequest* request) { void NetworkDelegate::OnResponseStarted(net::URLRequest* request) {
} }
void NetworkDelegate::OnURLRequestJobOrphaned(net::URLRequest* request) { void NetworkDelegate::OnNetworkBytesReceived(net::URLRequest* request,
}
void NetworkDelegate::OnNetworkBytesReceived(const net::URLRequest& request,
int64_t bytes_read) { int64_t bytes_read) {
} }
void NetworkDelegate::OnNetworkBytesSent(const net::URLRequest& request, void NetworkDelegate::OnNetworkBytesSent(net::URLRequest* request,
int64_t bytes_sent) { int64_t bytes_sent) {
} }
@ -143,7 +140,11 @@ bool NetworkDelegate::OnCanEnablePrivacyMode(
return false; return false;
} }
bool NetworkDelegate::OnFirstPartyOnlyCookieExperimentEnabled() const { bool OnAreStrictSecureCookiesEnabled() {
return true;
}
bool OnAreExperimentalCookieFeaturesEnabled() {
return true; return true;
} }

View file

@ -43,10 +43,9 @@ class NetworkDelegate : public net::NetworkDelegate {
void OnBeforeRedirect(net::URLRequest* request, void OnBeforeRedirect(net::URLRequest* request,
const GURL& new_location) override; const GURL& new_location) override;
void OnResponseStarted(net::URLRequest* request) override; void OnResponseStarted(net::URLRequest* request) override;
void OnURLRequestJobOrphaned(net::URLRequest* request) override; void OnNetworkBytesReceived(net::URLRequest* request,
void OnNetworkBytesReceived(const net::URLRequest& request,
int64_t bytes_read) override; int64_t bytes_read) override;
void OnNetworkBytesSent(const net::URLRequest& request, void OnNetworkBytesSent(net::URLRequest* request,
int64_t bytes_sent) override; int64_t bytes_sent) override;
void OnCompleted(net::URLRequest* request, bool started) override; void OnCompleted(net::URLRequest* request, bool started) override;
void OnURLRequestDestroyed(net::URLRequest* request) override; void OnURLRequestDestroyed(net::URLRequest* request) override;
@ -67,7 +66,9 @@ class NetworkDelegate : public net::NetworkDelegate {
bool OnCanEnablePrivacyMode( bool OnCanEnablePrivacyMode(
const GURL& url, const GURL& url,
const GURL& first_party_for_cookies) const override; const GURL& first_party_for_cookies) const override;
bool OnFirstPartyOnlyCookieExperimentEnabled() const override;
virtual bool OnAreStrictSecureCookiesEnabled() const override;
virtual bool OnAreExperimentalCookieFeaturesEnabled() const override;
bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
const net::URLRequest& request, const net::URLRequest& request,
const GURL& target_url, const GURL& target_url,

View file

@ -32,6 +32,27 @@ int PermissionManager::RequestPermission(
return kNoPendingOperation; return kNoPendingOperation;
} }
int PermissionManager::RequestPermissions(
const std::vector<content::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(
const std::vector<content::PermissionStatus>&)>& callback) {
std::vector<content::PermissionStatus> 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) { void PermissionManager::CancelPermissionRequest(int request_id) {
} }

View file

@ -23,6 +23,13 @@ class PermissionManager : public content::PermissionManager {
const GURL& requesting_origin, const GURL& requesting_origin,
bool user_gesture, bool user_gesture,
const base::Callback<void(content::PermissionStatus)>& callback) override; const base::Callback<void(content::PermissionStatus)>& callback) override;
int RequestPermissions(
const std::vector<content::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(
const std::vector<content::PermissionStatus>&)>& callback) override;
void CancelPermissionRequest(int request_id) override; void CancelPermissionRequest(int request_id) override;
void ResetPermission(content::PermissionType permission, void ResetPermission(content::PermissionType permission,
const GURL& requesting_origin, const GURL& requesting_origin,

View file

@ -104,8 +104,16 @@ bool URLRequestContextGetter::DelegateURLSecurityManager::CanDelegate
return delegate_->CanDelegateURLSecurity(auth_origin); return delegate_->CanDelegateURLSecurity(auth_origin);
} }
void URLRequestContextGetter::DelegateURLSecurityManager::SetDefaultWhitelist(
scoped_ptr<net::HttpAuthFilter> whitelist_default) {
}
void URLRequestContextGetter::DelegateURLSecurityManager::SetDelegateWhitelist(
scoped_ptr<net::HttpAuthFilter> whitelist_delegate) {
}
URLRequestContextGetter::Delegate::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() { std::string URLRequestContextGetter::Delegate::GetUserAgent() {
return base::EmptyString(); return base::EmptyString();

View file

@ -59,6 +59,10 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
bool CanUseDefaultCredentials(const GURL& auth_origin) const override; bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
bool CanDelegate(const GURL& auth_origin) const override; bool CanDelegate(const GURL& auth_origin) const override;
void SetDefaultWhitelist(
scoped_ptr<net::HttpAuthFilter> whitelist_default) override;
void SetDelegateWhitelist(
scoped_ptr<net::HttpAuthFilter> whitelist_delegate) override;
private: private:
URLRequestContextGetter::Delegate* delegate_; URLRequestContextGetter::Delegate* delegate_;

View file

@ -330,7 +330,7 @@ bool WindowsToastNotification::GetTextNodeList(
ScopedHString* tag, ScopedHString* tag,
IXmlDocument* doc, IXmlDocument* doc,
IXmlNodeList** node_list, IXmlNodeList** node_list,
UINT32 req_length) { uint32_t req_length) {
tag->Reset(L"text"); tag->Reset(L"text");
if (!tag->success()) if (!tag->success())
return false; return false;
@ -338,7 +338,7 @@ bool WindowsToastNotification::GetTextNodeList(
if (FAILED(doc->GetElementsByTagName(*tag, node_list))) if (FAILED(doc->GetElementsByTagName(*tag, node_list)))
return false; return false;
UINT32 node_length; uint32_t node_length;
if (FAILED((*node_list)->get_Length(&node_length))) if (FAILED((*node_list)->get_Length(&node_length)))
return false; return false;

View file

@ -70,7 +70,7 @@ class WindowsToastNotification : public Notification {
bool GetTextNodeList(ScopedHString* tag, bool GetTextNodeList(ScopedHString* tag,
ABI::Windows::Data::Xml::Dom::IXmlDocument* doc, ABI::Windows::Data::Xml::Dom::IXmlDocument* doc,
ABI::Windows::Data::Xml::Dom::IXmlNodeList** nodeList, ABI::Windows::Data::Xml::Dom::IXmlNodeList** nodeList,
UINT32 reqLength); uint32_t reqLength);
bool AppendTextToXml(ABI::Windows::Data::Xml::Dom::IXmlDocument* doc, bool AppendTextToXml(ABI::Windows::Data::Xml::Dom::IXmlDocument* doc,
ABI::Windows::Data::Xml::Dom::IXmlNode* node, ABI::Windows::Data::Xml::Dom::IXmlNode* node,
const std::wstring& text); const std::wstring& text);