From 85db1bb47d144d01c06acbb3226af50cce7dc3c2 Mon Sep 17 00:00:00 2001 From: Ales Pergl Date: Fri, 13 Jan 2017 09:52:45 +0100 Subject: [PATCH] Adjustments after upgrading to Chromium 54 --- brightray/brightray.gyp | 7 +++++++ brightray/browser/devtools_file_system_indexer.cc | 4 ++-- brightray/browser/devtools_manager_delegate.cc | 2 +- brightray/browser/inspectable_web_contents.h | 1 + brightray/browser/inspectable_web_contents_impl.cc | 5 +++++ brightray/browser/inspectable_web_contents_impl.h | 1 + .../browser/net/devtools_network_upload_data_stream.cc | 4 ++-- .../browser/net/devtools_network_upload_data_stream.h | 2 +- brightray/browser/permission_manager.cc | 2 ++ brightray/browser/permission_manager.h | 2 ++ brightray/browser/platform_notification_service.cc | 1 + brightray/browser/platform_notification_service.h | 1 + brightray/browser/url_request_context_getter.cc | 8 +++----- 13 files changed, 29 insertions(+), 11 deletions(-) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 87e400140e..593aeadf64 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -185,6 +185,8 @@ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', + # device/gamepad/BUILD.gn: + '$(SDKROOT)/System/Library/Frameworks/GameController.framework', # content_browser.gypi: '-lbsm', # content_common.gypi: @@ -203,6 +205,7 @@ 'libraries': [ # Needed by desktop_capture.lib: '-ld3d11.lib', + '-ldxgi.lib', # Following libs are always linked statically. '<(libchromiumcontent_dir)/base_static.lib', '<(libchromiumcontent_dir)/sandbox.lib', @@ -235,6 +238,7 @@ '<(libchromiumcontent_dir)/fxcrt.lib', '<(libchromiumcontent_dir)/fxedit.lib', '<(libchromiumcontent_dir)/fxge.lib', + '<(libchromiumcontent_dir)/fxjs.lib', '<(libchromiumcontent_dir)/javascript.lib', '<(libchromiumcontent_dir)/pdfwindow.lib', '<(libchromiumcontent_dir)/fx_agg.lib', @@ -256,6 +260,7 @@ # content_common.gypi: '-ld3d9.lib', '-ld3d11.lib', + '-ldxgi.lib', '-ldxva2.lib', '-lstrmiids.lib', '-lmf.lib', @@ -295,6 +300,8 @@ 'secur32.lib', 'urlmon.lib', 'winhttp.lib', + # ui/gfx/BUILD.gn: + 'dwrite.lib', ], 'DelayLoadDLLs': [ 'wtsapi32.dll', diff --git a/brightray/browser/devtools_file_system_indexer.cc b/brightray/browser/devtools_file_system_indexer.cc index f9841441ad..1700ff0eb9 100644 --- a/brightray/browser/devtools_file_system_indexer.cc +++ b/brightray/browser/devtools_file_system_indexer.cc @@ -267,8 +267,8 @@ DevToolsFileSystemIndexer::FileSystemIndexingJob::FileSystemIndexingJob( total_work_callback_(total_work_callback), worked_callback_(worked_callback), done_callback_(done_callback), - current_file_(BrowserThread::GetMessageLoopProxyForThread( - BrowserThread::FILE).get()), + current_file_( + BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()), files_indexed_(0), stopped_(false) { current_trigrams_set_.resize(kTrigramCount); diff --git a/brightray/browser/devtools_manager_delegate.cc b/brightray/browser/devtools_manager_delegate.cc index 368ac3a607..eedc561678 100644 --- a/brightray/browser/devtools_manager_delegate.cc +++ b/brightray/browser/devtools_manager_delegate.cc @@ -18,7 +18,6 @@ #include "components/devtools_discovery/basic_target_descriptor.h" #include "components/devtools_discovery/devtools_discovery_manager.h" #include "components/devtools_http_handler/devtools_http_handler.h" -#include "content/grit/shell_resources.h" #include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/devtools_frontend_host.h" #include "content/public/browser/favicon_status.h" @@ -26,6 +25,7 @@ #include "content/public/common/content_switches.h" #include "content/public/common/url_constants.h" #include "content/public/common/user_agent.h" +#include "content/shell/grit/shell_resources.h" #include "net/base/net_errors.h" #include "net/socket/tcp_server_socket.h" #include "net/socket/stream_socket.h" diff --git a/brightray/browser/inspectable_web_contents.h b/brightray/browser/inspectable_web_contents.h index 86324115ac..a862344e2f 100644 --- a/brightray/browser/inspectable_web_contents.h +++ b/brightray/browser/inspectable_web_contents.h @@ -44,6 +44,7 @@ class InspectableWebContents { const base::Value* arg1 = nullptr, const base::Value* arg2 = nullptr, const base::Value* arg3 = nullptr) = 0; + virtual void InspectElement(int x, int y) = 0; }; } // namespace brightray diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index ea099c58c0..1ab496c6ec 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -249,6 +249,11 @@ content::WebContents* InspectableWebContentsImpl::GetDevToolsWebContents() const return devtools_web_contents_.get(); } +void InspectableWebContentsImpl::InspectElement(int x, int y) { + if (agent_host_.get()) + agent_host_->InspectElement(this, x, y); +} + void InspectableWebContentsImpl::SetDelegate(InspectableWebContentsDelegate* delegate) { delegate_ = delegate; } diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 818481efbf..cab3e2132e 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -60,6 +60,7 @@ class InspectableWebContentsImpl : const base::Value* arg1, const base::Value* arg2, const base::Value* arg3) override; + void InspectElement(int x, int y) override; // Return the last position and size of devtools window. gfx::Rect GetDevToolsBounds() const; diff --git a/brightray/browser/net/devtools_network_upload_data_stream.cc b/brightray/browser/net/devtools_network_upload_data_stream.cc index 31bd8f3819..975afa4d3c 100644 --- a/brightray/browser/net/devtools_network_upload_data_stream.cc +++ b/brightray/browser/net/devtools_network_upload_data_stream.cc @@ -35,11 +35,11 @@ bool DevToolsNetworkUploadDataStream::IsInMemory() const { return false; } -int DevToolsNetworkUploadDataStream::InitInternal() { +int DevToolsNetworkUploadDataStream::InitInternal(const net::BoundNetLog& net_log) { throttled_byte_count_ = 0; int result = upload_data_stream_->Init( base::Bind(&DevToolsNetworkUploadDataStream::StreamInitCallback, - base::Unretained(this))); + base::Unretained(this)), net_log); if (result == net::OK && !is_chunked()) SetSize(upload_data_stream_->size()); return result; diff --git a/brightray/browser/net/devtools_network_upload_data_stream.h b/brightray/browser/net/devtools_network_upload_data_stream.h index e297836f8c..8db7dd80c8 100644 --- a/brightray/browser/net/devtools_network_upload_data_stream.h +++ b/brightray/browser/net/devtools_network_upload_data_stream.h @@ -27,7 +27,7 @@ class DevToolsNetworkUploadDataStream : public net::UploadDataStream { private: // net::UploadDataStream implementation. bool IsInMemory() const override; - int InitInternal() override; + int InitInternal(const net::BoundNetLog& net_log) override; int ReadInternal(net::IOBuffer* buf, int buf_len) override; void ResetInternal() override; diff --git a/brightray/browser/permission_manager.cc b/brightray/browser/permission_manager.cc index 5431035561..f2b0d97d9b 100644 --- a/brightray/browser/permission_manager.cc +++ b/brightray/browser/permission_manager.cc @@ -22,6 +22,7 @@ int PermissionManager::RequestPermission( content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, + bool user_gesture, const base::Callback& callback) { if (permission == content::PermissionType::MIDI_SYSEX) { content::ChildProcessSecurityPolicy::GetInstance()-> @@ -35,6 +36,7 @@ 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; diff --git a/brightray/browser/permission_manager.h b/brightray/browser/permission_manager.h index 3f6001c18b..67168ed2b3 100644 --- a/brightray/browser/permission_manager.h +++ b/brightray/browser/permission_manager.h @@ -21,11 +21,13 @@ class PermissionManager : public content::PermissionManager { content::PermissionType permission, content::RenderFrameHost* render_frame_host, 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; diff --git a/brightray/browser/platform_notification_service.cc b/brightray/browser/platform_notification_service.cc index c9f2e5a1f9..378cd1143f 100644 --- a/brightray/browser/platform_notification_service.cc +++ b/brightray/browser/platform_notification_service.cc @@ -86,6 +86,7 @@ void PlatformNotificationService::DisplayNotification( void PlatformNotificationService::DisplayPersistentNotification( content::BrowserContext* browser_context, int64_t persistent_notification_id, + const GURL& service_worker_origin, const GURL& origin, const content::PlatformNotificationData& notification_data, const content::NotificationResources& notification_resources) { diff --git a/brightray/browser/platform_notification_service.h b/brightray/browser/platform_notification_service.h index 9c47892937..1e17a6fbae 100644 --- a/brightray/browser/platform_notification_service.h +++ b/brightray/browser/platform_notification_service.h @@ -37,6 +37,7 @@ class PlatformNotificationService void DisplayPersistentNotification( content::BrowserContext* browser_context, int64_t persistent_notification_id, + const GURL& service_worker_origin, const GURL& origin, const content::PlatformNotificationData& notification_data, const content::NotificationResources& notification_resources) override; diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index ad2838a8ef..9fc8a721d7 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -96,7 +96,7 @@ URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory(const base::Fil net::CACHE_BACKEND_DEFAULT, cache_path, 0, - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); + BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE)); } std::unique_ptr @@ -291,10 +291,8 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { network_session_params.ignore_certificate_errors = false; // --disable-http2 - if (command_line.HasSwitch(switches::kDisableHttp2)) { - network_session_params.enable_spdy31 = false; + if (command_line.HasSwitch(switches::kDisableHttp2)) network_session_params.enable_http2 = false; - } // --ignore-certificate-errors if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) @@ -357,7 +355,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { } scoped_refptr URLRequestContextGetter::GetNetworkTaskRunner() const { - return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); + return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); } } // namespace brightray