Merge pull request #1002 from atom/chrome40

Upgrade to Chrome 40
This commit is contained in:
Cheng Zhao 2015-01-27 17:32:07 -08:00
commit f829f2eb0c
72 changed files with 494 additions and 365 deletions

View file

@ -19,10 +19,10 @@ class AtomContentClient : public brightray::ContentClient {
protected: protected:
// content::ContentClient: // content::ContentClient:
virtual std::string GetProduct() const OVERRIDE; std::string GetProduct() const override;
virtual void AddAdditionalSchemes( void AddAdditionalSchemes(
std::vector<std::string>* standard_schemes, std::vector<std::string>* standard_schemes,
std::vector<std::string>* savable_schemes) OVERRIDE; std::vector<std::string>* savable_schemes) override;
private: private:
DISALLOW_COPY_AND_ASSIGN(AtomContentClient); DISALLOW_COPY_AND_ASSIGN(AtomContentClient);

View file

@ -13,11 +13,14 @@
#include <fcntl.h> #include <fcntl.h>
#include <windows.h> #include <windows.h>
#include <shellscalingapi.h>
#include <tchar.h>
#include <shellapi.h> #include <shellapi.h>
#include "atom/app/atom_main_delegate.h" #include "atom/app/atom_main_delegate.h"
#include "atom/common/crash_reporter/win/crash_service_main.h" #include "atom/common/crash_reporter/win/crash_service_main.h"
#include "base/environment.h" #include "base/environment.h"
#include "base/win/windows_version.h"
#include "content/public/app/startup_helper_win.h" #include "content/public/app/startup_helper_win.h"
#include "sandbox/win/src/sandbox_types.h" #include "sandbox/win/src/sandbox_types.h"
#include "ui/gfx/win/dpi.h" #include "ui/gfx/win/dpi.h"
@ -37,6 +40,48 @@ int Start(int argc, char *argv[]);
#if defined(OS_WIN) #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<SetProcessDpiAwarenessPtr>(
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<SetProcessDPIAwarePtr>(
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 APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
int argc = 0; int argc = 0;
wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
@ -103,8 +148,11 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
content::InitializeSandboxInfo(&sandbox_info); content::InitializeSandboxInfo(&sandbox_info);
atom::AtomMainDelegate delegate; atom::AtomMainDelegate delegate;
// Now chrome relies on a regkey to enable high dpi support. // We don't want to set DPI awareness on pre-Win7 because we don't support
gfx::EnableHighDPISupport(); // 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); content::ContentMainParams params(&delegate);
params.instance = instance; params.instance = instance;

View file

@ -26,20 +26,20 @@ class AutoUpdater : public mate::EventEmitter,
virtual ~AutoUpdater(); virtual ~AutoUpdater();
// AutoUpdaterDelegate implementations. // AutoUpdaterDelegate implementations.
virtual void OnError(const std::string& error) OVERRIDE; void OnError(const std::string& error) override;
virtual void OnCheckingForUpdate() OVERRIDE; void OnCheckingForUpdate() override;
virtual void OnUpdateAvailable() OVERRIDE; void OnUpdateAvailable() override;
virtual void OnUpdateNotAvailable() OVERRIDE; void OnUpdateNotAvailable() override;
virtual void OnUpdateDownloaded( void OnUpdateDownloaded(
const std::string& release_notes, const std::string& release_notes,
const std::string& release_name, const std::string& release_name,
const base::Time& release_date, const base::Time& release_date,
const std::string& update_url, const std::string& update_url,
const base::Closure& quit_and_install) OVERRIDE; const base::Closure& quit_and_install) override;
// mate::Wrappable implementations: // mate::Wrappable implementations:
virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder( mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate); v8::Isolate* isolate) override;
private: private:
void QuitAndInstall(); void QuitAndInstall();

View file

@ -28,8 +28,8 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
virtual ~GlobalShortcut(); virtual ~GlobalShortcut();
// mate::Wrappable implementations: // mate::Wrappable implementations:
virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder( mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) OVERRIDE; v8::Isolate* isolate) override;
private: private:
typedef std::map<ui::Accelerator, base::Closure> AcceleratorCallbackMap; typedef std::map<ui::Accelerator, base::Closure> AcceleratorCallbackMap;
@ -41,7 +41,7 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
void UnregisterAll(); void UnregisterAll();
// GlobalShortcutListener::Observer implementation. // GlobalShortcutListener::Observer implementation.
virtual void OnKeyPressed(const ui::Accelerator& accelerator) OVERRIDE; void OnKeyPressed(const ui::Accelerator& accelerator) override;
AcceleratorCallbackMap accelerator_callback_map_; AcceleratorCallbackMap accelerator_callback_map_;

View file

@ -19,8 +19,8 @@ class MenuMac : public Menu {
protected: protected:
MenuMac(); MenuMac();
virtual void Popup(Window* window) OVERRIDE; void Popup(Window* window) override;
virtual void PopupAt(Window* window, int x, int y) OVERRIDE; void PopupAt(Window* window, int x, int y) override;
base::scoped_nsobject<AtomMenuController> menu_controller_; base::scoped_nsobject<AtomMenuController> menu_controller_;

View file

@ -17,8 +17,8 @@ class MenuViews : public Menu {
MenuViews(); MenuViews();
protected: protected:
virtual void Popup(Window* window) OVERRIDE; void Popup(Window* window) override;
virtual void PopupAt(Window* window, int x, int y) OVERRIDE; void PopupAt(Window* window, int x, int y) override;
private: private:
void PopupAtPoint(Window* window, const gfx::Point& point); void PopupAtPoint(Window* window, const gfx::Point& point);

View file

@ -24,9 +24,9 @@ class PowerMonitor : public mate::EventEmitter,
virtual ~PowerMonitor(); virtual ~PowerMonitor();
// base::PowerObserver implementations: // base::PowerObserver implementations:
virtual void OnPowerStateChange(bool on_battery_power) OVERRIDE; void OnPowerStateChange(bool on_battery_power) override;
virtual void OnSuspend() OVERRIDE; void OnSuspend() override;
virtual void OnResume() OVERRIDE; void OnResume() override;
private: private:
DISALLOW_COPY_AND_ASSIGN(PowerMonitor); DISALLOW_COPY_AND_ASSIGN(PowerMonitor);

View file

@ -53,7 +53,7 @@ class CustomProtocolRequestJob : public AdapterRequestJob {
} }
// AdapterRequestJob: // AdapterRequestJob:
virtual void GetJobTypeInUI() OVERRIDE { void GetJobTypeInUI() override {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::Isolate* isolate = v8::Isolate::GetCurrent();
@ -128,9 +128,9 @@ class CustomProtocolHandler : public ProtocolHandler {
: registry_(registry), protocol_handler_(protocol_handler) { : registry_(registry), protocol_handler_(protocol_handler) {
} }
virtual net::URLRequestJob* MaybeCreateJob( net::URLRequestJob* MaybeCreateJob(
net::URLRequest* request, net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE { net::NetworkDelegate* network_delegate) const override {
return new CustomProtocolRequestJob(registry_, protocol_handler_.get(), return new CustomProtocolRequestJob(registry_, protocol_handler_.get(),
request, network_delegate); request, network_delegate);
} }

View file

@ -247,14 +247,14 @@ void WebContents::RenderViewReady() {
// WebContents::GetRenderWidgetHostView will return the RWHV of an // WebContents::GetRenderWidgetHostView will return the RWHV of an
// interstitial page if one is showing at this time. We only want opacity // interstitial page if one is showing at this time. We only want opacity
// to apply to web pages. // to apply to web pages.
web_contents()->GetRenderViewHost()->GetView()-> if (guest_opaque_) {
SetBackgroundOpaque(guest_opaque_); web_contents()
->GetRenderViewHost()
content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); ->GetView()
if (auto_size_enabled_) { ->SetBackgroundColorToDefault();
rvh->EnableAutoResize(min_auto_size_, max_auto_size_);
} else { } 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()) if (!web_contents()->GetRenderViewHost()->GetView())
return; 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( mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(

View file

@ -34,10 +34,10 @@ class Event : public Wrappable,
virtual ~Event(); virtual ~Event();
// Wrappable implementations: // Wrappable implementations:
virtual ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate* isolate); ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate* isolate) override;
// content::WebContentsObserver implementations: // content::WebContentsObserver implementations:
virtual void WebContentsDestroyed() OVERRIDE; void WebContentsDestroyed() override;
private: private:
// Replyer for the synchronous messages. // Replyer for the synchronous messages.

View file

@ -17,10 +17,10 @@ class AtomAccessTokenStore : public content::AccessTokenStore {
virtual ~AtomAccessTokenStore(); virtual ~AtomAccessTokenStore();
// content::AccessTokenStore: // content::AccessTokenStore:
virtual void LoadAccessTokens( void LoadAccessTokens(
const LoadAccessTokensCallbackType& callback) OVERRIDE; const LoadAccessTokensCallbackType& callback) override;
virtual void SaveAccessToken(const GURL& server_url, void SaveAccessToken(const GURL& server_url,
const base::string16& access_token) OVERRIDE; const base::string16& access_token) override;
private: private:
DISALLOW_COPY_AND_ASSIGN(AtomAccessTokenStore); DISALLOW_COPY_AND_ASSIGN(AtomAccessTokenStore);

View file

@ -68,8 +68,7 @@ net::URLRequestJobFactory* AtomBrowserContext::CreateURLRequestJobFactory(
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
// Set up interceptors in the reverse order. // Set up interceptors in the reverse order.
scoped_ptr<net::URLRequestJobFactory> top_job_factory = scoped_ptr<net::URLRequestJobFactory> top_job_factory = job_factory.Pass();
job_factory.PassAs<net::URLRequestJobFactory>();
content::URLRequestInterceptorScopedVector::reverse_iterator it; content::URLRequestInterceptorScopedVector::reverse_iterator it;
for (it = interceptors->rbegin(); it != interceptors->rend(); ++it) for (it = interceptors->rbegin(); it != interceptors->rend(); ++it)
top_job_factory.reset(new net::URLRequestInterceptingJobFactory( top_job_factory.reset(new net::URLRequestInterceptingJobFactory(

View file

@ -27,14 +27,14 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
protected: protected:
// Implementations of brightray::BrowserMainParts. // Implementations of brightray::BrowserMainParts.
virtual brightray::BrowserContext* CreateBrowserContext() OVERRIDE; brightray::BrowserContext* CreateBrowserContext() override;
// Implementations of content::BrowserMainParts. // Implementations of content::BrowserMainParts.
virtual void PostEarlyInitialization() OVERRIDE; void PostEarlyInitialization() override;
virtual void PreMainMessageLoopRun() OVERRIDE; void PreMainMessageLoopRun() override;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
virtual void PreMainMessageLoopStart() OVERRIDE; void PreMainMessageLoopStart() override;
virtual void PostDestroyThreads() OVERRIDE; void PostDestroyThreads() override;
#endif #endif
private: private:

View file

@ -14,7 +14,7 @@ namespace atom {
class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager { class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
public: public:
// content::JavaScriptDialogManager implementations. // content::JavaScriptDialogManager implementations.
virtual void RunJavaScriptDialog( void RunJavaScriptDialog(
content::WebContents* web_contents, content::WebContents* web_contents,
const GURL& origin_url, const GURL& origin_url,
const std::string& accept_lang, const std::string& accept_lang,
@ -22,16 +22,15 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
const base::string16& message_text, const base::string16& message_text,
const base::string16& default_prompt_text, const base::string16& default_prompt_text,
const DialogClosedCallback& callback, const DialogClosedCallback& callback,
bool* did_suppress_message) OVERRIDE; bool* did_suppress_message) override;
virtual void RunBeforeUnloadDialog( void RunBeforeUnloadDialog(
content::WebContents* web_contents, content::WebContents* web_contents,
const base::string16& message_text, const base::string16& message_text,
bool is_reload, bool is_reload,
const DialogClosedCallback& callback) OVERRIDE; const DialogClosedCallback& callback) override;
virtual void CancelActiveAndPendingDialogs( void CancelActiveAndPendingDialogs(
content::WebContents* web_contents) OVERRIDE {} content::WebContents* web_contents) override {}
virtual void WebContentsDestroyed( void WebContentsDestroyed(content::WebContents* web_contents) override {}
content::WebContents* web_contents) OVERRIDE {}
}; };
} // namespace atom } // namespace atom

View file

@ -21,7 +21,7 @@
#include "atom/common/native_mate_converters/file_path_converter.h" #include "atom/common/native_mate_converters/file_path_converter.h"
#include "atom/common/options_switches.h" #include "atom/common/options_switches.h"
#include "base/command_line.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/json/json_writer.h"
#include "base/prefs/pref_service.h" #include "base/prefs/pref_service.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
@ -57,6 +57,10 @@
#include "ui/gfx/screen.h" #include "ui/gfx/screen.h"
#include "ui/gfx/size.h" #include "ui/gfx/size.h"
#if defined(OS_WIN)
#include "ui/gfx/switches.h"
#endif
using content::NavigationEntry; using content::NavigationEntry;
using content::RenderWidgetHostView; using content::RenderWidgetHostView;
using content::RenderWidgetHost; using content::RenderWidgetHost;

View file

@ -129,7 +129,7 @@ class NativeWindowClientView : public views::ClientView {
} }
virtual ~NativeWindowClientView() {} virtual ~NativeWindowClientView() {}
virtual bool CanClose() OVERRIDE { bool CanClose() override {
static_cast<NativeWindowViews*>(contents_view())->CloseWebContents(); static_cast<NativeWindowViews*>(contents_view())->CloseWebContents();
return false; return false;
} }

View file

@ -28,16 +28,16 @@ class AdapterRequestJob : public net::URLRequestJob {
public: public:
// net::URLRequestJob: // net::URLRequestJob:
virtual void Start() OVERRIDE; void Start() override;
virtual void Kill() OVERRIDE; void Kill() override;
virtual bool ReadRawData(net::IOBuffer* buf, bool ReadRawData(net::IOBuffer* buf,
int buf_size, int buf_size,
int *bytes_read) OVERRIDE; int *bytes_read) override;
virtual bool IsRedirectResponse(GURL* location, bool IsRedirectResponse(GURL* location,
int* http_status_code) OVERRIDE; int* http_status_code) override;
virtual net::Filter* SetupFilter() const OVERRIDE; net::Filter* SetupFilter() const override;
virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; bool GetMimeType(std::string* mime_type) const override;
virtual bool GetCharset(std::string* charset) OVERRIDE; bool GetCharset(std::string* charset) override;
base::WeakPtr<AdapterRequestJob> GetWeakPtr(); base::WeakPtr<AdapterRequestJob> GetWeakPtr();

View file

@ -27,10 +27,10 @@ class AsarProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
Archive* GetOrCreateAsarArchive(const base::FilePath& path) const; Archive* GetOrCreateAsarArchive(const base::FilePath& path) const;
// net::URLRequestJobFactory::ProtocolHandler: // net::URLRequestJobFactory::ProtocolHandler:
virtual net::URLRequestJob* MaybeCreateJob( net::URLRequestJob* MaybeCreateJob(
net::URLRequest* request, net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE; net::NetworkDelegate* network_delegate) const override;
virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE; bool IsSafeRedirectTarget(const GURL& location) const override;
private: private:
const scoped_refptr<base::TaskRunner> file_task_runner_; const scoped_refptr<base::TaskRunner> file_task_runner_;

View file

@ -32,12 +32,12 @@ class URLRequestAsarJob : public net::URLRequestJob {
const scoped_refptr<base::TaskRunner>& file_task_runner); const scoped_refptr<base::TaskRunner>& file_task_runner);
// net::URLRequestJob: // net::URLRequestJob:
virtual void Start() OVERRIDE; void Start() override;
virtual void Kill() OVERRIDE; void Kill() override;
virtual bool ReadRawData(net::IOBuffer* buf, bool ReadRawData(net::IOBuffer* buf,
int buf_size, int buf_size,
int* bytes_read) OVERRIDE; int* bytes_read) override;
virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; bool GetMimeType(std::string* mime_type) const override;
protected: protected:
virtual ~URLRequestAsarJob(); virtual ~URLRequestAsarJob();

View file

@ -50,7 +50,7 @@ ProtocolHandler* AtomURLRequestJobFactory::ReplaceProtocol(
base::AutoLock locked(lock_); base::AutoLock locked(lock_);
if (!ContainsKey(protocol_handler_map_, scheme)) if (!ContainsKey(protocol_handler_map_, scheme))
return NULL; return nullptr;
ProtocolHandler* original_protocol_handler = protocol_handler_map_[scheme]; ProtocolHandler* original_protocol_handler = protocol_handler_map_[scheme];
protocol_handler_map_[scheme] = protocol_handler; protocol_handler_map_[scheme] = protocol_handler;
return original_protocol_handler; return original_protocol_handler;
@ -63,7 +63,7 @@ ProtocolHandler* AtomURLRequestJobFactory::GetProtocolHandler(
base::AutoLock locked(lock_); base::AutoLock locked(lock_);
ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme); ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme);
if (it == protocol_handler_map_.end()) if (it == protocol_handler_map_.end())
return NULL; return nullptr;
return it->second; return it->second;
} }
@ -82,10 +82,23 @@ net::URLRequestJob* AtomURLRequestJobFactory::MaybeCreateJobWithProtocolHandler(
base::AutoLock locked(lock_); base::AutoLock locked(lock_);
ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme); ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme);
if (it == protocol_handler_map_.end()) if (it == protocol_handler_map_.end())
return NULL; return nullptr;
return it->second->MaybeCreateJob(request, network_delegate); 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( bool AtomURLRequestJobFactory::IsHandledProtocol(
const std::string& scheme) const { const std::string& scheme) const {
DCHECK(CalledOnValidThread()); DCHECK(CalledOnValidThread());

View file

@ -40,13 +40,20 @@ class AtomURLRequestJobFactory : public net::URLRequestJobFactory {
bool HasProtocolHandler(const std::string& scheme) const; bool HasProtocolHandler(const std::string& scheme) const;
// URLRequestJobFactory implementation // URLRequestJobFactory implementation
virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( net::URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme, const std::string& scheme,
net::URLRequest* request, net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE; net::NetworkDelegate* network_delegate) const override;
virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE; net::URLRequestJob* MaybeInterceptRedirect(
virtual bool IsHandledURL(const GURL& url) const OVERRIDE; net::URLRequest* request,
virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE; 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: private:
typedef std::map<std::string, ProtocolHandler*> ProtocolHandlerMap; typedef std::map<std::string, ProtocolHandler*> ProtocolHandlerMap;

View file

@ -20,10 +20,10 @@ class URLRequestStringJob : public net::URLRequestSimpleJob {
const std::string& data); const std::string& data);
// URLRequestSimpleJob: // URLRequestSimpleJob:
virtual int GetData(std::string* mime_type, int GetData(std::string* mime_type,
std::string* charset, std::string* charset,
std::string* data, std::string* data,
const net::CompletionCallback& callback) const OVERRIDE; const net::CompletionCallback& callback) const override;
private: private:
std::string mime_type_; std::string mime_type_;

View file

@ -33,12 +33,12 @@ class NodeDebugger : public net::StreamListenSocket::Delegate {
static void DebugMessageHandler(const v8::Debug::Message& message); static void DebugMessageHandler(const v8::Debug::Message& message);
// net::StreamListenSocket::Delegate: // net::StreamListenSocket::Delegate:
virtual void DidAccept(net::StreamListenSocket* server, void DidAccept(net::StreamListenSocket* server,
scoped_ptr<net::StreamListenSocket> socket) OVERRIDE; scoped_ptr<net::StreamListenSocket> socket) override;
virtual void DidRead(net::StreamListenSocket* socket, void DidRead(net::StreamListenSocket* socket,
const char* data, const char* data,
int len) OVERRIDE; int len) override;
virtual void DidClose(net::StreamListenSocket* socket) OVERRIDE; void DidClose(net::StreamListenSocket* socket) override;
v8::Isolate* isolate_; v8::Isolate* isolate_;

View file

@ -16,7 +16,7 @@
#include "atom/browser/native_window.h" #include "atom/browser/native_window.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/file_util.h" #include "base/files/file_util.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"

View file

@ -8,7 +8,7 @@
#import <CoreServices/CoreServices.h> #import <CoreServices/CoreServices.h>
#include "atom/browser/native_window.h" #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/mac_util.h"
#include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"

View file

@ -10,7 +10,7 @@
#include <shlobj.h> #include <shlobj.h>
#include "atom/browser/native_window_views.h" #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/i18n/case_conversion.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"

View file

@ -22,12 +22,12 @@ class TrayIconCocoa : public TrayIcon {
TrayIconCocoa(); TrayIconCocoa();
virtual ~TrayIconCocoa(); virtual ~TrayIconCocoa();
virtual void SetImage(const gfx::Image& image) OVERRIDE; void SetImage(const gfx::Image& image) override;
virtual void SetPressedImage(const gfx::Image& image) OVERRIDE; void SetPressedImage(const gfx::Image& image) override;
virtual void SetToolTip(const std::string& tool_tip) OVERRIDE; void SetToolTip(const std::string& tool_tip) override;
virtual void SetTitle(const std::string& title) OVERRIDE; void SetTitle(const std::string& title) override;
virtual void SetHighlightMode(bool highlight) OVERRIDE; void SetHighlightMode(bool highlight) override;
virtual void SetContextMenu(ui::SimpleMenuModel* menu_model) OVERRIDE; void SetContextMenu(ui::SimpleMenuModel* menu_model) override;
private: private:
base::scoped_nsobject<NSStatusItem> item_; base::scoped_nsobject<NSStatusItem> item_;

View file

@ -23,14 +23,14 @@ class TrayIconGtk : public TrayIcon,
virtual ~TrayIconGtk(); virtual ~TrayIconGtk();
// TrayIcon: // TrayIcon:
virtual void SetImage(const gfx::Image& image) OVERRIDE; void SetImage(const gfx::Image& image) override;
virtual void SetToolTip(const std::string& tool_tip) OVERRIDE; void SetToolTip(const std::string& tool_tip) override;
virtual void SetContextMenu(ui::SimpleMenuModel* menu_model) OVERRIDE; void SetContextMenu(ui::SimpleMenuModel* menu_model) override;
private: private:
// views::StatusIconLinux::Delegate: // views::StatusIconLinux::Delegate:
virtual void OnClick() OVERRIDE; void OnClick() override;
virtual bool HasClickAction() OVERRIDE; bool HasClickAction() override;
scoped_ptr<views::StatusIconLinux> icon_; scoped_ptr<views::StatusIconLinux> icon_;

View file

@ -37,7 +37,7 @@ SubmenuButton::SubmenuButton(views::ButtonListener* listener,
underline_color_(SK_ColorBLACK) { underline_color_(SK_ColorBLACK) {
#if defined(OS_LINUX) #if defined(OS_LINUX)
// Dont' use native style border. // Dont' use native style border.
SetBorder(CreateDefaultBorder().PassAs<views::Border>()); SetBorder(CreateDefaultBorder().Pass());
#endif #endif
if (GetUnderlinePosition(title, &accelerator_, &underline_start_, if (GetUnderlinePosition(title, &accelerator_, &underline_start_,

View file

@ -12,6 +12,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.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" #include "ui/shell_dialogs/selected_file_info.h"
namespace atom { namespace atom {
@ -26,15 +27,19 @@ WebDialogHelper::~WebDialogHelper() {
void WebDialogHelper::RunFileChooser(content::WebContents* web_contents, void WebDialogHelper::RunFileChooser(content::WebContents* web_contents,
const content::FileChooserParams& params) { const content::FileChooserParams& params) {
std::vector<ui::SelectedFileInfo> result; std::vector<content::FileChooserFileInfo> result;
if (params.mode == content::FileChooserParams::Save) { if (params.mode == content::FileChooserParams::Save) {
base::FilePath path; base::FilePath path;
if (file_dialog::ShowSaveDialog(window_, if (file_dialog::ShowSaveDialog(window_,
base::UTF16ToUTF8(params.title), base::UTF16ToUTF8(params.title),
params.default_file_name, params.default_file_name,
file_dialog::Filters(), file_dialog::Filters(),
&path)) &path)) {
result.push_back(ui::SelectedFileInfo(path, path)); content::FileChooserFileInfo info;
info.file_path = path;
info.display_name = path.BaseName().value();
result.push_back(info);
}
} else { } else {
int flags = file_dialog::FILE_DIALOG_CREATE_DIRECTORY; int flags = file_dialog::FILE_DIALOG_CREATE_DIRECTORY;
switch (params.mode) { switch (params.mode) {
@ -56,9 +61,14 @@ void WebDialogHelper::RunFileChooser(content::WebContents* web_contents,
params.default_file_name, params.default_file_name,
file_dialog::Filters(), file_dialog::Filters(),
flags, flags,
&paths)) &paths)) {
for (auto& path : paths) for (auto& path : paths) {
result.push_back(ui::SelectedFileInfo(path, path)); content::FileChooserFileInfo info;
info.file_path = path;
info.display_name = path.BaseName().value();
result.push_back(info);
}
}
} }
web_contents->GetRenderViewHost()->FilesSelectedInChooser( web_contents->GetRenderViewHost()->FilesSelectedInChooser(

View file

@ -58,6 +58,9 @@ void AtomBindings::BindTo(v8::Isolate* isolate,
dict.SetMethod("activateUvLoop", dict.SetMethod("activateUvLoop",
base::Bind(&AtomBindings::ActivateUVLoop, base::Unretained(this))); base::Bind(&AtomBindings::ActivateUVLoop, base::Unretained(this)));
// Do not warn about deprecated APIs.
dict.Set("noDeprecation", true);
mate::Dictionary versions; mate::Dictionary versions;
if (dict.Get("versions", &versions)) { if (dict.Get("versions", &versions)) {
versions.Set("atom-shell", ATOM_VERSION_STRING); versions.Set("atom-shell", ATOM_VERSION_STRING);

View file

@ -6,7 +6,7 @@
#include <vector> #include <vector>
#include "base/file_util.h" #include "base/files/file_util.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
namespace asar { namespace asar {

View file

@ -8,7 +8,7 @@
#ifndef ATOM_COMMON_CHROME_VERSION_H_ #ifndef ATOM_COMMON_CHROME_VERSION_H_
#define 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 #define CHROME_VERSION "v" CHROME_VERSION_STRING
#endif // ATOM_COMMON_CHROME_VERSION_H_ #endif // ATOM_COMMON_CHROME_VERSION_H_

View file

@ -25,13 +25,13 @@ class CrashReporterLinux : public CrashReporter {
public: public:
static CrashReporterLinux* GetInstance(); static CrashReporterLinux* GetInstance();
virtual void InitBreakpad(const std::string& product_name, void InitBreakpad(const std::string& product_name,
const std::string& version, const std::string& version,
const std::string& company_name, const std::string& company_name,
const std::string& submit_url, const std::string& submit_url,
bool auto_submit, bool auto_submit,
bool skip_system_crash_handler) OVERRIDE; bool skip_system_crash_handler) override;
virtual void SetUploadParameters() OVERRIDE; void SetUploadParameters() override;
private: private:
friend struct DefaultSingletonTraits<CrashReporterLinux>; friend struct DefaultSingletonTraits<CrashReporterLinux>;

View file

@ -19,13 +19,13 @@ class CrashReporterMac : public CrashReporter {
public: public:
static CrashReporterMac* GetInstance(); static CrashReporterMac* GetInstance();
virtual void InitBreakpad(const std::string& product_name, void InitBreakpad(const std::string& product_name,
const std::string& version, const std::string& version,
const std::string& company_name, const std::string& company_name,
const std::string& submit_url, const std::string& submit_url,
bool auto_submit, bool auto_submit,
bool skip_system_crash_handler) OVERRIDE; bool skip_system_crash_handler) override;
virtual void SetUploadParameters() OVERRIDE; void SetUploadParameters() override;
private: private:
friend struct DefaultSingletonTraits<CrashReporterMac>; friend struct DefaultSingletonTraits<CrashReporterMac>;

View file

@ -6,7 +6,7 @@
#include <string> #include <string>
#include "base/file_util.h" #include "base/files/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"

View file

@ -21,13 +21,13 @@ class CrashReporterWin : public CrashReporter {
public: public:
static CrashReporterWin* GetInstance(); static CrashReporterWin* GetInstance();
virtual void InitBreakpad(const std::string& product_name, void InitBreakpad(const std::string& product_name,
const std::string& version, const std::string& version,
const std::string& company_name, const std::string& company_name,
const std::string& submit_url, const std::string& submit_url,
bool auto_submit, bool auto_submit,
bool skip_system_crash_handler) OVERRIDE; bool skip_system_crash_handler) override;
virtual void SetUploadParameters() OVERRIDE; void SetUploadParameters() override;
private: private:
friend struct DefaultSingletonTraits<CrashReporterWin>; friend struct DefaultSingletonTraits<CrashReporterWin>;

View file

@ -11,7 +11,7 @@
#include <map> #include <map>
#include "base/command_line.h" #include "base/command_line.h"
#include "base/file_util.h" #include "base/files/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/time/time.h" #include "base/time/time.h"

View file

@ -7,7 +7,7 @@
#include "atom/common/crash_reporter/win/crash_service.h" #include "atom/common/crash_reporter/win/crash_service.h"
#include "base/at_exit.h" #include "base/at_exit.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/file_util.h" #include "base/files/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"

View file

@ -8,7 +8,7 @@
#include <vector> #include <vector>
#include "atom/common/native_mate_converters/file_path_converter.h" #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 "base/strings/string_util.h"
#include "ui/gfx/codec/jpeg_codec.h" #include "ui/gfx/codec/jpeg_codec.h"
#include "ui/gfx/codec/png_codec.h" #include "ui/gfx/codec/png_codec.h"

View file

@ -225,7 +225,7 @@ void NodeBindings::UvRunOnce() {
v8::Context::Scope context_scope(env->context()); v8::Context::Scope context_scope(env->context());
// Deal with uv events. // 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) if (r == 0 || uv_loop_->stop_flag != 0)
message_loop_->QuitWhenIdle(); // Quit from uv. message_loop_->QuitWhenIdle(); // Quit from uv.

View file

@ -6,7 +6,7 @@
#include <stdio.h> #include <stdio.h>
#include "base/file_util.h" #include "base/files/file_util.h"
#include "base/process/kill.h" #include "base/process/kill.h"
#include "base/process/launch.h" #include "base/process/launch.h"
#include "url/gurl.h" #include "url/gurl.h"

View file

@ -26,9 +26,9 @@ class AtomRenderViewObserver : public content::RenderViewObserver {
private: private:
// content::RenderViewObserver implementation. // content::RenderViewObserver implementation.
virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) OVERRIDE; void DidCreateDocumentElement(blink::WebLocalFrame* frame) override;
virtual void DraggableRegionsChanged(blink::WebFrame* frame) OVERRIDE; void DraggableRegionsChanged(blink::WebFrame* frame) override;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; bool OnMessageReceived(const IPC::Message& message) override;
void OnBrowserMessage(const base::string16& channel, void OnBrowserMessage(const base::string16& channel,
const base::ListValue& args); const base::ListValue& args);

View file

@ -41,12 +41,12 @@ class GlobalShortcutListenerMac : public GlobalShortcutListener {
bool OnMediaOrVolumeKeyEvent(int key_code); bool OnMediaOrVolumeKeyEvent(int key_code);
// GlobalShortcutListener implementation. // GlobalShortcutListener implementation.
virtual void StartListening() OVERRIDE; virtual void StartListening() override;
virtual void StopListening() OVERRIDE; virtual void StopListening() override;
virtual bool RegisterAcceleratorImpl( virtual bool RegisterAcceleratorImpl(
const ui::Accelerator& accelerator) OVERRIDE; const ui::Accelerator& accelerator) override;
virtual void UnregisterAcceleratorImpl( virtual void UnregisterAcceleratorImpl(
const ui::Accelerator& accelerator) OVERRIDE; const ui::Accelerator& accelerator) override;
// Mac-specific functions for registering hot keys with modifiers. // Mac-specific functions for registering hot keys with modifiers.
bool RegisterHotKey(const ui::Accelerator& accelerator, KeyId hot_key_id); bool RegisterHotKey(const ui::Accelerator& accelerator, KeyId hot_key_id);

View file

@ -26,15 +26,15 @@ class GlobalShortcutListenerWin : public GlobalShortcutListener,
virtual void OnWndProc(HWND hwnd, virtual void OnWndProc(HWND hwnd,
UINT message, UINT message,
WPARAM wparam, WPARAM wparam,
LPARAM lparam) OVERRIDE; LPARAM lparam) override;
// GlobalShortcutListener implementation. // GlobalShortcutListener implementation.
virtual void StartListening() OVERRIDE; virtual void StartListening() override;
virtual void StopListening() OVERRIDE; virtual void StopListening() override;
virtual bool RegisterAcceleratorImpl( virtual bool RegisterAcceleratorImpl(
const ui::Accelerator& accelerator) OVERRIDE; const ui::Accelerator& accelerator) override;
virtual void UnregisterAcceleratorImpl( virtual void UnregisterAcceleratorImpl(
const ui::Accelerator& accelerator) OVERRIDE; const ui::Accelerator& accelerator) override;
// Whether this object is listening for global shortcuts. // Whether this object is listening for global shortcuts.
bool is_listening_; bool is_listening_;

View file

@ -23,17 +23,17 @@ class GlobalShortcutListenerX11 : public GlobalShortcutListener,
virtual ~GlobalShortcutListenerX11(); virtual ~GlobalShortcutListenerX11();
// ui::PlatformEventDispatcher implementation. // ui::PlatformEventDispatcher implementation.
virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE; virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE; virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
private: private:
// GlobalShortcutListener implementation. // GlobalShortcutListener implementation.
virtual void StartListening() OVERRIDE; virtual void StartListening() override;
virtual void StopListening() OVERRIDE; virtual void StopListening() override;
virtual bool RegisterAcceleratorImpl( virtual bool RegisterAcceleratorImpl(
const ui::Accelerator& accelerator) OVERRIDE; const ui::Accelerator& accelerator) override;
virtual void UnregisterAcceleratorImpl( virtual void UnregisterAcceleratorImpl(
const ui::Accelerator& accelerator) OVERRIDE; const ui::Accelerator& accelerator) override;
// Invoked when a global shortcut is pressed. // Invoked when a global shortcut is pressed.
void OnXKeyPressEvent(::XEvent* x_event); void OnXKeyPressEvent(::XEvent* x_event);

View file

@ -51,14 +51,14 @@ class PrintJob : public PrintJobWorkerOwner,
// content::NotificationObserver implementation. // content::NotificationObserver implementation.
virtual void Observe(int type, virtual void Observe(int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE; const content::NotificationDetails& details) override;
// PrintJobWorkerOwner implementation. // PrintJobWorkerOwner implementation.
virtual void GetSettingsDone(const PrintSettings& new_settings, virtual void GetSettingsDone(const PrintSettings& new_settings,
PrintingContext::Result result) OVERRIDE; PrintingContext::Result result) override;
virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) OVERRIDE; virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) override;
virtual const PrintSettings& settings() const OVERRIDE; virtual const PrintSettings& settings() const override;
virtual int cookie() const OVERRIDE; virtual int cookie() const override;
// Starts the actual printing. Signals the worker that it should begin to // Starts the actual printing. Signals the worker that it should begin to
// spool as soon as data is available. // spool as soon as data is available.

View file

@ -66,7 +66,7 @@ class PrintJobManager : public content::NotificationObserver {
// content::NotificationObserver // content::NotificationObserver
virtual void Observe(int type, virtual void Observe(int type,
const content::NotificationSource& source, 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 // Returns queries queue. Never returns NULL. Must be called on Browser UI
// Thread. Reference could be stored and used from any thread. // Thread. Reference could be stored and used from any thread.

View file

@ -40,8 +40,8 @@ class PrintingContextDelegate : public PrintingContext::Delegate {
PrintingContextDelegate(int render_process_id, int render_view_id); PrintingContextDelegate(int render_process_id, int render_view_id);
virtual ~PrintingContextDelegate(); virtual ~PrintingContextDelegate();
virtual gfx::NativeView GetParentView() OVERRIDE; virtual gfx::NativeView GetParentView() override;
virtual std::string GetAppLocale() OVERRIDE; virtual std::string GetAppLocale() override;
private: private:
int render_process_id_; int render_process_id_;

View file

@ -144,7 +144,7 @@ void PrintViewManagerBase::OnDidPrintPage(
#if !defined(OS_WIN) #if !defined(OS_WIN)
// Update the rendered document. It will send notifications to the listener. // Update the rendered document. It will send notifications to the listener.
document->SetPage(params.page_number, document->SetPage(params.page_number,
metafile.PassAs<MetafilePlayer>(), metafile.Pass(),
params.page_size, params.page_size,
params.content_area); params.content_area);

View file

@ -43,7 +43,7 @@ class PrintViewManagerBase : public content::NotificationObserver,
#endif // !DISABLE_BASIC_PRINTING #endif // !DISABLE_BASIC_PRINTING
// PrintedPagesSource implementation. // PrintedPagesSource implementation.
virtual base::string16 RenderSourceName() OVERRIDE; virtual base::string16 RenderSourceName() override;
protected: protected:
explicit PrintViewManagerBase(content::WebContents* web_contents); explicit PrintViewManagerBase(content::WebContents* web_contents);
@ -52,10 +52,10 @@ class PrintViewManagerBase : public content::NotificationObserver,
bool PrintNowInternal(IPC::Message* message); bool PrintNowInternal(IPC::Message* message);
// Terminates or cancels the print job if one was pending. // 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. // content::WebContentsObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) override;
// IPC Message handlers. // IPC Message handlers.
virtual void OnPrintingFailed(int cookie); virtual void OnPrintingFailed(int cookie);
@ -64,10 +64,10 @@ class PrintViewManagerBase : public content::NotificationObserver,
// content::NotificationObserver implementation. // content::NotificationObserver implementation.
virtual void Observe(int type, virtual void Observe(int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE; const content::NotificationDetails& details) override;
// Cancels the print job. // Cancels the print job.
virtual void NavigationStopped() OVERRIDE; virtual void NavigationStopped() override;
// IPC Message handlers. // IPC Message handlers.
void OnDidGetPrintedPagesCount(int cookie, int number_pages); void OnDidGetPrintedPagesCount(int cookie, int number_pages);

View file

@ -32,10 +32,10 @@ class PrintViewManagerBasic
// content::WebContentsObserver implementation. // content::WebContentsObserver implementation.
// Terminates or cancels the print job if one was pending. // 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. // content::WebContentsObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) override;
#endif #endif
private: private:
@ -43,7 +43,7 @@ class PrintViewManagerBasic
friend class content::WebContentsUserData<PrintViewManagerBasic>; friend class content::WebContentsUserData<PrintViewManagerBasic>;
#if defined(OS_ANDROID) #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. // The file descriptor into which the PDF of the page will be written.
base::FileDescriptor file_descriptor_; base::FileDescriptor file_descriptor_;

View file

@ -33,10 +33,10 @@ class PrinterQuery : public PrintJobWorkerOwner {
// PrintJobWorkerOwner implementation. // PrintJobWorkerOwner implementation.
virtual void GetSettingsDone(const PrintSettings& new_settings, virtual void GetSettingsDone(const PrintSettings& new_settings,
PrintingContext::Result result) OVERRIDE; PrintingContext::Result result) override;
virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) OVERRIDE; virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) override;
virtual const PrintSettings& settings() const OVERRIDE; virtual const PrintSettings& settings() const override;
virtual int cookie() const OVERRIDE; virtual int cookie() const override;
// Initializes the printing context. It is fine to call this function multiple // Initializes the printing context. It is fine to call this function multiple
// times to reinitialize the settings. |web_contents_observer| can be queried // times to reinitialize the settings. |web_contents_observer| can be queried

View file

@ -40,10 +40,10 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {
PrintingMessageFilter(int render_process_id); PrintingMessageFilter(int render_process_id);
// content::BrowserMessageFilter methods. // content::BrowserMessageFilter methods.
virtual void OverrideThreadForMessage( void OverrideThreadForMessage(
const IPC::Message& message, const IPC::Message& message,
content::BrowserThread::ID* thread) OVERRIDE; content::BrowserThread::ID* thread) override;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; bool OnMessageReceived(const IPC::Message& message) override;
private: private:
virtual ~PrintingMessageFilter(); virtual ~PrintingMessageFilter();

View file

@ -29,26 +29,26 @@ class TtsControllerImpl : public TtsController {
static TtsControllerImpl* GetInstance(); static TtsControllerImpl* GetInstance();
// TtsController methods // TtsController methods
virtual bool IsSpeaking() OVERRIDE; virtual bool IsSpeaking() override;
virtual void SpeakOrEnqueue(Utterance* utterance) OVERRIDE; virtual void SpeakOrEnqueue(Utterance* utterance) override;
virtual void Stop() OVERRIDE; virtual void Stop() override;
virtual void Pause() OVERRIDE; virtual void Pause() override;
virtual void Resume() OVERRIDE; virtual void Resume() override;
virtual void OnTtsEvent(int utterance_id, virtual void OnTtsEvent(int utterance_id,
TtsEventType event_type, TtsEventType event_type,
int char_index, int char_index,
const std::string& error_message) OVERRIDE; const std::string& error_message) override;
virtual void GetVoices(content::BrowserContext* browser_context, virtual void GetVoices(content::BrowserContext* browser_context,
std::vector<VoiceData>* out_voices) OVERRIDE; std::vector<VoiceData>* out_voices) override;
virtual void VoicesChanged() OVERRIDE; virtual void VoicesChanged() override;
virtual void AddVoicesChangedDelegate( virtual void AddVoicesChangedDelegate(
VoicesChangedDelegate* delegate) OVERRIDE; VoicesChangedDelegate* delegate) override;
virtual void RemoveVoicesChangedDelegate( virtual void RemoveVoicesChangedDelegate(
VoicesChangedDelegate* delegate) OVERRIDE; VoicesChangedDelegate* delegate) override;
virtual void SetTtsEngineDelegate(TtsEngineDelegate* delegate) OVERRIDE; virtual void SetTtsEngineDelegate(TtsEngineDelegate* delegate) override;
virtual TtsEngineDelegate* GetTtsEngineDelegate() OVERRIDE; virtual TtsEngineDelegate* GetTtsEngineDelegate() override;
virtual void SetPlatformImpl(TtsPlatformImpl* platform_impl) OVERRIDE; virtual void SetPlatformImpl(TtsPlatformImpl* platform_impl) override;
virtual int QueueSize() OVERRIDE; virtual int QueueSize() override;
protected: protected:
TtsControllerImpl(); TtsControllerImpl();

View file

@ -32,18 +32,18 @@ struct SPDChromeVoice {
class TtsPlatformImplLinux : public TtsPlatformImpl { class TtsPlatformImplLinux : public TtsPlatformImpl {
public: public:
virtual bool PlatformImplAvailable() OVERRIDE; virtual bool PlatformImplAvailable() override;
virtual bool Speak( virtual bool Speak(
int utterance_id, int utterance_id,
const std::string& utterance, const std::string& utterance,
const std::string& lang, const std::string& lang,
const VoiceData& voice, 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<VoiceData>* out_voices) OVERRIDE; virtual void GetVoices(std::vector<VoiceData>* out_voices) override;
void OnSpeechEvent(SPDNotificationType type); void OnSpeechEvent(SPDNotificationType type);

View file

@ -49,7 +49,7 @@ class TtsPlatformImplMac;
class TtsPlatformImplMac : public TtsPlatformImpl { class TtsPlatformImplMac : public TtsPlatformImpl {
public: public:
virtual bool PlatformImplAvailable() OVERRIDE { virtual bool PlatformImplAvailable() override {
return true; return true;
} }
@ -58,17 +58,17 @@ class TtsPlatformImplMac : public TtsPlatformImpl {
const std::string& utterance, const std::string& utterance,
const std::string& lang, const std::string& lang,
const VoiceData& voice, 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<VoiceData>* out_voices) OVERRIDE; virtual void GetVoices(std::vector<VoiceData>* out_voices) override;
// Called by ChromeTtsDelegate when we get a callback from the // Called by ChromeTtsDelegate when we get a callback from the
// native speech engine. // native speech engine.

View file

@ -23,21 +23,21 @@ class TtsMessageFilter
content::BrowserContext* browser_context); content::BrowserContext* browser_context);
// content::BrowserMessageFilter implementation. // content::BrowserMessageFilter implementation.
virtual void OverrideThreadForMessage( void OverrideThreadForMessage(
const IPC::Message& message, const IPC::Message& message,
content::BrowserThread::ID* thread) OVERRIDE; content::BrowserThread::ID* thread) override;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; bool OnMessageReceived(const IPC::Message& message) override;
virtual void OnChannelClosing() OVERRIDE; void OnChannelClosing() override;
virtual void OnDestruct() const OVERRIDE; void OnDestruct() const override;
// UtteranceEventDelegate implementation. // UtteranceEventDelegate implementation.
virtual void OnTtsEvent(Utterance* utterance, void OnTtsEvent(Utterance* utterance,
TtsEventType event_type, TtsEventType event_type,
int char_index, int char_index,
const std::string& error_message) OVERRIDE; const std::string& error_message) override;
// VoicesChangedDelegate implementation. // VoicesChangedDelegate implementation.
virtual void OnVoicesChanged() OVERRIDE; void OnVoicesChanged() override;
private: private:
friend class content::BrowserThread; friend class content::BrowserThread;

View file

@ -34,7 +34,7 @@ class TtsPlatformImplWin : public TtsPlatformImpl {
virtual bool IsSpeaking(); virtual bool IsSpeaking();
virtual void GetVoices(std::vector<VoiceData>* out_voices) OVERRIDE; virtual void GetVoices(std::vector<VoiceData>* out_voices) override;
// Get the single instance of this class. // Get the single instance of this class.
static TtsPlatformImplWin* GetInstance(); static TtsPlatformImplWin* GetInstance();

View file

@ -45,8 +45,8 @@ class ColorChooserMac : public content::ColorChooser {
void DidChooseColorInColorPanel(SkColor color); void DidChooseColorInColorPanel(SkColor color);
void DidCloseColorPabel(); void DidCloseColorPabel();
virtual void End() OVERRIDE; virtual void End() override;
virtual void SetSelectedColor(SkColor color) OVERRIDE; virtual void SetSelectedColor(SkColor color) override;
private: private:
static ColorChooserMac* current_color_chooser_; static ColorChooserMac* current_color_chooser_;

View file

@ -31,12 +31,12 @@ class ColorChooserAura : public content::ColorChooser,
ColorChooserAura(content::WebContents* web_contents, SkColor initial_color); ColorChooserAura(content::WebContents* web_contents, SkColor initial_color);
// content::ColorChooser overrides: // content::ColorChooser overrides:
virtual void End() OVERRIDE; virtual void End() override;
virtual void SetSelectedColor(SkColor color) OVERRIDE; virtual void SetSelectedColor(SkColor color) override;
// views::ColorChooserListener overrides: // views::ColorChooserListener overrides:
virtual void OnColorChosen(SkColor color) OVERRIDE; virtual void OnColorChosen(SkColor color) override;
virtual void OnColorChooserDialogClosed() OVERRIDE; virtual void OnColorChooserDialogClosed() override;
void DidEndColorChooser(); void DidEndColorChooser();

View file

@ -26,8 +26,8 @@ class ColorChooserDialog
virtual ~ColorChooserDialog(); virtual ~ColorChooserDialog();
// BaseShellDialog: // BaseShellDialog:
virtual bool IsRunning(gfx::NativeWindow owning_window) const OVERRIDE; virtual bool IsRunning(gfx::NativeWindow owning_window) const override;
virtual void ListenerDestroyed() OVERRIDE; virtual void ListenerDestroyed() override;
private: private:
struct ExecuteOpenParams { struct ExecuteOpenParams {

View file

@ -24,8 +24,8 @@ class ColorChooserWin : public content::ColorChooser,
~ColorChooserWin(); ~ColorChooserWin();
// content::ColorChooser overrides: // content::ColorChooser overrides:
virtual void End() OVERRIDE; virtual void End() override;
virtual void SetSelectedColor(SkColor color) OVERRIDE {} virtual void SetSelectedColor(SkColor color) override {}
// views::ColorChooserListener overrides: // views::ColorChooserListener overrides:
virtual void OnColorChosen(SkColor color); virtual void OnColorChosen(SkColor color);

View file

@ -79,9 +79,9 @@ class PrintWebViewHelper
}; };
// RenderViewObserver implementation. // RenderViewObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) override;
virtual void PrintPage(blink::WebLocalFrame* frame, virtual void PrintPage(blink::WebLocalFrame* frame,
bool user_initiated) OVERRIDE; bool user_initiated) override;
// Message handlers --------------------------------------------------------- // Message handlers ---------------------------------------------------------
#if !defined(DISABLE_BASIC_PRINTING) #if !defined(DISABLE_BASIC_PRINTING)

View file

@ -37,15 +37,15 @@ class TtsDispatcher
virtual ~TtsDispatcher(); virtual ~TtsDispatcher();
// RenderProcessObserver override. // RenderProcessObserver override.
virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; virtual bool OnControlMessageReceived(const IPC::Message& message) override;
// blink::WebSpeechSynthesizer implementation. // blink::WebSpeechSynthesizer implementation.
virtual void updateVoiceList() OVERRIDE; virtual void updateVoiceList() override;
virtual void speak(const blink::WebSpeechSynthesisUtterance& utterance) virtual void speak(const blink::WebSpeechSynthesisUtterance& utterance)
OVERRIDE; override;
virtual void pause() OVERRIDE; virtual void pause() override;
virtual void resume() OVERRIDE; virtual void resume() override;
virtual void cancel() OVERRIDE; virtual void cancel() override;
blink::WebSpeechSynthesisUtterance FindUtterance(int utterance_id); blink::WebSpeechSynthesisUtterance FindUtterance(int utterance_id);

View file

@ -10,7 +10,7 @@
], ],
"devDependencies": { "devDependencies": {
"atom-package-manager": "0.122.0", "atom-package-manager": "0.126.0",
"coffee-script": "~1.7.1", "coffee-script": "~1.7.1",
"coffeelint": "~1.3.0", "coffeelint": "~1.3.0",
"request": "*" "request": "*"

View file

@ -6,12 +6,11 @@ import re
import shutil import shutil
import subprocess import subprocess
import sys import sys
import tarfile
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \ from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \
DIST_ARCH DIST_ARCH
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \ 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() 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__))) SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release') 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 = { SYMBOL_NAME = {
'darwin': 'libchromiumcontent.dylib.dSYM', 'darwin': 'libchromiumcontent.dylib.dSYM',
@ -76,23 +72,6 @@ SYSTEM_LIBRARIES = [
'libnotify.so', '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(): def main():
rm_rf(DIST_DIR) rm_rf(DIST_DIR)
@ -105,7 +84,6 @@ def main():
create_symbols() create_symbols()
copy_binaries() copy_binaries()
copy_chromedriver() copy_chromedriver()
copy_headers()
copy_license() copy_license()
if TARGET_PLATFORM == 'linux': if TARGET_PLATFORM == 'linux':
@ -115,7 +93,6 @@ def main():
create_dist_zip() create_dist_zip()
create_chromedriver_zip() create_chromedriver_zip()
create_symbols_zip() create_symbols_zip()
create_header_tarball()
def parse_args(): def parse_args():
@ -153,33 +130,6 @@ def copy_chromedriver():
shutil.copy2(os.path.join(OUT_DIR, binary), DIST_DIR) 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(): def copy_license():
shutil.copy2(os.path.join(SOURCE_ROOT, 'LICENSE'), DIST_DIR) shutil.copy2(os.path.join(SOURCE_ROOT, 'LICENSE'), DIST_DIR)
@ -269,19 +219,5 @@ def create_symbols_zip():
make_zip(zip_file, files, dirs) 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__': if __name__ == '__main__':
sys.exit(main()) sys.exit(main())

View file

@ -4,7 +4,7 @@ import platform
import sys import sys
BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '6300862b4b16bd171f00ae566b697098c29743f7' LIBCHROMIUMCONTENT_COMMIT = '103778aa0ec3772f88e915ca9efdb941afdc85cf'
ARCH = { ARCH = {
'cygwin': '32bit', 'cygwin': '32bit',

147
script/upload-node-headers.py Executable file
View file

@ -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())

View file

@ -2,7 +2,6 @@
import argparse import argparse
import errno import errno
import glob
import os import os
import subprocess import subprocess
import sys import sys
@ -10,8 +9,7 @@ import tempfile
from lib.config import DIST_ARCH, TARGET_PLATFORM from lib.config import DIST_ARCH, TARGET_PLATFORM
from lib.util import execute, get_atom_shell_version, parse_version, \ from lib.util import execute, get_atom_shell_version, parse_version, \
get_chromedriver_version, scoped_cwd, safe_mkdir, \ get_chromedriver_version, scoped_cwd
s3_config, s3put
from lib.github import GitHub from lib.github import GitHub
@ -60,20 +58,16 @@ def main():
os.path.join(DIST_DIR, CHROMEDRIVER_NAME)) os.path.join(DIST_DIR, CHROMEDRIVER_NAME))
if args.publish_release: 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': if TARGET_PLATFORM == 'win32':
# Upload PDBs to Windows symbol server.
execute([sys.executable, execute([sys.executable,
os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')]) 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. # Press the publish button.
publish_release(github, release_id) 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) 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(): def auth_token():
token = os.environ.get('ATOM_SHELL_GITHUB_TOKEN') token = os.environ.get('ATOM_SHELL_GITHUB_TOKEN')
message = ('Error: Please set the $ATOM_SHELL_GITHUB_TOKEN ' message = ('Error: Please set the $ATOM_SHELL_GITHUB_TOKEN '
@ -208,13 +170,6 @@ def auth_token():
return 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__': if __name__ == '__main__':
import sys import sys
sys.exit(main()) sys.exit(main())

2
vendor/brightray vendored

@ -1 +1 @@
Subproject commit a45009446ac3279b385b1de1f3226251e7f0e634 Subproject commit c96ee1ee1e2d1322c4d73be18f28c232587a43a2

2
vendor/node vendored

@ -1 +1 @@
Subproject commit 296b2c198be867ed89144acb20bd3570ce375cf5 Subproject commit 70498428ced2b8ae4ce020051f06d104b5c6c4de