diff --git a/atom/app/atom_content_client.h b/atom/app/atom_content_client.h index 890d868ff05..732ac358780 100644 --- a/atom/app/atom_content_client.h +++ b/atom/app/atom_content_client.h @@ -19,10 +19,10 @@ class AtomContentClient : public brightray::ContentClient { protected: // content::ContentClient: - virtual std::string GetProduct() const OVERRIDE; - virtual void AddAdditionalSchemes( + std::string GetProduct() const override; + void AddAdditionalSchemes( std::vector* standard_schemes, - std::vector* savable_schemes) OVERRIDE; + std::vector* savable_schemes) override; private: DISALLOW_COPY_AND_ASSIGN(AtomContentClient); diff --git a/atom/app/atom_main.cc b/atom/app/atom_main.cc index 8c7837ed327..28771d4a8bc 100644 --- a/atom/app/atom_main.cc +++ b/atom/app/atom_main.cc @@ -13,11 +13,14 @@ #include #include +#include +#include #include #include "atom/app/atom_main_delegate.h" #include "atom/common/crash_reporter/win/crash_service_main.h" #include "base/environment.h" +#include "base/win/windows_version.h" #include "content/public/app/startup_helper_win.h" #include "sandbox/win/src/sandbox_types.h" #include "ui/gfx/win/dpi.h" @@ -37,6 +40,48 @@ int Start(int argc, char *argv[]); #if defined(OS_WIN) +namespace { + +// Win8.1 supports monitor-specific DPI scaling. +bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) { + typedef HRESULT(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS); + SetProcessDpiAwarenessPtr set_process_dpi_awareness_func = + reinterpret_cast( + GetProcAddress(GetModuleHandleA("user32.dll"), + "SetProcessDpiAwarenessInternal")); + if (set_process_dpi_awareness_func) { + HRESULT hr = set_process_dpi_awareness_func(value); + if (SUCCEEDED(hr)) { + VLOG(1) << "SetProcessDpiAwareness succeeded."; + return true; + } else if (hr == E_ACCESSDENIED) { + LOG(ERROR) << "Access denied error from SetProcessDpiAwareness. " + "Function called twice, or manifest was used."; + } + } + return false; +} + +// This function works for Windows Vista through Win8. Win8.1 must use +// SetProcessDpiAwareness[Wrapper]. +BOOL SetProcessDPIAwareWrapper() { + typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID); + SetProcessDPIAwarePtr set_process_dpi_aware_func = + reinterpret_cast( + GetProcAddress(GetModuleHandleA("user32.dll"), + "SetProcessDPIAware")); + return set_process_dpi_aware_func && + set_process_dpi_aware_func(); +} + +void EnableHighDPISupport() { + if (!SetProcessDpiAwarenessWrapper(PROCESS_SYSTEM_DPI_AWARE)) { + SetProcessDPIAwareWrapper(); + } +} + +} // namespace + int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) { int argc = 0; wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); @@ -103,8 +148,11 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) { content::InitializeSandboxInfo(&sandbox_info); atom::AtomMainDelegate delegate; - // Now chrome relies on a regkey to enable high dpi support. - gfx::EnableHighDPISupport(); + // We don't want to set DPI awareness on pre-Win7 because we don't support + // DirectWrite there. GDI fonts are kerned very badly, so better to leave + // DPI-unaware and at effective 1.0. See also ShouldUseDirectWrite(). + if (base::win::GetVersion() >= base::win::VERSION_WIN7) + EnableHighDPISupport(); content::ContentMainParams params(&delegate); params.instance = instance; diff --git a/atom/browser/api/atom_api_auto_updater.h b/atom/browser/api/atom_api_auto_updater.h index cf78f220e70..50c3989703a 100644 --- a/atom/browser/api/atom_api_auto_updater.h +++ b/atom/browser/api/atom_api_auto_updater.h @@ -26,20 +26,20 @@ class AutoUpdater : public mate::EventEmitter, virtual ~AutoUpdater(); // AutoUpdaterDelegate implementations. - virtual void OnError(const std::string& error) OVERRIDE; - virtual void OnCheckingForUpdate() OVERRIDE; - virtual void OnUpdateAvailable() OVERRIDE; - virtual void OnUpdateNotAvailable() OVERRIDE; - virtual void OnUpdateDownloaded( + void OnError(const std::string& error) override; + void OnCheckingForUpdate() override; + void OnUpdateAvailable() override; + void OnUpdateNotAvailable() override; + void OnUpdateDownloaded( const std::string& release_notes, const std::string& release_name, const base::Time& release_date, const std::string& update_url, - const base::Closure& quit_and_install) OVERRIDE; + const base::Closure& quit_and_install) override; // mate::Wrappable implementations: - virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder( - v8::Isolate* isolate); + mate::ObjectTemplateBuilder GetObjectTemplateBuilder( + v8::Isolate* isolate) override; private: void QuitAndInstall(); diff --git a/atom/browser/api/atom_api_global_shortcut.h b/atom/browser/api/atom_api_global_shortcut.h index 2f010ed7fbf..15cd3d4e0ed 100644 --- a/atom/browser/api/atom_api_global_shortcut.h +++ b/atom/browser/api/atom_api_global_shortcut.h @@ -28,8 +28,8 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer, virtual ~GlobalShortcut(); // mate::Wrappable implementations: - virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder( - v8::Isolate* isolate) OVERRIDE; + mate::ObjectTemplateBuilder GetObjectTemplateBuilder( + v8::Isolate* isolate) override; private: typedef std::map AcceleratorCallbackMap; @@ -41,7 +41,7 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer, void UnregisterAll(); // GlobalShortcutListener::Observer implementation. - virtual void OnKeyPressed(const ui::Accelerator& accelerator) OVERRIDE; + void OnKeyPressed(const ui::Accelerator& accelerator) override; AcceleratorCallbackMap accelerator_callback_map_; diff --git a/atom/browser/api/atom_api_menu_mac.h b/atom/browser/api/atom_api_menu_mac.h index f055d92cde3..5a086776a63 100644 --- a/atom/browser/api/atom_api_menu_mac.h +++ b/atom/browser/api/atom_api_menu_mac.h @@ -19,8 +19,8 @@ class MenuMac : public Menu { protected: MenuMac(); - virtual void Popup(Window* window) OVERRIDE; - virtual void PopupAt(Window* window, int x, int y) OVERRIDE; + void Popup(Window* window) override; + void PopupAt(Window* window, int x, int y) override; base::scoped_nsobject menu_controller_; diff --git a/atom/browser/api/atom_api_menu_views.h b/atom/browser/api/atom_api_menu_views.h index 47df508ff98..de0d2e8b014 100644 --- a/atom/browser/api/atom_api_menu_views.h +++ b/atom/browser/api/atom_api_menu_views.h @@ -17,8 +17,8 @@ class MenuViews : public Menu { MenuViews(); protected: - virtual void Popup(Window* window) OVERRIDE; - virtual void PopupAt(Window* window, int x, int y) OVERRIDE; + void Popup(Window* window) override; + void PopupAt(Window* window, int x, int y) override; private: void PopupAtPoint(Window* window, const gfx::Point& point); diff --git a/atom/browser/api/atom_api_power_monitor.h b/atom/browser/api/atom_api_power_monitor.h index 9abb17d0145..2fccc7fd311 100644 --- a/atom/browser/api/atom_api_power_monitor.h +++ b/atom/browser/api/atom_api_power_monitor.h @@ -24,9 +24,9 @@ class PowerMonitor : public mate::EventEmitter, virtual ~PowerMonitor(); // base::PowerObserver implementations: - virtual void OnPowerStateChange(bool on_battery_power) OVERRIDE; - virtual void OnSuspend() OVERRIDE; - virtual void OnResume() OVERRIDE; + void OnPowerStateChange(bool on_battery_power) override; + void OnSuspend() override; + void OnResume() override; private: DISALLOW_COPY_AND_ASSIGN(PowerMonitor); diff --git a/atom/browser/api/atom_api_protocol.cc b/atom/browser/api/atom_api_protocol.cc index 446a4040467..0d0adb3eb01 100644 --- a/atom/browser/api/atom_api_protocol.cc +++ b/atom/browser/api/atom_api_protocol.cc @@ -53,7 +53,7 @@ class CustomProtocolRequestJob : public AdapterRequestJob { } // AdapterRequestJob: - virtual void GetJobTypeInUI() OVERRIDE { + void GetJobTypeInUI() override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); v8::Isolate* isolate = v8::Isolate::GetCurrent(); @@ -128,9 +128,9 @@ class CustomProtocolHandler : public ProtocolHandler { : registry_(registry), protocol_handler_(protocol_handler) { } - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, - net::NetworkDelegate* network_delegate) const OVERRIDE { + net::NetworkDelegate* network_delegate) const override { return new CustomProtocolRequestJob(registry_, protocol_handler_.get(), request, network_delegate); } diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 1b5112ffbdd..4d11322950f 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -247,14 +247,14 @@ void WebContents::RenderViewReady() { // WebContents::GetRenderWidgetHostView will return the RWHV of an // interstitial page if one is showing at this time. We only want opacity // to apply to web pages. - web_contents()->GetRenderViewHost()->GetView()-> - SetBackgroundOpaque(guest_opaque_); - - content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); - if (auto_size_enabled_) { - rvh->EnableAutoResize(min_auto_size_, max_auto_size_); + if (guest_opaque_) { + web_contents() + ->GetRenderViewHost() + ->GetView() + ->SetBackgroundColorToDefault(); } else { - rvh->DisableAutoResize(element_size_); + web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor( + SK_ColorTRANSPARENT); } } @@ -498,7 +498,15 @@ void WebContents::SetAllowTransparency(bool allow) { if (!web_contents()->GetRenderViewHost()->GetView()) return; - web_contents()->GetRenderViewHost()->GetView()->SetBackgroundOpaque(!allow); + if (guest_opaque_) { + web_contents() + ->GetRenderViewHost() + ->GetView() + ->SetBackgroundColorToDefault(); + } else { + web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor( + SK_ColorTRANSPARENT); + } } mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder( diff --git a/atom/browser/api/event.h b/atom/browser/api/event.h index b72f4761b6b..5cdc08324b7 100644 --- a/atom/browser/api/event.h +++ b/atom/browser/api/event.h @@ -34,10 +34,10 @@ class Event : public Wrappable, virtual ~Event(); // Wrappable implementations: - virtual ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate* isolate); + ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate* isolate) override; // content::WebContentsObserver implementations: - virtual void WebContentsDestroyed() OVERRIDE; + void WebContentsDestroyed() override; private: // Replyer for the synchronous messages. diff --git a/atom/browser/atom_access_token_store.h b/atom/browser/atom_access_token_store.h index fe810abb551..f2b734a2069 100644 --- a/atom/browser/atom_access_token_store.h +++ b/atom/browser/atom_access_token_store.h @@ -17,10 +17,10 @@ class AtomAccessTokenStore : public content::AccessTokenStore { virtual ~AtomAccessTokenStore(); // content::AccessTokenStore: - virtual void LoadAccessTokens( - const LoadAccessTokensCallbackType& callback) OVERRIDE; - virtual void SaveAccessToken(const GURL& server_url, - const base::string16& access_token) OVERRIDE; + void LoadAccessTokens( + const LoadAccessTokensCallbackType& callback) override; + void SaveAccessToken(const GURL& server_url, + const base::string16& access_token) override; private: DISALLOW_COPY_AND_ASSIGN(AtomAccessTokenStore); diff --git a/atom/browser/atom_browser_context.cc b/atom/browser/atom_browser_context.cc index f81894a5d39..7e340867ab2 100644 --- a/atom/browser/atom_browser_context.cc +++ b/atom/browser/atom_browser_context.cc @@ -68,8 +68,7 @@ net::URLRequestJobFactory* AtomBrowserContext::CreateURLRequestJobFactory( base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); // Set up interceptors in the reverse order. - scoped_ptr top_job_factory = - job_factory.PassAs(); + scoped_ptr top_job_factory = job_factory.Pass(); content::URLRequestInterceptorScopedVector::reverse_iterator it; for (it = interceptors->rbegin(); it != interceptors->rend(); ++it) top_job_factory.reset(new net::URLRequestInterceptingJobFactory( diff --git a/atom/browser/atom_browser_main_parts.h b/atom/browser/atom_browser_main_parts.h index 24f55b5495a..a825862ff9b 100644 --- a/atom/browser/atom_browser_main_parts.h +++ b/atom/browser/atom_browser_main_parts.h @@ -27,14 +27,14 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts { protected: // Implementations of brightray::BrowserMainParts. - virtual brightray::BrowserContext* CreateBrowserContext() OVERRIDE; + brightray::BrowserContext* CreateBrowserContext() override; // Implementations of content::BrowserMainParts. - virtual void PostEarlyInitialization() OVERRIDE; - virtual void PreMainMessageLoopRun() OVERRIDE; + void PostEarlyInitialization() override; + void PreMainMessageLoopRun() override; #if defined(OS_MACOSX) - virtual void PreMainMessageLoopStart() OVERRIDE; - virtual void PostDestroyThreads() OVERRIDE; + void PreMainMessageLoopStart() override; + void PostDestroyThreads() override; #endif private: diff --git a/atom/browser/atom_javascript_dialog_manager.h b/atom/browser/atom_javascript_dialog_manager.h index 05095a12c44..3712b81a49f 100644 --- a/atom/browser/atom_javascript_dialog_manager.h +++ b/atom/browser/atom_javascript_dialog_manager.h @@ -14,7 +14,7 @@ namespace atom { class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager { public: // content::JavaScriptDialogManager implementations. - virtual void RunJavaScriptDialog( + void RunJavaScriptDialog( content::WebContents* web_contents, const GURL& origin_url, const std::string& accept_lang, @@ -22,16 +22,15 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager { const base::string16& message_text, const base::string16& default_prompt_text, const DialogClosedCallback& callback, - bool* did_suppress_message) OVERRIDE; - virtual void RunBeforeUnloadDialog( + bool* did_suppress_message) override; + void RunBeforeUnloadDialog( content::WebContents* web_contents, const base::string16& message_text, bool is_reload, - const DialogClosedCallback& callback) OVERRIDE; - virtual void CancelActiveAndPendingDialogs( - content::WebContents* web_contents) OVERRIDE {} - virtual void WebContentsDestroyed( - content::WebContents* web_contents) OVERRIDE {} + const DialogClosedCallback& callback) override; + void CancelActiveAndPendingDialogs( + content::WebContents* web_contents) override {} + void WebContentsDestroyed(content::WebContents* web_contents) override {} }; } // namespace atom diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index f0261f27453..603dda750dd 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -21,7 +21,7 @@ #include "atom/common/native_mate_converters/file_path_converter.h" #include "atom/common/options_switches.h" #include "base/command_line.h" -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/json/json_writer.h" #include "base/prefs/pref_service.h" #include "base/message_loop/message_loop.h" @@ -57,6 +57,10 @@ #include "ui/gfx/screen.h" #include "ui/gfx/size.h" +#if defined(OS_WIN) +#include "ui/gfx/switches.h" +#endif + using content::NavigationEntry; using content::RenderWidgetHostView; using content::RenderWidgetHost; diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 9178b43eac6..09fd351f427 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -129,7 +129,7 @@ class NativeWindowClientView : public views::ClientView { } virtual ~NativeWindowClientView() {} - virtual bool CanClose() OVERRIDE { + bool CanClose() override { static_cast(contents_view())->CloseWebContents(); return false; } diff --git a/atom/browser/net/adapter_request_job.h b/atom/browser/net/adapter_request_job.h index 98a32b93b70..557b8d61e90 100644 --- a/atom/browser/net/adapter_request_job.h +++ b/atom/browser/net/adapter_request_job.h @@ -28,16 +28,16 @@ class AdapterRequestJob : public net::URLRequestJob { public: // net::URLRequestJob: - virtual void Start() OVERRIDE; - virtual void Kill() OVERRIDE; - virtual bool ReadRawData(net::IOBuffer* buf, - int buf_size, - int *bytes_read) OVERRIDE; - virtual bool IsRedirectResponse(GURL* location, - int* http_status_code) OVERRIDE; - virtual net::Filter* SetupFilter() const OVERRIDE; - virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; - virtual bool GetCharset(std::string* charset) OVERRIDE; + void Start() override; + void Kill() override; + bool ReadRawData(net::IOBuffer* buf, + int buf_size, + int *bytes_read) override; + bool IsRedirectResponse(GURL* location, + int* http_status_code) override; + net::Filter* SetupFilter() const override; + bool GetMimeType(std::string* mime_type) const override; + bool GetCharset(std::string* charset) override; base::WeakPtr GetWeakPtr(); diff --git a/atom/browser/net/asar/asar_protocol_handler.h b/atom/browser/net/asar/asar_protocol_handler.h index e0a66ca4354..cbfc95b8f77 100644 --- a/atom/browser/net/asar/asar_protocol_handler.h +++ b/atom/browser/net/asar/asar_protocol_handler.h @@ -27,10 +27,10 @@ class AsarProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { Archive* GetOrCreateAsarArchive(const base::FilePath& path) const; // net::URLRequestJobFactory::ProtocolHandler: - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, - net::NetworkDelegate* network_delegate) const OVERRIDE; - virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE; + net::NetworkDelegate* network_delegate) const override; + bool IsSafeRedirectTarget(const GURL& location) const override; private: const scoped_refptr file_task_runner_; diff --git a/atom/browser/net/asar/url_request_asar_job.h b/atom/browser/net/asar/url_request_asar_job.h index 63f014da817..899976471f0 100644 --- a/atom/browser/net/asar/url_request_asar_job.h +++ b/atom/browser/net/asar/url_request_asar_job.h @@ -32,12 +32,12 @@ class URLRequestAsarJob : public net::URLRequestJob { const scoped_refptr& file_task_runner); // net::URLRequestJob: - virtual void Start() OVERRIDE; - virtual void Kill() OVERRIDE; - virtual bool ReadRawData(net::IOBuffer* buf, - int buf_size, - int* bytes_read) OVERRIDE; - virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; + void Start() override; + void Kill() override; + bool ReadRawData(net::IOBuffer* buf, + int buf_size, + int* bytes_read) override; + bool GetMimeType(std::string* mime_type) const override; protected: virtual ~URLRequestAsarJob(); diff --git a/atom/browser/net/atom_url_request_job_factory.cc b/atom/browser/net/atom_url_request_job_factory.cc index bca05eb216e..ed1fb97e2c1 100644 --- a/atom/browser/net/atom_url_request_job_factory.cc +++ b/atom/browser/net/atom_url_request_job_factory.cc @@ -50,7 +50,7 @@ ProtocolHandler* AtomURLRequestJobFactory::ReplaceProtocol( base::AutoLock locked(lock_); if (!ContainsKey(protocol_handler_map_, scheme)) - return NULL; + return nullptr; ProtocolHandler* original_protocol_handler = protocol_handler_map_[scheme]; protocol_handler_map_[scheme] = protocol_handler; return original_protocol_handler; @@ -63,7 +63,7 @@ ProtocolHandler* AtomURLRequestJobFactory::GetProtocolHandler( base::AutoLock locked(lock_); ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme); if (it == protocol_handler_map_.end()) - return NULL; + return nullptr; return it->second; } @@ -82,10 +82,23 @@ net::URLRequestJob* AtomURLRequestJobFactory::MaybeCreateJobWithProtocolHandler( base::AutoLock locked(lock_); ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme); if (it == protocol_handler_map_.end()) - return NULL; + return nullptr; return it->second->MaybeCreateJob(request, network_delegate); } +net::URLRequestJob* AtomURLRequestJobFactory::MaybeInterceptRedirect( + net::URLRequest* request, + net::NetworkDelegate* network_delegate, + const GURL& location) const { + return nullptr; +} + +net::URLRequestJob* AtomURLRequestJobFactory::MaybeInterceptResponse( + net::URLRequest* request, + net::NetworkDelegate* network_delegate) const { + return nullptr; +} + bool AtomURLRequestJobFactory::IsHandledProtocol( const std::string& scheme) const { DCHECK(CalledOnValidThread()); diff --git a/atom/browser/net/atom_url_request_job_factory.h b/atom/browser/net/atom_url_request_job_factory.h index 9150f2f578d..a083e51483c 100644 --- a/atom/browser/net/atom_url_request_job_factory.h +++ b/atom/browser/net/atom_url_request_job_factory.h @@ -40,13 +40,20 @@ class AtomURLRequestJobFactory : public net::URLRequestJobFactory { bool HasProtocolHandler(const std::string& scheme) const; // URLRequestJobFactory implementation - virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( + net::URLRequestJob* MaybeCreateJobWithProtocolHandler( const std::string& scheme, net::URLRequest* request, - net::NetworkDelegate* network_delegate) const OVERRIDE; - virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE; - virtual bool IsHandledURL(const GURL& url) const OVERRIDE; - virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE; + net::NetworkDelegate* network_delegate) const override; + net::URLRequestJob* MaybeInterceptRedirect( + net::URLRequest* request, + net::NetworkDelegate* network_delegate, + const GURL& location) const override; + net::URLRequestJob* MaybeInterceptResponse( + net::URLRequest* request, + net::NetworkDelegate* network_delegate) const override; + bool IsHandledProtocol(const std::string& scheme) const override; + bool IsHandledURL(const GURL& url) const override; + bool IsSafeRedirectTarget(const GURL& location) const override; private: typedef std::map ProtocolHandlerMap; diff --git a/atom/browser/net/url_request_string_job.h b/atom/browser/net/url_request_string_job.h index c2cce672485..7ad250466ab 100644 --- a/atom/browser/net/url_request_string_job.h +++ b/atom/browser/net/url_request_string_job.h @@ -20,10 +20,10 @@ class URLRequestStringJob : public net::URLRequestSimpleJob { const std::string& data); // URLRequestSimpleJob: - virtual int GetData(std::string* mime_type, - std::string* charset, - std::string* data, - const net::CompletionCallback& callback) const OVERRIDE; + int GetData(std::string* mime_type, + std::string* charset, + std::string* data, + const net::CompletionCallback& callback) const override; private: std::string mime_type_; diff --git a/atom/browser/node_debugger.h b/atom/browser/node_debugger.h index 04a79c52164..6ee5b1e2068 100644 --- a/atom/browser/node_debugger.h +++ b/atom/browser/node_debugger.h @@ -33,12 +33,12 @@ class NodeDebugger : public net::StreamListenSocket::Delegate { static void DebugMessageHandler(const v8::Debug::Message& message); // net::StreamListenSocket::Delegate: - virtual void DidAccept(net::StreamListenSocket* server, - scoped_ptr socket) OVERRIDE; - virtual void DidRead(net::StreamListenSocket* socket, - const char* data, - int len) OVERRIDE; - virtual void DidClose(net::StreamListenSocket* socket) OVERRIDE; + void DidAccept(net::StreamListenSocket* server, + scoped_ptr socket) override; + void DidRead(net::StreamListenSocket* socket, + const char* data, + int len) override; + void DidClose(net::StreamListenSocket* socket) override; v8::Isolate* isolate_; diff --git a/atom/browser/ui/file_dialog_gtk.cc b/atom/browser/ui/file_dialog_gtk.cc index 40da5ae1095..0a74cf7551d 100644 --- a/atom/browser/ui/file_dialog_gtk.cc +++ b/atom/browser/ui/file_dialog_gtk.cc @@ -16,7 +16,7 @@ #include "atom/browser/native_window.h" #include "base/callback.h" -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/strings/string_util.h" #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" #include "ui/aura/window.h" diff --git a/atom/browser/ui/file_dialog_mac.mm b/atom/browser/ui/file_dialog_mac.mm index 65af8eb4a1a..eff8506d85f 100644 --- a/atom/browser/ui/file_dialog_mac.mm +++ b/atom/browser/ui/file_dialog_mac.mm @@ -8,7 +8,7 @@ #import #include "atom/browser/native_window.h" -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/strings/sys_string_conversions.h" diff --git a/atom/browser/ui/file_dialog_win.cc b/atom/browser/ui/file_dialog_win.cc index 47e2c72a6d8..727d87a4552 100644 --- a/atom/browser/ui/file_dialog_win.cc +++ b/atom/browser/ui/file_dialog_win.cc @@ -10,7 +10,7 @@ #include #include "atom/browser/native_window_views.h" -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/i18n/case_conversion.h" #include "base/strings/string_util.h" #include "base/strings/string_split.h" diff --git a/atom/browser/ui/tray_icon_cocoa.h b/atom/browser/ui/tray_icon_cocoa.h index 8d0cd5d5e29..5723cb6b219 100644 --- a/atom/browser/ui/tray_icon_cocoa.h +++ b/atom/browser/ui/tray_icon_cocoa.h @@ -22,12 +22,12 @@ class TrayIconCocoa : public TrayIcon { TrayIconCocoa(); virtual ~TrayIconCocoa(); - virtual void SetImage(const gfx::Image& image) OVERRIDE; - virtual void SetPressedImage(const gfx::Image& image) OVERRIDE; - virtual void SetToolTip(const std::string& tool_tip) OVERRIDE; - virtual void SetTitle(const std::string& title) OVERRIDE; - virtual void SetHighlightMode(bool highlight) OVERRIDE; - virtual void SetContextMenu(ui::SimpleMenuModel* menu_model) OVERRIDE; + void SetImage(const gfx::Image& image) override; + void SetPressedImage(const gfx::Image& image) override; + void SetToolTip(const std::string& tool_tip) override; + void SetTitle(const std::string& title) override; + void SetHighlightMode(bool highlight) override; + void SetContextMenu(ui::SimpleMenuModel* menu_model) override; private: base::scoped_nsobject item_; diff --git a/atom/browser/ui/tray_icon_gtk.h b/atom/browser/ui/tray_icon_gtk.h index ce9ae3cf2b7..2be3259f218 100644 --- a/atom/browser/ui/tray_icon_gtk.h +++ b/atom/browser/ui/tray_icon_gtk.h @@ -23,14 +23,14 @@ class TrayIconGtk : public TrayIcon, virtual ~TrayIconGtk(); // TrayIcon: - virtual void SetImage(const gfx::Image& image) OVERRIDE; - virtual void SetToolTip(const std::string& tool_tip) OVERRIDE; - virtual void SetContextMenu(ui::SimpleMenuModel* menu_model) OVERRIDE; + void SetImage(const gfx::Image& image) override; + void SetToolTip(const std::string& tool_tip) override; + void SetContextMenu(ui::SimpleMenuModel* menu_model) override; private: // views::StatusIconLinux::Delegate: - virtual void OnClick() OVERRIDE; - virtual bool HasClickAction() OVERRIDE; + void OnClick() override; + bool HasClickAction() override; scoped_ptr icon_; diff --git a/atom/browser/ui/views/submenu_button.cc b/atom/browser/ui/views/submenu_button.cc index 2405df32d2d..bedbb98832d 100644 --- a/atom/browser/ui/views/submenu_button.cc +++ b/atom/browser/ui/views/submenu_button.cc @@ -37,7 +37,7 @@ SubmenuButton::SubmenuButton(views::ButtonListener* listener, underline_color_(SK_ColorBLACK) { #if defined(OS_LINUX) // Dont' use native style border. - SetBorder(CreateDefaultBorder().PassAs()); + SetBorder(CreateDefaultBorder().Pass()); #endif if (GetUnderlinePosition(title, &accelerator_, &underline_start_, diff --git a/atom/browser/web_dialog_helper.cc b/atom/browser/web_dialog_helper.cc index df600c37f14..f6f23345358 100644 --- a/atom/browser/web_dialog_helper.cc +++ b/atom/browser/web_dialog_helper.cc @@ -12,6 +12,7 @@ #include "base/strings/utf_string_conversions.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" +#include "content/public/common/file_chooser_file_info.h" #include "ui/shell_dialogs/selected_file_info.h" namespace atom { @@ -26,15 +27,19 @@ WebDialogHelper::~WebDialogHelper() { void WebDialogHelper::RunFileChooser(content::WebContents* web_contents, const content::FileChooserParams& params) { - std::vector result; + std::vector result; if (params.mode == content::FileChooserParams::Save) { base::FilePath path; if (file_dialog::ShowSaveDialog(window_, base::UTF16ToUTF8(params.title), params.default_file_name, file_dialog::Filters(), - &path)) - result.push_back(ui::SelectedFileInfo(path, path)); + &path)) { + content::FileChooserFileInfo info; + info.file_path = path; + info.display_name = path.BaseName().value(); + result.push_back(info); + } } else { int flags = file_dialog::FILE_DIALOG_CREATE_DIRECTORY; switch (params.mode) { @@ -56,9 +61,14 @@ void WebDialogHelper::RunFileChooser(content::WebContents* web_contents, params.default_file_name, file_dialog::Filters(), flags, - &paths)) - for (auto& path : paths) - result.push_back(ui::SelectedFileInfo(path, path)); + &paths)) { + for (auto& path : paths) { + content::FileChooserFileInfo info; + info.file_path = path; + info.display_name = path.BaseName().value(); + result.push_back(info); + } + } } web_contents->GetRenderViewHost()->FilesSelectedInChooser( diff --git a/atom/common/api/atom_bindings.cc b/atom/common/api/atom_bindings.cc index ed33dab6055..4c827e0429f 100644 --- a/atom/common/api/atom_bindings.cc +++ b/atom/common/api/atom_bindings.cc @@ -58,6 +58,9 @@ void AtomBindings::BindTo(v8::Isolate* isolate, dict.SetMethod("activateUvLoop", base::Bind(&AtomBindings::ActivateUVLoop, base::Unretained(this))); + // Do not warn about deprecated APIs. + dict.Set("noDeprecation", true); + mate::Dictionary versions; if (dict.Get("versions", &versions)) { versions.Set("atom-shell", ATOM_VERSION_STRING); diff --git a/atom/common/asar/scoped_temporary_file.cc b/atom/common/asar/scoped_temporary_file.cc index b62e487ff91..76ae5cb94b1 100644 --- a/atom/common/asar/scoped_temporary_file.cc +++ b/atom/common/asar/scoped_temporary_file.cc @@ -6,7 +6,7 @@ #include -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/threading/thread_restrictions.h" namespace asar { diff --git a/atom/common/chrome_version.h b/atom/common/chrome_version.h index e684321e177..03a0cfcc78b 100644 --- a/atom/common/chrome_version.h +++ b/atom/common/chrome_version.h @@ -8,7 +8,7 @@ #ifndef ATOM_COMMON_CHROME_VERSION_H_ #define ATOM_COMMON_CHROME_VERSION_H_ -#define CHROME_VERSION_STRING "39.0.2171.65" +#define CHROME_VERSION_STRING "40.0.2214.91" #define CHROME_VERSION "v" CHROME_VERSION_STRING #endif // ATOM_COMMON_CHROME_VERSION_H_ diff --git a/atom/common/crash_reporter/crash_reporter_linux.h b/atom/common/crash_reporter/crash_reporter_linux.h index c1055aded11..2f7d639e907 100644 --- a/atom/common/crash_reporter/crash_reporter_linux.h +++ b/atom/common/crash_reporter/crash_reporter_linux.h @@ -25,13 +25,13 @@ class CrashReporterLinux : public CrashReporter { public: static CrashReporterLinux* GetInstance(); - virtual void InitBreakpad(const std::string& product_name, - const std::string& version, - const std::string& company_name, - const std::string& submit_url, - bool auto_submit, - bool skip_system_crash_handler) OVERRIDE; - virtual void SetUploadParameters() OVERRIDE; + void InitBreakpad(const std::string& product_name, + const std::string& version, + const std::string& company_name, + const std::string& submit_url, + bool auto_submit, + bool skip_system_crash_handler) override; + void SetUploadParameters() override; private: friend struct DefaultSingletonTraits; diff --git a/atom/common/crash_reporter/crash_reporter_mac.h b/atom/common/crash_reporter/crash_reporter_mac.h index 8467294643b..882744db3c7 100644 --- a/atom/common/crash_reporter/crash_reporter_mac.h +++ b/atom/common/crash_reporter/crash_reporter_mac.h @@ -19,13 +19,13 @@ class CrashReporterMac : public CrashReporter { public: static CrashReporterMac* GetInstance(); - virtual void InitBreakpad(const std::string& product_name, - const std::string& version, - const std::string& company_name, - const std::string& submit_url, - bool auto_submit, - bool skip_system_crash_handler) OVERRIDE; - virtual void SetUploadParameters() OVERRIDE; + void InitBreakpad(const std::string& product_name, + const std::string& version, + const std::string& company_name, + const std::string& submit_url, + bool auto_submit, + bool skip_system_crash_handler) override; + void SetUploadParameters() override; private: friend struct DefaultSingletonTraits; diff --git a/atom/common/crash_reporter/crash_reporter_win.cc b/atom/common/crash_reporter/crash_reporter_win.cc index d5b8fab3dcc..6164a508db8 100644 --- a/atom/common/crash_reporter/crash_reporter_win.cc +++ b/atom/common/crash_reporter/crash_reporter_win.cc @@ -6,7 +6,7 @@ #include -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/logging.h" #include "base/memory/singleton.h" #include "base/strings/string_util.h" diff --git a/atom/common/crash_reporter/crash_reporter_win.h b/atom/common/crash_reporter/crash_reporter_win.h index 36950345839..72b9411d219 100644 --- a/atom/common/crash_reporter/crash_reporter_win.h +++ b/atom/common/crash_reporter/crash_reporter_win.h @@ -21,13 +21,13 @@ class CrashReporterWin : public CrashReporter { public: static CrashReporterWin* GetInstance(); - virtual void InitBreakpad(const std::string& product_name, - const std::string& version, - const std::string& company_name, - const std::string& submit_url, - bool auto_submit, - bool skip_system_crash_handler) OVERRIDE; - virtual void SetUploadParameters() OVERRIDE; + void InitBreakpad(const std::string& product_name, + const std::string& version, + const std::string& company_name, + const std::string& submit_url, + bool auto_submit, + bool skip_system_crash_handler) override; + void SetUploadParameters() override; private: friend struct DefaultSingletonTraits; diff --git a/atom/common/crash_reporter/win/crash_service.cc b/atom/common/crash_reporter/win/crash_service.cc index 626ab2f53c8..e0a552c094f 100644 --- a/atom/common/crash_reporter/win/crash_service.cc +++ b/atom/common/crash_reporter/win/crash_service.cc @@ -11,7 +11,7 @@ #include #include "base/command_line.h" -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/time/time.h" diff --git a/atom/common/crash_reporter/win/crash_service_main.cc b/atom/common/crash_reporter/win/crash_service_main.cc index 53cbca0e887..5f21dee070b 100644 --- a/atom/common/crash_reporter/win/crash_service_main.cc +++ b/atom/common/crash_reporter/win/crash_service_main.cc @@ -7,7 +7,7 @@ #include "atom/common/crash_reporter/win/crash_service.h" #include "base/at_exit.h" #include "base/command_line.h" -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/logging.h" #include "base/strings/string_util.h" diff --git a/atom/common/native_mate_converters/image_converter.cc b/atom/common/native_mate_converters/image_converter.cc index 0c239e199e5..8de73db306d 100644 --- a/atom/common/native_mate_converters/image_converter.cc +++ b/atom/common/native_mate_converters/image_converter.cc @@ -8,7 +8,7 @@ #include #include "atom/common/native_mate_converters/file_path_converter.h" -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/strings/string_util.h" #include "ui/gfx/codec/jpeg_codec.h" #include "ui/gfx/codec/png_codec.h" diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 042117c0ff4..51133d41f83 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -225,7 +225,7 @@ void NodeBindings::UvRunOnce() { v8::Context::Scope context_scope(env->context()); // Deal with uv events. - int r = uv_run(uv_loop_, (uv_run_mode)(UV_RUN_ONCE | UV_RUN_NOWAIT)); + int r = uv_run(uv_loop_, UV_RUN_NOWAIT); if (r == 0 || uv_loop_->stop_flag != 0) message_loop_->QuitWhenIdle(); // Quit from uv. diff --git a/atom/common/platform_util_linux.cc b/atom/common/platform_util_linux.cc index 1749bc02a93..3c3ae22ffaa 100644 --- a/atom/common/platform_util_linux.cc +++ b/atom/common/platform_util_linux.cc @@ -6,7 +6,7 @@ #include -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/process/kill.h" #include "base/process/launch.h" #include "url/gurl.h" diff --git a/atom/renderer/atom_render_view_observer.h b/atom/renderer/atom_render_view_observer.h index 2745c5d8c3e..4b9d59f3fa0 100644 --- a/atom/renderer/atom_render_view_observer.h +++ b/atom/renderer/atom_render_view_observer.h @@ -26,9 +26,9 @@ class AtomRenderViewObserver : public content::RenderViewObserver { private: // content::RenderViewObserver implementation. - virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) OVERRIDE; - virtual void DraggableRegionsChanged(blink::WebFrame* frame) OVERRIDE; - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + void DidCreateDocumentElement(blink::WebLocalFrame* frame) override; + void DraggableRegionsChanged(blink::WebFrame* frame) override; + bool OnMessageReceived(const IPC::Message& message) override; void OnBrowserMessage(const base::string16& channel, const base::ListValue& args); diff --git a/chromium_src/chrome/browser/extensions/global_shortcut_listener_mac.h b/chromium_src/chrome/browser/extensions/global_shortcut_listener_mac.h index 5295a719565..c38cb1dc528 100644 --- a/chromium_src/chrome/browser/extensions/global_shortcut_listener_mac.h +++ b/chromium_src/chrome/browser/extensions/global_shortcut_listener_mac.h @@ -41,12 +41,12 @@ class GlobalShortcutListenerMac : public GlobalShortcutListener { bool OnMediaOrVolumeKeyEvent(int key_code); // GlobalShortcutListener implementation. - virtual void StartListening() OVERRIDE; - virtual void StopListening() OVERRIDE; + virtual void StartListening() override; + virtual void StopListening() override; virtual bool RegisterAcceleratorImpl( - const ui::Accelerator& accelerator) OVERRIDE; + const ui::Accelerator& accelerator) override; virtual void UnregisterAcceleratorImpl( - const ui::Accelerator& accelerator) OVERRIDE; + const ui::Accelerator& accelerator) override; // Mac-specific functions for registering hot keys with modifiers. bool RegisterHotKey(const ui::Accelerator& accelerator, KeyId hot_key_id); diff --git a/chromium_src/chrome/browser/extensions/global_shortcut_listener_win.h b/chromium_src/chrome/browser/extensions/global_shortcut_listener_win.h index a19207340e9..a155d8f8991 100644 --- a/chromium_src/chrome/browser/extensions/global_shortcut_listener_win.h +++ b/chromium_src/chrome/browser/extensions/global_shortcut_listener_win.h @@ -26,15 +26,15 @@ class GlobalShortcutListenerWin : public GlobalShortcutListener, virtual void OnWndProc(HWND hwnd, UINT message, WPARAM wparam, - LPARAM lparam) OVERRIDE; + LPARAM lparam) override; // GlobalShortcutListener implementation. - virtual void StartListening() OVERRIDE; - virtual void StopListening() OVERRIDE; + virtual void StartListening() override; + virtual void StopListening() override; virtual bool RegisterAcceleratorImpl( - const ui::Accelerator& accelerator) OVERRIDE; + const ui::Accelerator& accelerator) override; virtual void UnregisterAcceleratorImpl( - const ui::Accelerator& accelerator) OVERRIDE; + const ui::Accelerator& accelerator) override; // Whether this object is listening for global shortcuts. bool is_listening_; diff --git a/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.h b/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.h index cc21ccb7454..8d551993841 100644 --- a/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.h +++ b/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.h @@ -23,17 +23,17 @@ class GlobalShortcutListenerX11 : public GlobalShortcutListener, virtual ~GlobalShortcutListenerX11(); // ui::PlatformEventDispatcher implementation. - virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE; - virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE; + virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override; + virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override; private: // GlobalShortcutListener implementation. - virtual void StartListening() OVERRIDE; - virtual void StopListening() OVERRIDE; + virtual void StartListening() override; + virtual void StopListening() override; virtual bool RegisterAcceleratorImpl( - const ui::Accelerator& accelerator) OVERRIDE; + const ui::Accelerator& accelerator) override; virtual void UnregisterAcceleratorImpl( - const ui::Accelerator& accelerator) OVERRIDE; + const ui::Accelerator& accelerator) override; // Invoked when a global shortcut is pressed. void OnXKeyPressEvent(::XEvent* x_event); diff --git a/chromium_src/chrome/browser/printing/print_job.h b/chromium_src/chrome/browser/printing/print_job.h index 1b816085c6a..a0f844a27c2 100644 --- a/chromium_src/chrome/browser/printing/print_job.h +++ b/chromium_src/chrome/browser/printing/print_job.h @@ -51,14 +51,14 @@ class PrintJob : public PrintJobWorkerOwner, // content::NotificationObserver implementation. virtual void Observe(int type, const content::NotificationSource& source, - const content::NotificationDetails& details) OVERRIDE; + const content::NotificationDetails& details) override; // PrintJobWorkerOwner implementation. virtual void GetSettingsDone(const PrintSettings& new_settings, - PrintingContext::Result result) OVERRIDE; - virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) OVERRIDE; - virtual const PrintSettings& settings() const OVERRIDE; - virtual int cookie() const OVERRIDE; + PrintingContext::Result result) override; + virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) override; + virtual const PrintSettings& settings() const override; + virtual int cookie() const override; // Starts the actual printing. Signals the worker that it should begin to // spool as soon as data is available. diff --git a/chromium_src/chrome/browser/printing/print_job_manager.h b/chromium_src/chrome/browser/printing/print_job_manager.h index ef61541a2ee..32d5b301b20 100644 --- a/chromium_src/chrome/browser/printing/print_job_manager.h +++ b/chromium_src/chrome/browser/printing/print_job_manager.h @@ -66,7 +66,7 @@ class PrintJobManager : public content::NotificationObserver { // content::NotificationObserver virtual void Observe(int type, const content::NotificationSource& source, - const content::NotificationDetails& details) OVERRIDE; + const content::NotificationDetails& details) override; // Returns queries queue. Never returns NULL. Must be called on Browser UI // Thread. Reference could be stored and used from any thread. diff --git a/chromium_src/chrome/browser/printing/print_job_worker.cc b/chromium_src/chrome/browser/printing/print_job_worker.cc index c4794f81541..37e61413584 100644 --- a/chromium_src/chrome/browser/printing/print_job_worker.cc +++ b/chromium_src/chrome/browser/printing/print_job_worker.cc @@ -40,8 +40,8 @@ class PrintingContextDelegate : public PrintingContext::Delegate { PrintingContextDelegate(int render_process_id, int render_view_id); virtual ~PrintingContextDelegate(); - virtual gfx::NativeView GetParentView() OVERRIDE; - virtual std::string GetAppLocale() OVERRIDE; + virtual gfx::NativeView GetParentView() override; + virtual std::string GetAppLocale() override; private: int render_process_id_; diff --git a/chromium_src/chrome/browser/printing/print_view_manager_base.cc b/chromium_src/chrome/browser/printing/print_view_manager_base.cc index e2cfedd4a2c..af55132bd6b 100644 --- a/chromium_src/chrome/browser/printing/print_view_manager_base.cc +++ b/chromium_src/chrome/browser/printing/print_view_manager_base.cc @@ -144,7 +144,7 @@ void PrintViewManagerBase::OnDidPrintPage( #if !defined(OS_WIN) // Update the rendered document. It will send notifications to the listener. document->SetPage(params.page_number, - metafile.PassAs(), + metafile.Pass(), params.page_size, params.content_area); diff --git a/chromium_src/chrome/browser/printing/print_view_manager_base.h b/chromium_src/chrome/browser/printing/print_view_manager_base.h index f9232fdfe87..0d44248bfe2 100644 --- a/chromium_src/chrome/browser/printing/print_view_manager_base.h +++ b/chromium_src/chrome/browser/printing/print_view_manager_base.h @@ -43,7 +43,7 @@ class PrintViewManagerBase : public content::NotificationObserver, #endif // !DISABLE_BASIC_PRINTING // PrintedPagesSource implementation. - virtual base::string16 RenderSourceName() OVERRIDE; + virtual base::string16 RenderSourceName() override; protected: explicit PrintViewManagerBase(content::WebContents* web_contents); @@ -52,10 +52,10 @@ class PrintViewManagerBase : public content::NotificationObserver, bool PrintNowInternal(IPC::Message* message); // Terminates or cancels the print job if one was pending. - virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; + virtual void RenderProcessGone(base::TerminationStatus status) override; // content::WebContentsObserver implementation. - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + virtual bool OnMessageReceived(const IPC::Message& message) override; // IPC Message handlers. virtual void OnPrintingFailed(int cookie); @@ -64,10 +64,10 @@ class PrintViewManagerBase : public content::NotificationObserver, // content::NotificationObserver implementation. virtual void Observe(int type, const content::NotificationSource& source, - const content::NotificationDetails& details) OVERRIDE; + const content::NotificationDetails& details) override; // Cancels the print job. - virtual void NavigationStopped() OVERRIDE; + virtual void NavigationStopped() override; // IPC Message handlers. void OnDidGetPrintedPagesCount(int cookie, int number_pages); diff --git a/chromium_src/chrome/browser/printing/print_view_manager_basic.h b/chromium_src/chrome/browser/printing/print_view_manager_basic.h index 0e403844566..553c555cc3a 100644 --- a/chromium_src/chrome/browser/printing/print_view_manager_basic.h +++ b/chromium_src/chrome/browser/printing/print_view_manager_basic.h @@ -32,10 +32,10 @@ class PrintViewManagerBasic // content::WebContentsObserver implementation. // Terminates or cancels the print job if one was pending. - virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; + virtual void RenderProcessGone(base::TerminationStatus status) override; // content::WebContentsObserver implementation. - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + virtual bool OnMessageReceived(const IPC::Message& message) override; #endif private: @@ -43,7 +43,7 @@ class PrintViewManagerBasic friend class content::WebContentsUserData; #if defined(OS_ANDROID) - virtual void OnPrintingFailed(int cookie) OVERRIDE; + virtual void OnPrintingFailed(int cookie) override; // The file descriptor into which the PDF of the page will be written. base::FileDescriptor file_descriptor_; diff --git a/chromium_src/chrome/browser/printing/printer_query.h b/chromium_src/chrome/browser/printing/printer_query.h index 22af08d7af2..9fd9a82b33e 100644 --- a/chromium_src/chrome/browser/printing/printer_query.h +++ b/chromium_src/chrome/browser/printing/printer_query.h @@ -33,10 +33,10 @@ class PrinterQuery : public PrintJobWorkerOwner { // PrintJobWorkerOwner implementation. virtual void GetSettingsDone(const PrintSettings& new_settings, - PrintingContext::Result result) OVERRIDE; - virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) OVERRIDE; - virtual const PrintSettings& settings() const OVERRIDE; - virtual int cookie() const OVERRIDE; + PrintingContext::Result result) override; + virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) override; + virtual const PrintSettings& settings() const override; + virtual int cookie() const override; // Initializes the printing context. It is fine to call this function multiple // times to reinitialize the settings. |web_contents_observer| can be queried diff --git a/chromium_src/chrome/browser/printing/printing_message_filter.h b/chromium_src/chrome/browser/printing/printing_message_filter.h index 5f437864c17..410b6245786 100644 --- a/chromium_src/chrome/browser/printing/printing_message_filter.h +++ b/chromium_src/chrome/browser/printing/printing_message_filter.h @@ -40,10 +40,10 @@ class PrintingMessageFilter : public content::BrowserMessageFilter { PrintingMessageFilter(int render_process_id); // content::BrowserMessageFilter methods. - virtual void OverrideThreadForMessage( + void OverrideThreadForMessage( const IPC::Message& message, - content::BrowserThread::ID* thread) OVERRIDE; - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + content::BrowserThread::ID* thread) override; + bool OnMessageReceived(const IPC::Message& message) override; private: virtual ~PrintingMessageFilter(); diff --git a/chromium_src/chrome/browser/speech/tts_controller_impl.h b/chromium_src/chrome/browser/speech/tts_controller_impl.h index f6ddf584cc2..651f836cdf6 100644 --- a/chromium_src/chrome/browser/speech/tts_controller_impl.h +++ b/chromium_src/chrome/browser/speech/tts_controller_impl.h @@ -29,26 +29,26 @@ class TtsControllerImpl : public TtsController { static TtsControllerImpl* GetInstance(); // TtsController methods - virtual bool IsSpeaking() OVERRIDE; - virtual void SpeakOrEnqueue(Utterance* utterance) OVERRIDE; - virtual void Stop() OVERRIDE; - virtual void Pause() OVERRIDE; - virtual void Resume() OVERRIDE; + virtual bool IsSpeaking() override; + virtual void SpeakOrEnqueue(Utterance* utterance) override; + virtual void Stop() override; + virtual void Pause() override; + virtual void Resume() override; virtual void OnTtsEvent(int utterance_id, TtsEventType event_type, int char_index, - const std::string& error_message) OVERRIDE; + const std::string& error_message) override; virtual void GetVoices(content::BrowserContext* browser_context, - std::vector* out_voices) OVERRIDE; - virtual void VoicesChanged() OVERRIDE; + std::vector* out_voices) override; + virtual void VoicesChanged() override; virtual void AddVoicesChangedDelegate( - VoicesChangedDelegate* delegate) OVERRIDE; + VoicesChangedDelegate* delegate) override; virtual void RemoveVoicesChangedDelegate( - VoicesChangedDelegate* delegate) OVERRIDE; - virtual void SetTtsEngineDelegate(TtsEngineDelegate* delegate) OVERRIDE; - virtual TtsEngineDelegate* GetTtsEngineDelegate() OVERRIDE; - virtual void SetPlatformImpl(TtsPlatformImpl* platform_impl) OVERRIDE; - virtual int QueueSize() OVERRIDE; + VoicesChangedDelegate* delegate) override; + virtual void SetTtsEngineDelegate(TtsEngineDelegate* delegate) override; + virtual TtsEngineDelegate* GetTtsEngineDelegate() override; + virtual void SetPlatformImpl(TtsPlatformImpl* platform_impl) override; + virtual int QueueSize() override; protected: TtsControllerImpl(); diff --git a/chromium_src/chrome/browser/speech/tts_linux.cc b/chromium_src/chrome/browser/speech/tts_linux.cc index 15e503c3de2..43b28a5eade 100644 --- a/chromium_src/chrome/browser/speech/tts_linux.cc +++ b/chromium_src/chrome/browser/speech/tts_linux.cc @@ -32,18 +32,18 @@ struct SPDChromeVoice { class TtsPlatformImplLinux : public TtsPlatformImpl { public: - virtual bool PlatformImplAvailable() OVERRIDE; + virtual bool PlatformImplAvailable() override; virtual bool Speak( int utterance_id, const std::string& utterance, const std::string& lang, const VoiceData& voice, - const UtteranceContinuousParameters& params) OVERRIDE; - virtual bool StopSpeaking() OVERRIDE; - virtual void Pause() OVERRIDE; - virtual void Resume() OVERRIDE; - virtual bool IsSpeaking() OVERRIDE; - virtual void GetVoices(std::vector* out_voices) OVERRIDE; + const UtteranceContinuousParameters& params) override; + virtual bool StopSpeaking() override; + virtual void Pause() override; + virtual void Resume() override; + virtual bool IsSpeaking() override; + virtual void GetVoices(std::vector* out_voices) override; void OnSpeechEvent(SPDNotificationType type); diff --git a/chromium_src/chrome/browser/speech/tts_mac.mm b/chromium_src/chrome/browser/speech/tts_mac.mm index 08786fe1e31..acfa5b58bf3 100644 --- a/chromium_src/chrome/browser/speech/tts_mac.mm +++ b/chromium_src/chrome/browser/speech/tts_mac.mm @@ -49,7 +49,7 @@ class TtsPlatformImplMac; class TtsPlatformImplMac : public TtsPlatformImpl { public: - virtual bool PlatformImplAvailable() OVERRIDE { + virtual bool PlatformImplAvailable() override { return true; } @@ -58,17 +58,17 @@ class TtsPlatformImplMac : public TtsPlatformImpl { const std::string& utterance, const std::string& lang, const VoiceData& voice, - const UtteranceContinuousParameters& params) OVERRIDE; + const UtteranceContinuousParameters& params) override; - virtual bool StopSpeaking() OVERRIDE; + virtual bool StopSpeaking() override; - virtual void Pause() OVERRIDE; + virtual void Pause() override; - virtual void Resume() OVERRIDE; + virtual void Resume() override; - virtual bool IsSpeaking() OVERRIDE; + virtual bool IsSpeaking() override; - virtual void GetVoices(std::vector* out_voices) OVERRIDE; + virtual void GetVoices(std::vector* out_voices) override; // Called by ChromeTtsDelegate when we get a callback from the // native speech engine. diff --git a/chromium_src/chrome/browser/speech/tts_message_filter.h b/chromium_src/chrome/browser/speech/tts_message_filter.h index ba3f98b3311..b0956516119 100644 --- a/chromium_src/chrome/browser/speech/tts_message_filter.h +++ b/chromium_src/chrome/browser/speech/tts_message_filter.h @@ -23,21 +23,21 @@ class TtsMessageFilter content::BrowserContext* browser_context); // content::BrowserMessageFilter implementation. - virtual void OverrideThreadForMessage( + void OverrideThreadForMessage( const IPC::Message& message, - content::BrowserThread::ID* thread) OVERRIDE; - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - virtual void OnChannelClosing() OVERRIDE; - virtual void OnDestruct() const OVERRIDE; + content::BrowserThread::ID* thread) override; + bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelClosing() override; + void OnDestruct() const override; // UtteranceEventDelegate implementation. - virtual void OnTtsEvent(Utterance* utterance, - TtsEventType event_type, - int char_index, - const std::string& error_message) OVERRIDE; + void OnTtsEvent(Utterance* utterance, + TtsEventType event_type, + int char_index, + const std::string& error_message) override; // VoicesChangedDelegate implementation. - virtual void OnVoicesChanged() OVERRIDE; + void OnVoicesChanged() override; private: friend class content::BrowserThread; @@ -61,4 +61,4 @@ class TtsMessageFilter DISALLOW_COPY_AND_ASSIGN(TtsMessageFilter); }; -#endif // CHROME_BROWSER_SPEECH_TTS_MESSAGE_FILTER_H_ \ No newline at end of file +#endif // CHROME_BROWSER_SPEECH_TTS_MESSAGE_FILTER_H_ diff --git a/chromium_src/chrome/browser/speech/tts_win.cc b/chromium_src/chrome/browser/speech/tts_win.cc index 9b9ce2584c0..c7b0a0ca724 100644 --- a/chromium_src/chrome/browser/speech/tts_win.cc +++ b/chromium_src/chrome/browser/speech/tts_win.cc @@ -34,7 +34,7 @@ class TtsPlatformImplWin : public TtsPlatformImpl { virtual bool IsSpeaking(); - virtual void GetVoices(std::vector* out_voices) OVERRIDE; + virtual void GetVoices(std::vector* out_voices) override; // Get the single instance of this class. static TtsPlatformImplWin* GetInstance(); diff --git a/chromium_src/chrome/browser/ui/cocoa/color_chooser_mac.mm b/chromium_src/chrome/browser/ui/cocoa/color_chooser_mac.mm index f2ce552bfcc..cb366022d6e 100644 --- a/chromium_src/chrome/browser/ui/cocoa/color_chooser_mac.mm +++ b/chromium_src/chrome/browser/ui/cocoa/color_chooser_mac.mm @@ -45,8 +45,8 @@ class ColorChooserMac : public content::ColorChooser { void DidChooseColorInColorPanel(SkColor color); void DidCloseColorPabel(); - virtual void End() OVERRIDE; - virtual void SetSelectedColor(SkColor color) OVERRIDE; + virtual void End() override; + virtual void SetSelectedColor(SkColor color) override; private: static ColorChooserMac* current_color_chooser_; diff --git a/chromium_src/chrome/browser/ui/views/color_chooser_aura.h b/chromium_src/chrome/browser/ui/views/color_chooser_aura.h index cb33d6a3983..6394b973a3d 100644 --- a/chromium_src/chrome/browser/ui/views/color_chooser_aura.h +++ b/chromium_src/chrome/browser/ui/views/color_chooser_aura.h @@ -31,12 +31,12 @@ class ColorChooserAura : public content::ColorChooser, ColorChooserAura(content::WebContents* web_contents, SkColor initial_color); // content::ColorChooser overrides: - virtual void End() OVERRIDE; - virtual void SetSelectedColor(SkColor color) OVERRIDE; + virtual void End() override; + virtual void SetSelectedColor(SkColor color) override; // views::ColorChooserListener overrides: - virtual void OnColorChosen(SkColor color) OVERRIDE; - virtual void OnColorChooserDialogClosed() OVERRIDE; + virtual void OnColorChosen(SkColor color) override; + virtual void OnColorChooserDialogClosed() override; void DidEndColorChooser(); diff --git a/chromium_src/chrome/browser/ui/views/color_chooser_dialog.h b/chromium_src/chrome/browser/ui/views/color_chooser_dialog.h index 8f2e6ffc8fa..b23061a386d 100644 --- a/chromium_src/chrome/browser/ui/views/color_chooser_dialog.h +++ b/chromium_src/chrome/browser/ui/views/color_chooser_dialog.h @@ -26,8 +26,8 @@ class ColorChooserDialog virtual ~ColorChooserDialog(); // BaseShellDialog: - virtual bool IsRunning(gfx::NativeWindow owning_window) const OVERRIDE; - virtual void ListenerDestroyed() OVERRIDE; + virtual bool IsRunning(gfx::NativeWindow owning_window) const override; + virtual void ListenerDestroyed() override; private: struct ExecuteOpenParams { diff --git a/chromium_src/chrome/browser/ui/views/color_chooser_win.cc b/chromium_src/chrome/browser/ui/views/color_chooser_win.cc index 1a2aed45c38..b62801399e8 100644 --- a/chromium_src/chrome/browser/ui/views/color_chooser_win.cc +++ b/chromium_src/chrome/browser/ui/views/color_chooser_win.cc @@ -24,8 +24,8 @@ class ColorChooserWin : public content::ColorChooser, ~ColorChooserWin(); // content::ColorChooser overrides: - virtual void End() OVERRIDE; - virtual void SetSelectedColor(SkColor color) OVERRIDE {} + virtual void End() override; + virtual void SetSelectedColor(SkColor color) override {} // views::ColorChooserListener overrides: virtual void OnColorChosen(SkColor color); diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper.h b/chromium_src/chrome/renderer/printing/print_web_view_helper.h index 17b8cb05b62..25ba2f668a7 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper.h +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper.h @@ -79,9 +79,9 @@ class PrintWebViewHelper }; // RenderViewObserver implementation. - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + virtual bool OnMessageReceived(const IPC::Message& message) override; virtual void PrintPage(blink::WebLocalFrame* frame, - bool user_initiated) OVERRIDE; + bool user_initiated) override; // Message handlers --------------------------------------------------------- #if !defined(DISABLE_BASIC_PRINTING) diff --git a/chromium_src/chrome/renderer/tts_dispatcher.h b/chromium_src/chrome/renderer/tts_dispatcher.h index 0b9bb1af00e..fd18acba206 100644 --- a/chromium_src/chrome/renderer/tts_dispatcher.h +++ b/chromium_src/chrome/renderer/tts_dispatcher.h @@ -37,15 +37,15 @@ class TtsDispatcher virtual ~TtsDispatcher(); // RenderProcessObserver override. - virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; + virtual bool OnControlMessageReceived(const IPC::Message& message) override; // blink::WebSpeechSynthesizer implementation. - virtual void updateVoiceList() OVERRIDE; + virtual void updateVoiceList() override; virtual void speak(const blink::WebSpeechSynthesisUtterance& utterance) - OVERRIDE; - virtual void pause() OVERRIDE; - virtual void resume() OVERRIDE; - virtual void cancel() OVERRIDE; + override; + virtual void pause() override; + virtual void resume() override; + virtual void cancel() override; blink::WebSpeechSynthesisUtterance FindUtterance(int utterance_id); diff --git a/package.json b/package.json index 57dff2a7676..c77e27bc724 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ ], "devDependencies": { - "atom-package-manager": "0.122.0", + "atom-package-manager": "0.126.0", "coffee-script": "~1.7.1", "coffeelint": "~1.3.0", "request": "*" diff --git a/script/create-dist.py b/script/create-dist.py index 8a83c954e7a..bab43e85997 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -6,12 +6,11 @@ import re import shutil import subprocess import sys -import tarfile from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \ DIST_ARCH from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \ - safe_mkdir, execute, get_chromedriver_version + execute, get_chromedriver_version ATOM_SHELL_VERSION = get_atom_shell_version() @@ -19,9 +18,6 @@ ATOM_SHELL_VERSION = get_atom_shell_version() SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release') -NODE_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'node') -DIST_HEADERS_NAME = 'node-{0}'.format(ATOM_SHELL_VERSION) -DIST_HEADERS_DIR = os.path.join(DIST_DIR, DIST_HEADERS_NAME) SYMBOL_NAME = { 'darwin': 'libchromiumcontent.dylib.dSYM', @@ -76,23 +72,6 @@ SYSTEM_LIBRARIES = [ 'libnotify.so', ] -HEADERS_SUFFIX = [ - '.h', - '.gypi', -] -HEADERS_DIRS = [ - 'src', - 'deps/http_parser', - 'deps/zlib', - 'deps/uv', - 'deps/npm', - 'deps/mdb_v8', -] -HEADERS_FILES = [ - 'common.gypi', - 'config.gypi', -] - def main(): rm_rf(DIST_DIR) @@ -105,7 +84,6 @@ def main(): create_symbols() copy_binaries() copy_chromedriver() - copy_headers() copy_license() if TARGET_PLATFORM == 'linux': @@ -115,7 +93,6 @@ def main(): create_dist_zip() create_chromedriver_zip() create_symbols_zip() - create_header_tarball() def parse_args(): @@ -153,33 +130,6 @@ def copy_chromedriver(): shutil.copy2(os.path.join(OUT_DIR, binary), DIST_DIR) -def copy_headers(): - os.mkdir(DIST_HEADERS_DIR) - # Copy standard node headers from node. repository. - for include_path in HEADERS_DIRS: - abs_path = os.path.join(NODE_DIR, include_path) - for dirpath, _, filenames in os.walk(abs_path): - for filename in filenames: - extension = os.path.splitext(filename)[1] - if extension not in HEADERS_SUFFIX: - continue - copy_source_file(os.path.join(dirpath, filename)) - for other_file in HEADERS_FILES: - copy_source_file(source = os.path.join(NODE_DIR, other_file)) - - # Copy V8 headers from chromium's repository. - src = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download', - 'libchromiumcontent', 'src') - for dirpath, _, filenames in os.walk(os.path.join(src, 'v8')): - for filename in filenames: - extension = os.path.splitext(filename)[1] - if extension not in HEADERS_SUFFIX: - continue - copy_source_file(source=os.path.join(dirpath, filename), - start=src, - destination=os.path.join(DIST_HEADERS_DIR, 'deps')) - - def copy_license(): shutil.copy2(os.path.join(SOURCE_ROOT, 'LICENSE'), DIST_DIR) @@ -269,19 +219,5 @@ def create_symbols_zip(): make_zip(zip_file, files, dirs) -def create_header_tarball(): - with scoped_cwd(DIST_DIR): - tarball = tarfile.open(name=DIST_HEADERS_DIR + '.tar.gz', mode='w:gz') - tarball.add(DIST_HEADERS_NAME) - tarball.close() - - -def copy_source_file(source, start=NODE_DIR, destination=DIST_HEADERS_DIR): - relative = os.path.relpath(source, start=start) - final_destination = os.path.join(destination, relative) - safe_mkdir(os.path.dirname(final_destination)) - shutil.copy2(source, final_destination) - - if __name__ == '__main__': sys.exit(main()) diff --git a/script/lib/config.py b/script/lib/config.py index f52098bdaec..50abceb61e2 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -4,7 +4,7 @@ import platform import sys BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '6300862b4b16bd171f00ae566b697098c29743f7' +LIBCHROMIUMCONTENT_COMMIT = '103778aa0ec3772f88e915ca9efdb941afdc85cf' ARCH = { 'cygwin': '32bit', diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py new file mode 100755 index 00000000000..6734929c10e --- /dev/null +++ b/script/upload-node-headers.py @@ -0,0 +1,147 @@ +#!/usr/bin/env python + +import argparse +import glob +import os +import shutil +import sys +import tarfile + +from lib.config import TARGET_PLATFORM +from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put + + +SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') +NODE_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'node') +OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release') + +HEADERS_SUFFIX = [ + '.h', + '.gypi', +] +HEADERS_DIRS = [ + 'src', + 'deps/http_parser', + 'deps/zlib', + 'deps/uv', + 'deps/npm', + 'deps/mdb_v8', +] +HEADERS_FILES = [ + 'common.gypi', + 'config.gypi', +] + + +def main(): + safe_mkdir(DIST_DIR) + + args = parse_args() + dist_headers_dir = os.path.join(DIST_DIR, 'node-{0}'.format(args.version)) + + copy_headers(dist_headers_dir) + create_header_tarball(dist_headers_dir) + + # Upload node's headers to S3. + bucket, access_key, secret_key = s3_config() + upload_node(bucket, access_key, secret_key, args.version) + + # Upload the SHASUMS.txt. + execute([sys.executable, + os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), + '-v', args.version]) + + +def parse_args(): + parser = argparse.ArgumentParser(description='upload sumsha file') + parser.add_argument('-v', '--version', help='Specify the version', + required=True) + return parser.parse_args() + + +def copy_headers(dist_headers_dir): + safe_mkdir(dist_headers_dir) + + # Copy standard node headers from node. repository. + for include_path in HEADERS_DIRS: + abs_path = os.path.join(NODE_DIR, include_path) + for dirpath, _, filenames in os.walk(abs_path): + for filename in filenames: + extension = os.path.splitext(filename)[1] + if extension not in HEADERS_SUFFIX: + continue + copy_source_file(os.path.join(dirpath, filename), NODE_DIR, + dist_headers_dir) + for other_file in HEADERS_FILES: + copy_source_file(os.path.join(NODE_DIR, other_file), NODE_DIR, + dist_headers_dir) + + # Copy V8 headers from chromium's repository. + src = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download', + 'libchromiumcontent', 'src') + for dirpath, _, filenames in os.walk(os.path.join(src, 'v8')): + for filename in filenames: + extension = os.path.splitext(filename)[1] + if extension not in HEADERS_SUFFIX: + continue + copy_source_file(os.path.join(dirpath, filename), src, + os.path.join(dist_headers_dir, 'deps')) + + +def create_header_tarball(dist_headers_dir): + target = dist_headers_dir + '.tar.gz' + with scoped_cwd(DIST_DIR): + tarball = tarfile.open(name=target, mode='w:gz') + tarball.add(os.path.relpath(dist_headers_dir)) + tarball.close() + + +def copy_source_file(source, start, destination): + relative = os.path.relpath(source, start=start) + final_destination = os.path.join(destination, relative) + safe_mkdir(os.path.dirname(final_destination)) + shutil.copy2(source, final_destination) + + +def upload_node(bucket, access_key, secret_key, version): + with scoped_cwd(DIST_DIR): + s3put(bucket, access_key, secret_key, DIST_DIR, + 'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz')) + + if TARGET_PLATFORM == 'win32': + # Generate the node.lib. + build = os.path.join(SOURCE_ROOT, 'script', 'build.py') + execute([sys.executable, build, '-c', 'Release', '-t', 'generate_node_lib']) + + # Upload the 32bit node.lib. + node_lib = os.path.join(OUT_DIR, 'node.lib') + s3put(bucket, access_key, secret_key, OUT_DIR, + 'atom-shell/dist/{0}'.format(version), [node_lib]) + + # Upload the fake 64bit node.lib. + touch_x64_node_lib() + node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib') + s3put(bucket, access_key, secret_key, OUT_DIR, + 'atom-shell/dist/{0}'.format(version), [node_lib]) + + # Upload the index.json + with scoped_cwd(SOURCE_ROOT): + atom_shell = os.path.join(OUT_DIR, 'atom.exe') + index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json')) + execute([atom_shell, + os.path.join('script', 'dump-version-info.js'), + index_json]) + s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist', + [index_json]) + + +def touch_x64_node_lib(): + x64_dir = os.path.join(OUT_DIR, 'x64') + safe_mkdir(x64_dir) + with open(os.path.join(x64_dir, 'node.lib'), 'w+') as node_lib: + node_lib.write('Invalid library') + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/script/upload.py b/script/upload.py index 320bd0661a2..e066d89423d 100755 --- a/script/upload.py +++ b/script/upload.py @@ -2,7 +2,6 @@ import argparse import errno -import glob import os import subprocess import sys @@ -10,8 +9,7 @@ import tempfile from lib.config import DIST_ARCH, TARGET_PLATFORM from lib.util import execute, get_atom_shell_version, parse_version, \ - get_chromedriver_version, scoped_cwd, safe_mkdir, \ - s3_config, s3put + get_chromedriver_version, scoped_cwd from lib.github import GitHub @@ -60,20 +58,16 @@ def main(): os.path.join(DIST_DIR, CHROMEDRIVER_NAME)) if args.publish_release: - # Upload node's headers to S3. - bucket, access_key, secret_key = s3_config() - upload_node(bucket, access_key, secret_key, ATOM_SHELL_VERSION) - - # Upload the SHASUMS.txt. - execute([sys.executable, - os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), - '-v', ATOM_SHELL_VERSION]) - - # Upload PDBs to Windows symbol server. if TARGET_PLATFORM == 'win32': + # Upload PDBs to Windows symbol server. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')]) + # Upload node headers. + execute([sys.executable, + os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'), + '-v', ATOM_SHELL_VERSION]) + # Press the publish button. publish_release(github, release_id) @@ -168,38 +162,6 @@ def publish_release(github, release_id): github.repos(ATOM_SHELL_REPO).releases(release_id).patch(data=data) -def upload_node(bucket, access_key, secret_key, version): - os.chdir(DIST_DIR) - - s3put(bucket, access_key, secret_key, DIST_DIR, - 'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz')) - - if TARGET_PLATFORM == 'win32': - # Generate the node.lib. - build = os.path.join(SOURCE_ROOT, 'script', 'build.py') - execute([sys.executable, build, '-c', 'Release', '-t', 'generate_node_lib']) - - # Upload the 32bit node.lib. - node_lib = os.path.join(OUT_DIR, 'node.lib') - s3put(bucket, access_key, secret_key, OUT_DIR, - 'atom-shell/dist/{0}'.format(version), [node_lib]) - - # Upload the fake 64bit node.lib. - touch_x64_node_lib() - node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib') - s3put(bucket, access_key, secret_key, OUT_DIR, - 'atom-shell/dist/{0}'.format(version), [node_lib]) - - # Upload the index.json - atom_shell = os.path.join(OUT_DIR, 'atom.exe') - index_json = os.path.join(OUT_DIR, 'index.json') - execute([atom_shell, - os.path.join(SOURCE_ROOT, 'script', 'dump-version-info.js'), - index_json]) - s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist', - [index_json]) - - def auth_token(): token = os.environ.get('ATOM_SHELL_GITHUB_TOKEN') message = ('Error: Please set the $ATOM_SHELL_GITHUB_TOKEN ' @@ -208,13 +170,6 @@ def auth_token(): return token -def touch_x64_node_lib(): - x64_dir = os.path.join(OUT_DIR, 'x64') - safe_mkdir(x64_dir) - with open(os.path.join(x64_dir, 'node.lib'), 'w+') as node_lib: - node_lib.write('Invalid library') - - if __name__ == '__main__': import sys sys.exit(main()) diff --git a/vendor/brightray b/vendor/brightray index a45009446ac..c96ee1ee1e2 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit a45009446ac3279b385b1de1f3226251e7f0e634 +Subproject commit c96ee1ee1e2d1322c4d73be18f28c232587a43a2 diff --git a/vendor/node b/vendor/node index 296b2c198be..70498428ced 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit 296b2c198be867ed89144acb20bd3570ce375cf5 +Subproject commit 70498428ced2b8ae4ce020051f06d104b5c6c4de