diff --git a/.node-version b/.node-version index ed15bef9ae2..dffc266d6a8 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -v6.1.0 +v6.3.0 diff --git a/atom/app/atom_main.cc b/atom/app/atom_main.cc index a3e70270026..387b5167f3f 100644 --- a/atom/app/atom_main.cc +++ b/atom/app/atom_main.cc @@ -19,7 +19,6 @@ #include "base/win/windows_version.h" #include "content/public/app/sandbox_helper_win.h" #include "sandbox/win/src/sandbox_types.h" -#include "ui/gfx/win/dpi.h" #elif defined(OS_LINUX) // defined(OS_WIN) #include "atom/app/atom_main_delegate.h" // NOLINT #include "content/public/app/content_main.h" diff --git a/atom/app/node_main.cc b/atom/app/node_main.cc index 6f71d39f574..040b4b61572 100644 --- a/atom/app/node_main.cc +++ b/atom/app/node_main.cc @@ -7,14 +7,15 @@ #include "atom/app/uv_task_runner.h" #include "atom/browser/javascript_environment.h" #include "atom/browser/node_debugger.h" -#include "atom/common/node_includes.h" #include "base/command_line.h" #include "base/feature_list.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "gin/array_buffer.h" #include "gin/public/isolate_holder.h" #include "gin/v8_initializer.h" +#include "atom/common/node_includes.h" + namespace atom { int NodeMain(int argc, char *argv[]) { @@ -69,7 +70,7 @@ int NodeMain(int argc, char *argv[]) { exit_code = node::EmitExit(env); node::RunAtExit(env); - env->Dispose(); + node::FreeEnvironment(env); } v8::V8::Dispose(); diff --git a/atom/browser/api/atom_api_cookies.cc b/atom/browser/api/atom_api_cookies.cc index 919a4bff6fe..4ee2190219d 100644 --- a/atom/browser/api/atom_api_cookies.cc +++ b/atom/browser/api/atom_api_cookies.cc @@ -4,6 +4,7 @@ #include "atom/browser/api/atom_api_cookies.h" +#include "atom/browser/atom_browser_context.h" #include "atom/common/native_mate_converters/callback.h" #include "atom/common/native_mate_converters/gurl_converter.h" #include "atom/common/native_mate_converters/value_converter.h" @@ -204,8 +205,8 @@ void SetCookieOnIO(scoped_refptr getter, } // namespace Cookies::Cookies(v8::Isolate* isolate, - content::BrowserContext* browser_context) - : request_context_getter_(browser_context->GetRequestContext()) { + AtomBrowserContext* browser_context) + : request_context_getter_(browser_context->url_request_context_getter()) { Init(isolate); } @@ -241,7 +242,7 @@ void Cookies::Set(const base::DictionaryValue& details, // static mate::Handle Cookies::Create( v8::Isolate* isolate, - content::BrowserContext* browser_context) { + AtomBrowserContext* browser_context) { return mate::CreateHandle(isolate, new Cookies(isolate, browser_context)); } diff --git a/atom/browser/api/atom_api_cookies.h b/atom/browser/api/atom_api_cookies.h index 33fee56960f..ce20c775975 100644 --- a/atom/browser/api/atom_api_cookies.h +++ b/atom/browser/api/atom_api_cookies.h @@ -16,16 +16,14 @@ namespace base { class DictionaryValue; } -namespace content { -class BrowserContext; -} - namespace net { class URLRequestContextGetter; } namespace atom { +class AtomBrowserContext; + namespace api { class Cookies : public mate::TrackableObject { @@ -39,14 +37,14 @@ class Cookies : public mate::TrackableObject { using SetCallback = base::Callback; static mate::Handle Create(v8::Isolate* isolate, - content::BrowserContext* browser_context); + AtomBrowserContext* browser_context); // mate::TrackableObject: static void BuildPrototype(v8::Isolate* isolate, v8::Local prototype); protected: - Cookies(v8::Isolate* isolate, content::BrowserContext* browser_context); + Cookies(v8::Isolate* isolate, AtomBrowserContext* browser_context); ~Cookies() override; void Get(const base::DictionaryValue& filter, const GetCallback& callback); diff --git a/atom/browser/api/atom_api_menu.h b/atom/browser/api/atom_api_menu.h index 9f24f758489..e04d189efc1 100644 --- a/atom/browser/api/atom_api_menu.h +++ b/atom/browser/api/atom_api_menu.h @@ -5,13 +5,13 @@ #ifndef ATOM_BROWSER_API_ATOM_API_MENU_H_ #define ATOM_BROWSER_API_ATOM_API_MENU_H_ +#include #include #include "atom/browser/api/atom_api_window.h" #include "atom/browser/api/trackable_object.h" #include "atom/browser/ui/atom_menu_model.h" #include "base/callback.h" -#include "base/memory/scoped_ptr.h" namespace atom { diff --git a/atom/browser/api/atom_api_menu_views.cc b/atom/browser/api/atom_api_menu_views.cc index ceee46360d7..a6fd8024ab2 100644 --- a/atom/browser/api/atom_api_menu_views.cc +++ b/atom/browser/api/atom_api_menu_views.cc @@ -7,7 +7,7 @@ #include "atom/browser/native_window_views.h" #include "atom/browser/unresponsive_suppressor.h" #include "content/public/browser/render_widget_host_view.h" -#include "ui/gfx/screen.h" +#include "ui/display/screen.h" #include "ui/views/controls/menu/menu_runner.h" namespace atom { @@ -31,7 +31,7 @@ void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item) { // (-1, -1) means showing on mouse location. gfx::Point location; if (x == -1 || y == -1) { - location = gfx::Screen::GetScreen()->GetCursorScreenPoint(); + location = display::Screen::GetScreen()->GetCursorScreenPoint(); } else { gfx::Point origin = view->GetViewBounds().origin(); location = gfx::Point(origin.x() + x, origin.y() + y); diff --git a/atom/browser/api/atom_api_menu_views.h b/atom/browser/api/atom_api_menu_views.h index 9a7a740182d..9b4ddf77f2a 100644 --- a/atom/browser/api/atom_api_menu_views.h +++ b/atom/browser/api/atom_api_menu_views.h @@ -6,7 +6,7 @@ #define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_ #include "atom/browser/api/atom_api_menu.h" -#include "ui/gfx/screen.h" +#include "ui/display/screen.h" namespace atom { diff --git a/atom/browser/api/atom_api_power_save_blocker.h b/atom/browser/api/atom_api_power_save_blocker.h index a20b493e75b..ee1e0e3213a 100644 --- a/atom/browser/api/atom_api_power_save_blocker.h +++ b/atom/browser/api/atom_api_power_save_blocker.h @@ -6,9 +6,9 @@ #define ATOM_BROWSER_API_ATOM_API_POWER_SAVE_BLOCKER_H_ #include +#include #include "atom/browser/api/trackable_object.h" -#include "base/memory/scoped_ptr.h" #include "content/public/browser/power_save_blocker.h" #include "native_mate/handle.h" diff --git a/atom/browser/api/atom_api_protocol.cc b/atom/browser/api/atom_api_protocol.cc index 6f4f158073d..4019a96f2a6 100644 --- a/atom/browser/api/atom_api_protocol.cc +++ b/atom/browser/api/atom_api_protocol.cc @@ -40,8 +40,7 @@ void ClearJobFactoryInIO( } // namespace Protocol::Protocol(v8::Isolate* isolate, AtomBrowserContext* browser_context) - : request_context_getter_(static_cast( - browser_context->GetRequestContext())), + : request_context_getter_(browser_context->GetRequestContext()), weak_factory_(this) { Init(isolate); } diff --git a/atom/browser/api/atom_api_screen.cc b/atom/browser/api/atom_api_screen.cc index 425d906e286..68f4baeaf29 100644 --- a/atom/browser/api/atom_api_screen.cc +++ b/atom/browser/api/atom_api_screen.cc @@ -12,7 +12,9 @@ #include "base/bind.h" #include "native_mate/dictionary.h" #include "native_mate/object_template_builder.h" -#include "ui/gfx/screen.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" +#include "ui/gfx/geometry/point.h" #include "atom/common/node_includes.h" @@ -34,20 +36,20 @@ typename T::iterator FindById(T* container, int id) { // Convert the changed_metrics bitmask to string array. std::vector MetricsToArray(uint32_t metrics) { std::vector array; - if (metrics & gfx::DisplayObserver::DISPLAY_METRIC_BOUNDS) + if (metrics & display::DisplayObserver::DISPLAY_METRIC_BOUNDS) array.push_back("bounds"); - if (metrics & gfx::DisplayObserver::DISPLAY_METRIC_WORK_AREA) + if (metrics & display::DisplayObserver::DISPLAY_METRIC_WORK_AREA) array.push_back("workArea"); - if (metrics & gfx::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR) + if (metrics & display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR) array.push_back("scaleFactor"); - if (metrics & gfx::DisplayObserver::DISPLAY_METRIC_ROTATION) + if (metrics & display::DisplayObserver::DISPLAY_METRIC_ROTATION) array.push_back("rotation"); return array; } } // namespace -Screen::Screen(v8::Isolate* isolate, gfx::Screen* screen) +Screen::Screen(v8::Isolate* isolate, display::Screen* screen) : screen_(screen) { screen_->AddObserver(this); Init(isolate); @@ -61,31 +63,31 @@ gfx::Point Screen::GetCursorScreenPoint() { return screen_->GetCursorScreenPoint(); } -gfx::Display Screen::GetPrimaryDisplay() { +display::Display Screen::GetPrimaryDisplay() { return screen_->GetPrimaryDisplay(); } -std::vector Screen::GetAllDisplays() { +std::vector Screen::GetAllDisplays() { return screen_->GetAllDisplays(); } -gfx::Display Screen::GetDisplayNearestPoint(const gfx::Point& point) { +display::Display Screen::GetDisplayNearestPoint(const gfx::Point& point) { return screen_->GetDisplayNearestPoint(point); } -gfx::Display Screen::GetDisplayMatching(const gfx::Rect& match_rect) { +display::Display Screen::GetDisplayMatching(const gfx::Rect& match_rect) { return screen_->GetDisplayMatching(match_rect); } -void Screen::OnDisplayAdded(const gfx::Display& new_display) { +void Screen::OnDisplayAdded(const display::Display& new_display) { Emit("display-added", new_display); } -void Screen::OnDisplayRemoved(const gfx::Display& old_display) { +void Screen::OnDisplayRemoved(const display::Display& old_display) { Emit("display-removed", old_display); } -void Screen::OnDisplayMetricsChanged(const gfx::Display& display, +void Screen::OnDisplayMetricsChanged(const display::Display& display, uint32_t changed_metrics) { Emit("display-metrics-changed", display, MetricsToArray(changed_metrics)); } @@ -99,7 +101,7 @@ v8::Local Screen::Create(v8::Isolate* isolate) { return v8::Null(isolate); } - gfx::Screen* screen = gfx::Screen::GetScreen(); + display::Screen* screen = display::Screen::GetScreen(); if (!screen) { isolate->ThrowException(v8::Exception::Error(mate::StringToV8( isolate, "Failed to get screen information"))); diff --git a/atom/browser/api/atom_api_screen.h b/atom/browser/api/atom_api_screen.h index c17b6128852..feff6ddfffe 100644 --- a/atom/browser/api/atom_api_screen.h +++ b/atom/browser/api/atom_api_screen.h @@ -9,7 +9,8 @@ #include "atom/browser/api/event_emitter.h" #include "native_mate/handle.h" -#include "ui/gfx/display_observer.h" +#include "ui/display/display_observer.h" +#include "ui/display/screen.h" namespace gfx { class Point; @@ -22,7 +23,7 @@ namespace atom { namespace api { class Screen : public mate::EventEmitter, - public gfx::DisplayObserver { + public display::DisplayObserver { public: static v8::Local Create(v8::Isolate* isolate); @@ -30,23 +31,23 @@ class Screen : public mate::EventEmitter, v8::Local prototype); protected: - Screen(v8::Isolate* isolate, gfx::Screen* screen); + Screen(v8::Isolate* isolate, display::Screen* screen); ~Screen() override; gfx::Point GetCursorScreenPoint(); - gfx::Display GetPrimaryDisplay(); - std::vector GetAllDisplays(); - gfx::Display GetDisplayNearestPoint(const gfx::Point& point); - gfx::Display GetDisplayMatching(const gfx::Rect& match_rect); + display::Display GetPrimaryDisplay(); + std::vector GetAllDisplays(); + display::Display GetDisplayNearestPoint(const gfx::Point& point); + display::Display GetDisplayMatching(const gfx::Rect& match_rect); - // gfx::DisplayObserver: - void OnDisplayAdded(const gfx::Display& new_display) override; - void OnDisplayRemoved(const gfx::Display& old_display) override; - void OnDisplayMetricsChanged(const gfx::Display& display, + // display::DisplayObserver: + void OnDisplayAdded(const display::Display& new_display) override; + void OnDisplayRemoved(const display::Display& old_display) override; + void OnDisplayMetricsChanged(const display::Display& display, uint32_t changed_metrics) override; private: - gfx::Screen* screen_; + display::Screen* screen_; DISALLOW_COPY_AND_ASSIGN(Screen); }; diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index 54960066503..02fafddf940 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -28,7 +28,7 @@ #include "components/prefs/pref_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "brightray/browser/net/devtools_network_conditions.h" #include "brightray/browser/net/devtools_network_controller_handle.h" #include "chrome/common/pref_names.h" @@ -133,7 +133,7 @@ struct Converter { static bool FromV8(v8::Isolate* isolate, v8::Local val, net::ProxyConfig* out) { - std::string proxy_rules; + std::string proxy_rules, proxy_bypass_rules; GURL pac_url; mate::Dictionary options; // Fallback to previous API when passed String. @@ -143,6 +143,7 @@ struct Converter { } else if (ConvertFromV8(isolate, val, &options)) { options.Get("pacScript", &pac_url); options.Get("proxyRules", &proxy_rules); + options.Get("proxyBypassRules", &proxy_bypass_rules); } else { return false; } @@ -152,6 +153,7 @@ struct Converter { out->set_pac_url(pac_url); } else { out->proxy_rules().ParseFromString(proxy_rules); + out->proxy_rules().bypass_rules.ParseFromString(proxy_bypass_rules); } return true; } @@ -179,7 +181,7 @@ class ResolveProxyHelper { : callback_(callback), original_thread_(base::ThreadTaskRunnerHandle::Get()) { scoped_refptr context_getter = - browser_context->GetRequestContext(); + browser_context->url_request_context_getter(); context_getter->GetNetworkTaskRunner()->PostTask( FROM_HERE, base::Bind(&ResolveProxyHelper::ResolveProxy, @@ -282,7 +284,7 @@ void SetProxyInIO(net::URLRequestContextGetter* getter, const net::ProxyConfig& config, const base::Closure& callback) { auto proxy_service = getter->GetURLRequestContext()->proxy_service(); - proxy_service->ResetConfigService(make_scoped_ptr( + proxy_service->ResetConfigService(base::WrapUnique( new net::ProxyConfigServiceFixed(config))); // Refetches and applies the new pac script if provided. proxy_service->ForceReloadProxyConfig(); diff --git a/atom/browser/api/atom_api_tray.h b/atom/browser/api/atom_api_tray.h index 67b56c3b54b..56d851d44e7 100644 --- a/atom/browser/api/atom_api_tray.h +++ b/atom/browser/api/atom_api_tray.h @@ -5,12 +5,12 @@ #ifndef ATOM_BROWSER_API_ATOM_API_TRAY_H_ #define ATOM_BROWSER_API_ATOM_API_TRAY_H_ +#include #include #include #include "atom/browser/api/trackable_object.h" #include "atom/browser/ui/tray_icon_observer.h" -#include "base/memory/scoped_ptr.h" #include "native_mate/handle.h" namespace gfx { diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index a4b3816b5d5..1042e4080d3 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -66,7 +66,7 @@ #include "net/url_request/url_request_context.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "third_party/WebKit/public/web/WebFindOptions.h" -#include "ui/gfx/screen.h" +#include "ui/display/screen.h" #include "atom/common/node_includes.h" @@ -733,6 +733,7 @@ bool WebContents::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(AtomViewHostMsg_Message, OnRendererMessage) IPC_MESSAGE_HANDLER_DELAY_REPLY(AtomViewHostMsg_Message_Sync, OnRendererMessageSync) + IPC_MESSAGE_HANDLER(AtomViewHostMsg_DidCommitCompositorFrame, OnViewPainted) IPC_MESSAGE_HANDLER_CODE(ViewHostMsg_SetCursor, OnCursorChange, handled = false) IPC_MESSAGE_UNHANDLED(handled = false) @@ -1274,7 +1275,7 @@ void WebContents::CapturePage(mate::Arguments* args) { gfx::Size bitmap_size = view_size; const gfx::NativeView native_view = view->GetNativeView(); const float scale = - gfx::Screen::GetScreen()->GetDisplayNearestWindow(native_view) + display::Screen::GetScreen()->GetDisplayNearestWindow(native_view) .device_scale_factor(); if (scale > 1.0f) bitmap_size = gfx::ScaleToCeiledSize(view_size, scale); @@ -1298,6 +1299,10 @@ void WebContents::OnCursorChange(const content::WebCursor& cursor) { } } +void WebContents::OnViewPainted() { + Emit("view-painted"); +} + void WebContents::SetSize(const SetSizeParams& params) { if (guest_delegate_) guest_delegate_->SetSize(params); diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index 47684b92983..f55ab9ca441 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -294,6 +294,9 @@ class WebContents : public mate::TrackableObject, const base::ListValue& args, IPC::Message* message); + // Called when the hosted view gets graphical updates. + void OnViewPainted(); + v8::Global session_; v8::Global devtools_web_contents_; v8::Global debugger_; diff --git a/atom/browser/api/trackable_object.h b/atom/browser/api/trackable_object.h index bbed5475400..2cb9428a004 100644 --- a/atom/browser/api/trackable_object.h +++ b/atom/browser/api/trackable_object.h @@ -10,7 +10,6 @@ #include "atom/browser/api/event_emitter.h" #include "atom/common/key_weak_map.h" #include "base/bind.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "native_mate/object_template_builder.h" diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index add3154642d..323acdd9b37 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -202,7 +202,7 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches( void AtomBrowserClient::DidCreatePpapiPlugin( content::BrowserPpapiHost* host) { host->GetPpapiHost()->AddHostFactoryFilter( - make_scoped_ptr(new chrome::ChromeBrowserPepperHostFactory(host))); + base::WrapUnique(new chrome::ChromeBrowserPepperHostFactory(host))); } content::QuotaPermissionContext* diff --git a/atom/browser/atom_browser_context.cc b/atom/browser/atom_browser_context.cc index 3d42fe5d98d..d87047ce283 100644 --- a/atom/browser/atom_browser_context.cc +++ b/atom/browser/atom_browser_context.cc @@ -117,29 +117,29 @@ AtomBrowserContext::CreateURLRequestJobFactory( protocol_handlers->clear(); job_factory->SetProtocolHandler( - url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler)); + url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler)); job_factory->SetProtocolHandler( - url::kFileScheme, make_scoped_ptr(new asar::AsarProtocolHandler( + url::kFileScheme, base::WrapUnique(new asar::AsarProtocolHandler( BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); job_factory->SetProtocolHandler( url::kHttpScheme, - make_scoped_ptr(new HttpProtocolHandler(url::kHttpScheme))); + base::WrapUnique(new HttpProtocolHandler(url::kHttpScheme))); job_factory->SetProtocolHandler( url::kHttpsScheme, - make_scoped_ptr(new HttpProtocolHandler(url::kHttpsScheme))); + base::WrapUnique(new HttpProtocolHandler(url::kHttpsScheme))); job_factory->SetProtocolHandler( url::kWsScheme, - make_scoped_ptr(new HttpProtocolHandler(url::kWsScheme))); + base::WrapUnique(new HttpProtocolHandler(url::kWsScheme))); job_factory->SetProtocolHandler( url::kWssScheme, - make_scoped_ptr(new HttpProtocolHandler(url::kWssScheme))); + base::WrapUnique(new HttpProtocolHandler(url::kWssScheme))); auto host_resolver = url_request_context_getter()->GetURLRequestContext()->host_resolver(); job_factory->SetProtocolHandler( url::kFtpScheme, - make_scoped_ptr(new net::FtpProtocolHandler( + base::WrapUnique(new net::FtpProtocolHandler( new net::FtpNetworkLayer(host_resolver)))); return std::move(job_factory); @@ -178,7 +178,7 @@ content::PermissionManager* AtomBrowserContext::GetPermissionManager() { } std::unique_ptr AtomBrowserContext::CreateCertVerifier() { - return std::unique_ptr(new AtomCertVerifier); + return base::WrapUnique(new AtomCertVerifier); } net::SSLConfigService* AtomBrowserContext::CreateSSLConfigService() { diff --git a/atom/browser/atom_browser_main_parts.cc b/atom/browser/atom_browser_main_parts.cc index 66c1bd8303a..a8d18e8c5af 100644 --- a/atom/browser/atom_browser_main_parts.cc +++ b/atom/browser/atom_browser_main_parts.cc @@ -15,7 +15,7 @@ #include "atom/common/node_bindings.h" #include "atom/common/node_includes.h" #include "base/command_line.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "chrome/browser/browser_process.h" #include "v8/include/v8-debug.h" diff --git a/atom/browser/atom_security_state_model_client.cc b/atom/browser/atom_security_state_model_client.cc index 911849c5c2d..77a91bdec9b 100644 --- a/atom/browser/atom_security_state_model_client.cc +++ b/atom/browser/atom_security_state_model_client.cc @@ -91,8 +91,14 @@ void AtomSecurityStateModelClient::GetVisibleSecurityState( state->connection_status = ssl.connection_status; state->security_bits = ssl.security_bits; state->sct_verify_statuses.clear(); - for (const auto& sct : ssl.signed_certificate_timestamp_ids) - state->sct_verify_statuses.push_back(sct.status); + state->sct_verify_statuses.insert(state->sct_verify_statuses.end(), + ssl.num_unknown_scts, + net::ct::SCT_STATUS_LOG_UNKNOWN); + state->sct_verify_statuses.insert(state->sct_verify_statuses.end(), + ssl.num_invalid_scts, + net::ct::SCT_STATUS_INVALID); + state->sct_verify_statuses.insert(state->sct_verify_statuses.end(), + ssl.num_valid_scts, net::ct::SCT_STATUS_OK); state->displayed_mixed_content = (ssl.content_status & content::SSLStatus::DISPLAYED_INSECURE_CONTENT) ? true diff --git a/atom/browser/atom_speech_recognition_manager_delegate.cc b/atom/browser/atom_speech_recognition_manager_delegate.cc index 06727332f06..d2e7135c9af 100644 --- a/atom/browser/atom_speech_recognition_manager_delegate.cc +++ b/atom/browser/atom_speech_recognition_manager_delegate.cc @@ -50,11 +50,6 @@ void AtomSpeechRecognitionManagerDelegate::OnAudioLevelsChange( int session_id, float volume, float noise_volume) { } -void AtomSpeechRecognitionManagerDelegate::GetDiagnosticInformation( - bool* can_report_metrics, std::string* hardware_info) { - *can_report_metrics = false; -} - void AtomSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( int session_id, base::Callback callback) { diff --git a/atom/browser/atom_speech_recognition_manager_delegate.h b/atom/browser/atom_speech_recognition_manager_delegate.h index 4c78e0eead1..a6b2f059f7a 100644 --- a/atom/browser/atom_speech_recognition_manager_delegate.h +++ b/atom/browser/atom_speech_recognition_manager_delegate.h @@ -36,8 +36,6 @@ class AtomSpeechRecognitionManagerDelegate float noise_volume) override; // content::SpeechRecognitionManagerDelegate: - void GetDiagnosticInformation(bool* can_report_metrics, - std::string* hardware_info) override; void CheckRecognitionIsAllowed( int session_id, base::Callback callback) override; diff --git a/atom/browser/browser_win.cc b/atom/browser/browser_win.cc index 522fffa0191..059b2890942 100644 --- a/atom/browser/browser_win.cc +++ b/atom/browser/browser_win.cc @@ -13,7 +13,6 @@ #include "base/base_paths.h" #include "base/file_version_info.h" #include "base/files/file_path.h" -#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" diff --git a/atom/browser/mac/dict_util.h b/atom/browser/mac/dict_util.h index 3ffd8ba5100..74a2b7234c0 100644 --- a/atom/browser/mac/dict_util.h +++ b/atom/browser/mac/dict_util.h @@ -5,9 +5,9 @@ #ifndef ATOM_BROWSER_MAC_DICT_UTIL_H_ #define ATOM_BROWSER_MAC_DICT_UTIL_H_ -#import +#include -#include "base/memory/scoped_ptr.h" +#import namespace base { class ListValue; diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index a71b0924b2a..662835ab921 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -356,7 +356,7 @@ void NativeWindow::RequestToClosePage() { ScheduleUnresponsiveEvent(5000); if (web_contents()->NeedToFireBeforeUnload()) - web_contents()->DispatchBeforeUnload(false); + web_contents()->DispatchBeforeUnload(); else web_contents()->Close(); } diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index fb4f0217b91..b932c6317b0 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -6,6 +6,7 @@ #define ATOM_BROWSER_NATIVE_WINDOW_H_ #include +#include #include #include @@ -13,7 +14,6 @@ #include "atom/browser/ui/accelerator_util.h" #include "atom/browser/ui/atom_menu_model.h" #include "base/cancelable_callback.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/supports_user_data.h" diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 8d914f62a87..b4dcf291714 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -23,7 +23,6 @@ #include "ui/aura/window_tree_host.h" #include "ui/base/hit_test.h" #include "ui/gfx/image/image.h" -#include "ui/gfx/screen.h" #include "ui/views/background.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" #include "ui/views/controls/webview/webview.h" @@ -52,7 +51,9 @@ #include "atom/browser/ui/win/atom_desktop_window_tree_host_win.h" #include "skia/ext/skia_utils_win.h" #include "ui/base/win/shell.h" -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/screen_win.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" #endif @@ -348,6 +349,10 @@ void NativeWindowViews::CloseImmediately() { } void NativeWindowViews::Focus(bool focus) { + // For hidden window focus() should do nothing. + if (!IsVisible()) + return; + if (focus) { #if defined(OS_WIN) window_->Activate(); @@ -424,7 +429,7 @@ void NativeWindowViews::Maximize() { if (!thick_frame_) { restore_bounds_ = GetBounds(); auto display = - gfx::Screen::GetScreen()->GetDisplayNearestPoint(GetPosition()); + display::Screen::GetScreen()->GetDisplayNearestPoint(GetPosition()); SetBounds(display.work_area(), false); return; } @@ -487,7 +492,7 @@ void NativeWindowViews::SetFullScreen(bool fullscreen) { if (fullscreen) { restore_bounds_ = GetBounds(); auto display = - gfx::Screen::GetScreen()->GetDisplayNearestPoint(GetPosition()); + display::Screen::GetScreen()->GetDisplayNearestPoint(GetPosition()); SetBounds(display.bounds(), false); } else { SetBounds(restore_bounds_, false); @@ -1147,9 +1152,11 @@ gfx::Size NativeWindowViews::ContentSizeToWindowSize(const gfx::Size& size) { gfx::Size window_size(size); #if defined(OS_WIN) - gfx::Rect dpi_bounds = - gfx::Rect(gfx::Point(), gfx::win::DIPToScreenSize(size)); - gfx::Rect window_bounds = gfx::win::ScreenToDIPRect( + HWND hwnd = GetAcceleratedWidget(); + gfx::Rect dpi_bounds = gfx::Rect( + gfx::Point(), display::win::ScreenWin::DIPToScreenSize(hwnd, size)); + gfx::Rect window_bounds = display::win::ScreenWin::ScreenToDIPRect( + hwnd, window_->non_client_view()->GetWindowBoundsForClientBounds(dpi_bounds)); window_size = window_bounds.size(); #endif @@ -1165,16 +1172,16 @@ gfx::Size NativeWindowViews::WindowSizeToContentSize(const gfx::Size& size) { gfx::Size content_size(size); #if defined(OS_WIN) - content_size = gfx::win::DIPToScreenSize(content_size); + HWND hwnd = GetAcceleratedWidget(); + content_size = display::win::ScreenWin::DIPToScreenSize(hwnd, content_size); RECT rect; SetRectEmpty(&rect); - HWND hwnd = GetAcceleratedWidget(); DWORD style = ::GetWindowLong(hwnd, GWL_STYLE); DWORD ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE); AdjustWindowRectEx(&rect, style, FALSE, ex_style); content_size.set_width(content_size.width() - (rect.right - rect.left)); content_size.set_height(content_size.height() - (rect.bottom - rect.top)); - content_size = gfx::win::ScreenToDIPSize(content_size); + content_size = display::win::ScreenWin::ScreenToDIPSize(hwnd, content_size); #endif if (menu_bar_ && menu_bar_visible_) diff --git a/atom/browser/net/asar/url_request_asar_job.cc b/atom/browser/net/asar/url_request_asar_job.cc index 2352668e179..ad3a4c2724b 100644 --- a/atom/browser/net/asar/url_request_asar_job.cc +++ b/atom/browser/net/asar/url_request_asar_job.cc @@ -180,7 +180,7 @@ bool URLRequestAsarJob::IsRedirectResponse(GURL* location, #endif } -net::Filter* URLRequestAsarJob::SetupFilter() const { +std::unique_ptr URLRequestAsarJob::SetupFilter() const { // Bug 9936 - .svgz files needs to be decompressed. return base::LowerCaseEqualsASCII(file_path_.Extension(), ".svgz") ? net::Filter::GZipFactory() : nullptr; diff --git a/atom/browser/net/asar/url_request_asar_job.h b/atom/browser/net/asar/url_request_asar_job.h index 56c519823c0..8c32932fa5e 100644 --- a/atom/browser/net/asar/url_request_asar_job.h +++ b/atom/browser/net/asar/url_request_asar_job.h @@ -56,7 +56,7 @@ class URLRequestAsarJob : public net::URLRequestJob { void Kill() override; int ReadRawData(net::IOBuffer* buf, int buf_size) override; bool IsRedirectResponse(GURL* location, int* http_status_code) override; - net::Filter* SetupFilter() const override; + std::unique_ptr SetupFilter() const override; bool GetMimeType(std::string* mime_type) const override; void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; int GetResponseCode() const override; diff --git a/atom/browser/net/url_request_fetch_job.cc b/atom/browser/net/url_request_fetch_job.cc index 8279d09d5da..5f11c674769 100644 --- a/atom/browser/net/url_request_fetch_job.cc +++ b/atom/browser/net/url_request_fetch_job.cc @@ -7,6 +7,7 @@ #include #include +#include "base/memory/ptr_util.h" #include "base/strings/string_util.h" #include "native_mate/dictionary.h" #include "net/base/io_buffer.h" @@ -132,7 +133,7 @@ void URLRequestFetchJob::StartAsync(std::unique_ptr options) { request_type = GetRequestType(method); fetcher_ = net::URLFetcher::Create(formated_url, request_type, this); - fetcher_->SaveResponseWithWriter(make_scoped_ptr(new ResponsePiper(this))); + fetcher_->SaveResponseWithWriter(base::WrapUnique(new ResponsePiper(this))); // A request context getter is passed by the user. if (url_request_context_getter_) diff --git a/atom/browser/node_debugger.h b/atom/browser/node_debugger.h index f708de6329f..118812a139a 100644 --- a/atom/browser/node_debugger.h +++ b/atom/browser/node_debugger.h @@ -5,9 +5,9 @@ #ifndef ATOM_BROWSER_NODE_DEBUGGER_H_ #define ATOM_BROWSER_NODE_DEBUGGER_H_ +#include #include -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread.h" #include "net/test/embedded_test_server/stream_listen_socket.h" diff --git a/atom/browser/relauncher_mac.cc b/atom/browser/relauncher_mac.cc index ac4c874c560..6e288502455 100644 --- a/atom/browser/relauncher_mac.cc +++ b/atom/browser/relauncher_mac.cc @@ -79,8 +79,16 @@ void RelauncherSynchronizeWithParent() { int LaunchProgram(const StringVector& relauncher_args, const StringVector& argv) { + // Redirect the stdout of child process to /dev/null, otherwise after + // relaunch the child process will raise exception when writing to stdout. + base::ScopedFD devnull(HANDLE_EINTR(open("/dev/null", O_WRONLY))); + base::FileHandleMappingVector no_stdout; + no_stdout.push_back(std::make_pair(devnull.get(), STDERR_FILENO)); + no_stdout.push_back(std::make_pair(devnull.get(), STDOUT_FILENO)); + base::LaunchOptions options; options.new_process_group = true; // detach + options.fds_to_remap = &no_stdout; base::Process process = base::LaunchProcess(argv, options); return process.IsValid() ? 0 : 1; } diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index e6c942feee0..5eb6079f6c9 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 1.2.7 + 1.3.0 CFBundleShortVersionString - 1.2.7 + 1.3.0 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index c77889216da..0527a33b32e 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,7,0 - PRODUCTVERSION 1,2,7,0 + FILEVERSION 1,3,0,0 + PRODUCTVERSION 1,3,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "1.2.7" + VALUE "FileVersion", "1.3.0" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "1.2.7" + VALUE "ProductVersion", "1.3.0" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/browser/ui/drag_util_views.cc b/atom/browser/ui/drag_util_views.cc index c69e34326c9..9a035bf0827 100644 --- a/atom/browser/ui/drag_util_views.cc +++ b/atom/browser/ui/drag_util_views.cc @@ -10,7 +10,7 @@ #include "ui/base/dragdrop/file_info.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/gfx/geometry/point.h" -#include "ui/gfx/screen.h" +#include "ui/display/screen.h" #include "ui/views/widget/widget.h" #include "ui/wm/public/drag_drop_client.h" @@ -34,7 +34,7 @@ void DragFileItems(const std::vector& files, if (!root_window || !aura::client::GetDragDropClient(root_window)) return; - gfx::Point location = gfx::Screen::GetScreen()->GetCursorScreenPoint(); + gfx::Point location = display::Screen::GetScreen()->GetCursorScreenPoint(); // TODO(varunjain): Properly determine and send DRAG_EVENT_SOURCE below. aura::client::GetDragDropClient(root_window)->StartDragAndDrop( data, diff --git a/atom/browser/ui/tray_icon_cocoa.mm b/atom/browser/ui/tray_icon_cocoa.mm index 22f2bcfbf5b..231f1bfb128 100644 --- a/atom/browser/ui/tray_icon_cocoa.mm +++ b/atom/browser/ui/tray_icon_cocoa.mm @@ -9,7 +9,7 @@ #include "ui/events/cocoa/cocoa_event_utils.h" #include "ui/gfx/image/image.h" #include "ui/gfx/mac/coordinate_conversion.h" -#include "ui/gfx/screen.h" +#include "ui/display/screen.h" namespace { diff --git a/atom/browser/ui/views/menu_delegate.h b/atom/browser/ui/views/menu_delegate.h index c28bb3bf501..f813f9cc7d0 100644 --- a/atom/browser/ui/views/menu_delegate.h +++ b/atom/browser/ui/views/menu_delegate.h @@ -5,8 +5,9 @@ #ifndef ATOM_BROWSER_UI_VIEWS_MENU_DELEGATE_H_ #define ATOM_BROWSER_UI_VIEWS_MENU_DELEGATE_H_ +#include + #include "atom/browser/ui/atom_menu_model.h" -#include "base/memory/scoped_ptr.h" #include "ui/views/controls/menu/menu_delegate.h" namespace views { diff --git a/atom/browser/ui/win/notify_icon.cc b/atom/browser/ui/win/notify_icon.cc index a009631622f..e62b682e3e5 100644 --- a/atom/browser/ui/win/notify_icon.cc +++ b/atom/browser/ui/win/notify_icon.cc @@ -12,8 +12,8 @@ #include "ui/gfx/image/image.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" -#include "ui/gfx/screen.h" -#include "ui/gfx/win/dpi.h" +#include "ui/display/screen.h" +#include "ui/display/win/screen_win.h" #include "ui/views/controls/menu/menu_runner.h" namespace atom { @@ -145,7 +145,7 @@ void NotifyIcon::PopUpContextMenu(const gfx::Point& pos, // Show menu at mouse's position by default. gfx::Rect rect(pos, gfx::Size()); if (pos.IsOrigin()) - rect.set_origin(gfx::Screen::GetScreen()->GetCursorScreenPoint()); + rect.set_origin(display::Screen::GetScreen()->GetCursorScreenPoint()); views::MenuRunner menu_runner( menu_model != nullptr ? menu_model : menu_model_, @@ -167,7 +167,7 @@ gfx::Rect NotifyIcon::GetBounds() { RECT rect = { 0 }; Shell_NotifyIconGetRect(&icon_id, &rect); - return gfx::win::ScreenToDIPRect(gfx::Rect(rect)); + return display::win::ScreenWin::ScreenToDIPRect(window_, gfx::Rect(rect)); } void NotifyIcon::InitIconData(NOTIFYICONDATA* icon_data) { diff --git a/atom/browser/ui/win/notify_icon.h b/atom/browser/ui/win/notify_icon.h index 32d969e2be7..ae6c9ca8a14 100644 --- a/atom/browser/ui/win/notify_icon.h +++ b/atom/browser/ui/win/notify_icon.h @@ -13,7 +13,6 @@ #include "atom/browser/ui/tray_icon.h" #include "base/macros.h" #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" #include "base/win/scoped_gdi_object.h" namespace gfx { diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 8a7eee09201..978ca22e86b 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -79,12 +79,6 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches( base::DictionaryValue& web_preferences = self->web_preferences_; bool b; -#if defined(OS_WIN) - // Check if DirectWrite is disabled. - if (web_preferences.GetBoolean(options::kDirectWrite, &b) && !b) - command_line->AppendSwitch(::switches::kDisableDirectWrite); -#endif - // Check if plugins are enabled. if (web_preferences.GetBoolean("plugins", &b) && b) command_line->AppendSwitch(switches::kEnablePlugins); diff --git a/atom/common/api/api_messages.h b/atom/common/api/api_messages.h index ab27d5a2516..7a9fdb04ebc 100644 --- a/atom/common/api/api_messages.h +++ b/atom/common/api/api_messages.h @@ -39,5 +39,7 @@ IPC_MESSAGE_ROUTED3(AtomViewMsg_Message, IPC_MESSAGE_ROUTED1(AtomViewHostMsg_UpdateDraggableRegions, std::vector /* regions */) +IPC_MESSAGE_ROUTED0(AtomViewHostMsg_DidCommitCompositorFrame) + // Update renderer process preferences. IPC_MESSAGE_CONTROL1(AtomMsg_UpdatePreferences, base::ListValue) diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index 80275e26a7f..10a1c181b38 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -81,7 +81,7 @@ bool AddImageSkiaRep(gfx::ImageSkia* image, // Try PNG first. if (!gfx::PNGCodec::Decode(data, size, decoded.get())) // Try JPEG. - decoded.reset(gfx::JPEGCodec::Decode(data, size)); + decoded = gfx::JPEGCodec::Decode(data, size); if (!decoded) return false; diff --git a/atom/common/api/event_emitter_caller.cc b/atom/common/api/event_emitter_caller.cc index ac6c9c213f7..40448cad107 100644 --- a/atom/common/api/event_emitter_caller.cc +++ b/atom/common/api/event_emitter_caller.cc @@ -6,7 +6,6 @@ #include "atom/common/api/locker.h" #include "atom/common/node_includes.h" -#include "base/memory/scoped_ptr.h" namespace mate { diff --git a/atom/common/asar/archive.h b/atom/common/asar/archive.h index 5438776885f..9e3abc3434d 100644 --- a/atom/common/asar/archive.h +++ b/atom/common/asar/archive.h @@ -5,12 +5,12 @@ #ifndef ATOM_COMMON_ASAR_ARCHIVE_H_ #define ATOM_COMMON_ASAR_ARCHIVE_H_ +#include #include #include "base/containers/scoped_ptr_hash_map.h" #include "base/files/file.h" #include "base/files/file_path.h" -#include "base/memory/scoped_ptr.h" namespace base { class DictionaryValue; diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 4aa9e3dd634..437562f9ca8 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -6,8 +6,8 @@ #define ATOM_VERSION_H #define ATOM_MAJOR_VERSION 1 -#define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 7 +#define ATOM_MINOR_VERSION 3 +#define ATOM_PATCH_VERSION 0 #define ATOM_VERSION_IS_RELEASE 1 diff --git a/atom/common/chrome_version.h b/atom/common/chrome_version.h index 66870f4d6c3..96186adc4f7 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 "51.0.2704.106" +#define CHROME_VERSION_STRING "52.0.2743.82" #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 b74103ccbf7..de5a50e7191 100644 --- a/atom/common/crash_reporter/crash_reporter_linux.h +++ b/atom/common/crash_reporter/crash_reporter_linux.h @@ -5,12 +5,12 @@ #ifndef ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_LINUX_H_ #define ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_LINUX_H_ +#include #include #include "atom/common/crash_reporter/crash_reporter.h" #include "atom/common/crash_reporter/linux/crash_dump_handler.h" #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" namespace base { template struct DefaultSingletonTraits; diff --git a/atom/common/crash_reporter/crash_reporter_mac.h b/atom/common/crash_reporter/crash_reporter_mac.h index 5556263cd35..8acf50285d3 100644 --- a/atom/common/crash_reporter/crash_reporter_mac.h +++ b/atom/common/crash_reporter/crash_reporter_mac.h @@ -10,7 +10,6 @@ #include "atom/common/crash_reporter/crash_reporter.h" #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string_piece.h" #include "vendor/crashpad/client/simple_string_dictionary.h" diff --git a/atom/common/crash_reporter/crash_reporter_win.h b/atom/common/crash_reporter/crash_reporter_win.h index 0ab8f4bcfb1..93be8af32cd 100644 --- a/atom/common/crash_reporter/crash_reporter_win.h +++ b/atom/common/crash_reporter/crash_reporter_win.h @@ -5,12 +5,12 @@ #ifndef ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_WIN_H_ #define ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_WIN_H_ +#include #include #include #include "atom/common/crash_reporter/crash_reporter.h" #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" #include "vendor/breakpad/src/client/windows/handler/exception_handler.h" namespace base { diff --git a/atom/common/native_mate_converters/gfx_converter.cc b/atom/common/native_mate_converters/gfx_converter.cc index 37e7aeb3a48..db6a181cc96 100644 --- a/atom/common/native_mate_converters/gfx_converter.cc +++ b/atom/common/native_mate_converters/gfx_converter.cc @@ -7,8 +7,9 @@ #include "native_mate/dictionary.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" -#include "ui/gfx/screen.h" #include "ui/gfx/geometry/size.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" namespace mate { @@ -35,7 +36,7 @@ bool Converter::FromV8(v8::Isolate* isolate, } v8::Local Converter::ToV8(v8::Isolate* isolate, - const gfx::Size& val) { + const gfx::Size& val) { mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("width", val.width()); @@ -82,13 +83,13 @@ bool Converter::FromV8(v8::Isolate* isolate, } template<> -struct Converter { +struct Converter { static v8::Local ToV8(v8::Isolate* isolate, - const gfx::Display::TouchSupport& val) { + const display::Display::TouchSupport& val) { switch (val) { - case gfx::Display::TOUCH_SUPPORT_AVAILABLE: + case display::Display::TOUCH_SUPPORT_AVAILABLE: return StringToV8(isolate, "available"); - case gfx::Display::TOUCH_SUPPORT_UNAVAILABLE: + case display::Display::TOUCH_SUPPORT_UNAVAILABLE: return StringToV8(isolate, "unavailable"); default: return StringToV8(isolate, "unknown"); @@ -96,8 +97,8 @@ struct Converter { } }; -v8::Local Converter::ToV8(v8::Isolate* isolate, - const gfx::Display& val) { +v8::Local Converter::ToV8( + v8::Isolate* isolate, const display::Display& val) { mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("id", val.id()); diff --git a/atom/common/native_mate_converters/gfx_converter.h b/atom/common/native_mate_converters/gfx_converter.h index c6da76a2d0e..1797710962e 100644 --- a/atom/common/native_mate_converters/gfx_converter.h +++ b/atom/common/native_mate_converters/gfx_converter.h @@ -7,11 +7,14 @@ #include "native_mate/converter.h" +namespace display { +class Display; +} + namespace gfx { class Point; class Size; class Rect; -class Display; } namespace mate { @@ -44,12 +47,12 @@ struct Converter { }; template<> -struct Converter { +struct Converter { static v8::Local ToV8(v8::Isolate* isolate, - const gfx::Display& val); + const display::Display& val); static bool FromV8(v8::Isolate* isolate, v8::Local val, - gfx::Display* out); + display::Display* out); }; } // namespace mate diff --git a/atom/common/native_mate_converters/net_converter.cc b/atom/common/native_mate_converters/net_converter.cc index b88efbae004..e79e09df10b 100644 --- a/atom/common/native_mate_converters/net_converter.cc +++ b/atom/common/native_mate_converters/net_converter.cc @@ -11,6 +11,7 @@ #include "atom/common/native_mate_converters/gurl_converter.h" #include "atom/common/native_mate_converters/value_converter.h" #include "base/values.h" +#include "base/strings/string_number_conversions.h" #include "native_mate/dictionary.h" #include "net/base/upload_bytes_element_reader.h" #include "net/base/upload_data_stream.h" @@ -47,7 +48,8 @@ v8::Local Converter>::ToV8( dict.Set("data", buffer); dict.Set("issuerName", val->issuer().GetDisplayName()); dict.Set("subjectName", val->subject().GetDisplayName()); - dict.Set("serialNumber", val->serial_number()); + dict.Set("serialNumber", base::HexEncode(val->serial_number().data(), + val->serial_number().size())); dict.Set("validStart", val->valid_start().ToDoubleT()); dict.Set("validExpiry", val->valid_expiry().ToDoubleT()); dict.Set("fingerprint", diff --git a/atom/common/native_mate_converters/v8_value_converter.cc b/atom/common/native_mate_converters/v8_value_converter.cc index 37e09aec575..6d159d4daf3 100644 --- a/atom/common/native_mate_converters/v8_value_converter.cc +++ b/atom/common/native_mate_converters/v8_value_converter.cc @@ -5,14 +5,15 @@ #include "atom/common/native_mate_converters/v8_value_converter.h" #include +#include #include #include #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/values.h" #include "native_mate/dictionary.h" -#include "vendor/node/src/node_buffer.h" + +#include "atom/common/node_includes.h" namespace atom { @@ -110,32 +111,31 @@ base::Value* V8ValueConverter::FromV8Value( v8::Local V8ValueConverter::ToV8ValueImpl( v8::Isolate* isolate, const base::Value* value) const { - CHECK(value); switch (value->GetType()) { case base::Value::TYPE_NULL: return v8::Null(isolate); case base::Value::TYPE_BOOLEAN: { bool val = false; - CHECK(value->GetAsBoolean(&val)); + value->GetAsBoolean(&val); return v8::Boolean::New(isolate, val); } case base::Value::TYPE_INTEGER: { int val = 0; - CHECK(value->GetAsInteger(&val)); + value->GetAsInteger(&val); return v8::Integer::New(isolate, val); } case base::Value::TYPE_DOUBLE: { double val = 0.0; - CHECK(value->GetAsDouble(&val)); + value->GetAsDouble(&val); return v8::Number::New(isolate, val); } case base::Value::TYPE_STRING: { std::string val; - CHECK(value->GetAsString(&val)); + value->GetAsString(&val); return v8::String::NewFromUtf8( isolate, val.c_str(), v8::String::kNormalString, val.length()); } @@ -163,10 +163,9 @@ v8::Local V8ValueConverter::ToV8Array( for (size_t i = 0; i < val->GetSize(); ++i) { const base::Value* child = nullptr; - CHECK(val->Get(i, &child)); + val->Get(i, &child); v8::Local child_v8 = ToV8ValueImpl(isolate, child); - CHECK(!child_v8.IsEmpty()); v8::TryCatch try_catch; result->Set(static_cast(i), child_v8); @@ -186,7 +185,6 @@ v8::Local V8ValueConverter::ToV8Object( !iter.IsAtEnd(); iter.Advance()) { const std::string& key = iter.key(); v8::Local child_v8 = ToV8ValueImpl(isolate, &iter.value()); - CHECK(!child_v8.IsEmpty()); v8::TryCatch try_catch; result.Set(key, child_v8); @@ -210,8 +208,6 @@ base::Value* V8ValueConverter::FromV8ValueImpl( FromV8ValueState* state, v8::Local val, v8::Isolate* isolate) const { - CHECK(!val.IsEmpty()); - FromV8ValueState::Level state_level(state); if (state->HasReachedMaxRecursionDepth()) return nullptr; diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 40fa6bdb6e2..2a999ea79bc 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -11,7 +11,6 @@ #include "atom/common/api/locker.h" #include "atom/common/atom_command_line.h" #include "atom/common/native_mate_converters/file_path_converter.h" -#include "atom/common/node_includes.h" #include "base/command_line.h" #include "base/base_paths.h" #include "base/environment.h" @@ -22,6 +21,8 @@ #include "content/public/common/content_paths.h" #include "native_mate/dictionary.h" +#include "atom/common/node_includes.h" + using content::BrowserThread; // Force all builtin modules to be referenced so they can actually run their @@ -216,7 +217,6 @@ void NodeBindings::UvRunOnce() { DCHECK(!is_browser_ || BrowserThread::CurrentlyOn(BrowserThread::UI)); node::Environment* env = uv_env(); - CHECK(env); // Use Locker in browser process. mate::Locker locker(env->isolate()); diff --git a/atom/common/node_includes.h b/atom/common/node_includes.h index 46b6fa058eb..01efa6b1547 100644 --- a/atom/common/node_includes.h +++ b/atom/common/node_includes.h @@ -19,6 +19,7 @@ #undef CHECK_GT #undef CHECK_LE #undef CHECK_LT +#undef UNLIKELY #undef DISALLOW_COPY_AND_ASSIGN #undef NO_RETURN #undef arraysize diff --git a/atom/common/options_switches.cc b/atom/common/options_switches.cc index 36ec19edb86..6b514599f08 100644 --- a/atom/common/options_switches.cc +++ b/atom/common/options_switches.cc @@ -96,9 +96,6 @@ const char kNodeIntegration[] = "nodeIntegration"; // Instancd ID of guest WebContents. const char kGuestInstanceID[] = "guestInstanceId"; -// Enable DirectWrite on Windows. -const char kDirectWrite[] = "directWrite"; - // Web runtime features. const char kExperimentalFeatures[] = "experimentalFeatures"; const char kExperimentalCanvasFeatures[] = "experimentalCanvasFeatures"; diff --git a/atom/common/options_switches.h b/atom/common/options_switches.h index 29fbc0e40f8..54c63877288 100644 --- a/atom/common/options_switches.h +++ b/atom/common/options_switches.h @@ -48,7 +48,6 @@ extern const char kFocusable[]; extern const char kWebPreferences[]; // WebPreferences. -extern const char kDirectWrite[]; extern const char kZoomFactor[]; extern const char kPreloadScript[]; extern const char kPreloadURL[]; diff --git a/atom/node/osfhandle.h b/atom/node/osfhandle.h index 6ebb2ab11e9..3933236e509 100644 --- a/atom/node/osfhandle.h +++ b/atom/node/osfhandle.h @@ -7,8 +7,6 @@ #include -#include "node_extern.h" - namespace node { // The _open_osfhandle and _close functions on Windows are provided by the @@ -20,8 +18,8 @@ namespace node { // we always create fd in one instance of VC++ library. // Followings wrappers are compiled in node.dll, and all code in electron.exe // should call these wrappers instead of calling _open_osfhandle directly. -NODE_EXTERN int open_osfhandle(intptr_t osfhandle, int flags); -NODE_EXTERN int close(int fd); +__declspec(dllexport) int open_osfhandle(intptr_t osfhandle, int flags); +__declspec(dllexport) int close(int fd); } // namespace node diff --git a/atom/renderer/api/atom_api_web_frame.h b/atom/renderer/api/atom_api_web_frame.h index df0392a933e..852191fc766 100644 --- a/atom/renderer/api/atom_api_web_frame.h +++ b/atom/renderer/api/atom_api_web_frame.h @@ -5,10 +5,10 @@ #ifndef ATOM_RENDERER_API_ATOM_API_WEB_FRAME_H_ #define ATOM_RENDERER_API_ATOM_API_WEB_FRAME_H_ +#include #include #include "atom/renderer/guest_view_container.h" -#include "base/memory/scoped_ptr.h" #include "native_mate/handle.h" #include "native_mate/wrappable.h" #include "third_party/WebKit/public/web/WebCache.h" diff --git a/atom/renderer/atom_render_view_observer.cc b/atom/renderer/atom_render_view_observer.cc index 45a41eef8ac..ea5727893d9 100644 --- a/atom/renderer/atom_render_view_observer.cc +++ b/atom/renderer/atom_render_view_observer.cc @@ -141,6 +141,10 @@ void AtomRenderViewObserver::DraggableRegionsChanged(blink::WebFrame* frame) { Send(new AtomViewHostMsg_UpdateDraggableRegions(routing_id(), regions)); } +void AtomRenderViewObserver::DidCommitCompositorFrame() { + Send(new AtomViewHostMsg_DidCommitCompositorFrame(routing_id())); +} + bool AtomRenderViewObserver::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(AtomRenderViewObserver, message) diff --git a/atom/renderer/atom_render_view_observer.h b/atom/renderer/atom_render_view_observer.h index 376138f0849..29488960545 100644 --- a/atom/renderer/atom_render_view_observer.h +++ b/atom/renderer/atom_render_view_observer.h @@ -28,6 +28,7 @@ class AtomRenderViewObserver : public content::RenderViewObserver { // content::RenderViewObserver implementation. void DidCreateDocumentElement(blink::WebLocalFrame* frame) override; void DraggableRegionsChanged(blink::WebFrame* frame) override; + void DidCommitCompositorFrame() override; bool OnMessageReceived(const IPC::Message& message) override; void OnBrowserMessage(bool send_to_all, diff --git a/atom/renderer/atom_renderer_client.cc b/atom/renderer/atom_renderer_client.cc index 07f0a0c48bf..d2c341fa27f 100644 --- a/atom/renderer/atom_renderer_client.cc +++ b/atom/renderer/atom_renderer_client.cc @@ -315,8 +315,8 @@ content::BrowserPluginDelegate* AtomRendererClient::CreateBrowserPluginDelegate( } } -void AtomRendererClient::AddKeySystems( - std::vector* key_systems) { +void AtomRendererClient::AddSupportedKeySystems( + std::vector>* key_systems) { AddChromeKeySystems(key_systems); } diff --git a/atom/renderer/atom_renderer_client.h b/atom/renderer/atom_renderer_client.h index 9cf6eaa2a7c..5419692d2ae 100644 --- a/atom/renderer/atom_renderer_client.h +++ b/atom/renderer/atom_renderer_client.h @@ -57,7 +57,9 @@ class AtomRendererClient : public content::ContentRendererClient { content::RenderFrame* render_frame, const std::string& mime_type, const GURL& original_url) override; - void AddKeySystems(std::vector* key_systems) override; + void AddSupportedKeySystems( + std::vector>* key_systems) + override; std::unique_ptr node_bindings_; std::unique_ptr atom_bindings_; diff --git a/atom/renderer/preferences_manager.h b/atom/renderer/preferences_manager.h index 451928085d1..c531fe879ac 100644 --- a/atom/renderer/preferences_manager.h +++ b/atom/renderer/preferences_manager.h @@ -8,11 +8,11 @@ #include #include "base/values.h" -#include "content/public/renderer/render_process_observer.h" +#include "content/public/renderer/render_thread_observer.h" namespace atom { -class PreferencesManager : public content::RenderProcessObserver { +class PreferencesManager : public content::RenderThreadObserver { public: PreferencesManager(); ~PreferencesManager() override; diff --git a/chromium_src/SkUserConfig.h b/chromium_src/SkUserConfig.h deleted file mode 100644 index 755b050de6c..00000000000 --- a/chromium_src/SkUserConfig.h +++ /dev/null @@ -1,158 +0,0 @@ - -/* - * Copyright 2006 The Android Open Source Project - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -#ifndef SkUserConfig_DEFINED -#define SkUserConfig_DEFINED - -/* SkTypes.h, the root of the public header files, does the following trick: - - #include "SkPreConfig.h" - #include "SkUserConfig.h" - #include "SkPostConfig.h" - - SkPreConfig.h runs first, and it is responsible for initializing certain - skia defines. - - SkPostConfig.h runs last, and its job is to just check that the final - defines are consistent (i.e. that we don't have mutually conflicting - defines). - - SkUserConfig.h (this file) runs in the middle. It gets to change or augment - the list of flags initially set in preconfig, and then postconfig checks - that everything still makes sense. - - Below are optional defines that add, subtract, or change default behavior - in Skia. Your port can locally edit this file to enable/disable flags as - you choose, or these can be delared on your command line (i.e. -Dfoo). - - By default, this include file will always default to having all of the flags - commented out, so including it will have no effect. -*/ - -/////////////////////////////////////////////////////////////////////////////// - -/* Skia has lots of debug-only code. Often this is just null checks or other - parameter checking, but sometimes it can be quite intrusive (e.g. check that - each 32bit pixel is in premultiplied form). This code can be very useful - during development, but will slow things down in a shipping product. - - By default, these mutually exclusive flags are defined in SkPreConfig.h, - based on the presence or absence of NDEBUG, but that decision can be changed - here. - */ -//#define SK_DEBUG -//#define SK_RELEASE - -/* Skia has certain debug-only code that is extremely intensive even for debug - builds. This code is useful for diagnosing specific issues, but is not - generally applicable, therefore it must be explicitly enabled to avoid - the performance impact. By default these flags are undefined, but can be - enabled by uncommenting them below. - */ -//#define SK_DEBUG_GLYPH_CACHE -//#define SK_DEBUG_PATH - -/* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger) - it will call SK_CRASH(). If this is not defined it, it is defined in - SkPostConfig.h to write to an illegal address - */ -//#define SK_CRASH() *(int *)(uintptr_t)0 = 0 - - -/* preconfig will have attempted to determine the endianness of the system, - but you can change these mutually exclusive flags here. - */ -//#define SK_CPU_BENDIAN -//#define SK_CPU_LENDIAN - -/* Most compilers use the same bit endianness for bit flags in a byte as the - system byte endianness, and this is the default. If for some reason this - needs to be overridden, specify which of the mutually exclusive flags to - use. For example, some atom processors in certain configurations have big - endian byte order but little endian bit orders. -*/ -//#define SK_UINT8_BITFIELD_BENDIAN -//#define SK_UINT8_BITFIELD_LENDIAN - - -/* To write debug messages to a console, skia will call SkDebugf(...) following - printf conventions (e.g. const char* format, ...). If you want to redirect - this to something other than printf, define yours here - */ -// Log the file and line number for assertions. -#define SkDebugf(...) - -/* - * To specify a different default font cache limit, define this. If this is - * undefined, skia will use a built-in value. - */ -//#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024) - -/* - * To specify the default size of the image cache, undefine this and set it to - * the desired value (in bytes). SkGraphics.h as a runtime API to set this - * value as well. If this is undefined, a built-in value will be used. - */ -//#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024) - -/* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow - them, but modern PDF interpreters should handle them just fine. - */ -//#define SK_ALLOW_LARGE_PDF_SCALARS - -/* Define this to provide font subsetter in PDF generation. - */ -//#define SK_SFNTLY_SUBSETTER "sfntly/subsetter/font_subsetter.h" - -/* Define this to set the upper limit for text to support LCD. Values that - are very large increase the cost in the font cache and draw slower, without - improving readability. If this is undefined, Skia will use its default - value (e.g. 48) - */ -//#define SK_MAX_SIZE_FOR_LCDTEXT 48 - -/* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST - which will run additional self-tests at startup. These can take a long time, - so this flag is optional. - */ -#ifdef SK_DEBUG -//#define SK_SUPPORT_UNITTEST -#endif - -/* Change the ordering to work in X windows. - */ -#ifdef SK_SAMPLES_FOR_X - #define SK_R32_SHIFT 16 - #define SK_G32_SHIFT 8 - #define SK_B32_SHIFT 0 - #define SK_A32_SHIFT 24 -#endif - - -/* Determines whether to build code that supports the GPU backend. Some classes - that are not GPU-specific, such as SkShader subclasses, have optional code - that is used allows them to interact with the GPU backend. If you'd like to - omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu - directories from your include search path when you're not building the GPU - backend. Defaults to 1 (build the GPU code). - */ -//#define SK_SUPPORT_GPU 1 - - -/* The PDF generation code uses Path Ops to handle complex clipping paths, - * but at this time, Path Ops is not release ready yet. So, the code is - * hidden behind this #define guard. If you are feeling adventurous and - * want the latest and greatest PDF generation code, uncomment the #define. - * When Path Ops is release ready, the define guards and this user config - * define should be removed entirely. - */ -//#define SK_PDF_USE_PATHOPS_CLIPPING - -#endif - diff --git a/chromium_src/chrome/browser/browser_process.h b/chromium_src/chrome/browser/browser_process.h index 53ec0ba75f1..1459ca31a60 100644 --- a/chromium_src/chrome/browser/browser_process.h +++ b/chromium_src/chrome/browser/browser_process.h @@ -10,10 +10,10 @@ #ifndef CHROME_BROWSER_BROWSER_PROCESS_H_ #define CHROME_BROWSER_BROWSER_PROCESS_H_ +#include #include #include "base/macros.h" -#include "base/memory/scoped_ptr.h" namespace printing { class PrintJobManager; diff --git a/chromium_src/chrome/browser/certificate_manager_model.h b/chromium_src/chrome/browser/certificate_manager_model.h index 81c3b6c8a8d..7646da5b9b4 100644 --- a/chromium_src/chrome/browser/certificate_manager_model.h +++ b/chromium_src/chrome/browser/certificate_manager_model.h @@ -6,12 +6,12 @@ #define CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ #include +#include #include #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "net/cert/nss_cert_database.h" 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 1999e0e7747..83e9fdff283 100644 --- a/chromium_src/chrome/browser/extensions/global_shortcut_listener_win.h +++ b/chromium_src/chrome/browser/extensions/global_shortcut_listener_win.h @@ -5,9 +5,10 @@ #ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_WIN_H_ #define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_WIN_H_ +#include + #include -#include "base/memory/scoped_ptr.h" #include "chrome/browser/extensions/global_shortcut_listener.h" #include "ui/gfx/win/singleton_hwnd.h" #include "ui/gfx/win/singleton_hwnd_observer.h" diff --git a/chromium_src/chrome/browser/media/native_desktop_media_list.cc b/chromium_src/chrome/browser/media/native_desktop_media_list.cc index a524dfcf38c..76170a473d8 100644 --- a/chromium_src/chrome/browser/media/native_desktop_media_list.cc +++ b/chromium_src/chrome/browser/media/native_desktop_media_list.cc @@ -97,7 +97,6 @@ class NativeDesktopMediaList::Worker typedef std::map ImageHashesMap; // webrtc::DesktopCapturer::Callback interface. - webrtc::SharedMemory* CreateSharedMemory(size_t size) override; void OnCaptureCompleted(webrtc::DesktopFrame* frame) override; base::WeakPtr media_list_; @@ -218,11 +217,6 @@ void NativeDesktopMediaList::Worker::Refresh( base::Bind(&NativeDesktopMediaList::OnRefreshFinished, media_list_)); } -webrtc::SharedMemory* NativeDesktopMediaList::Worker::CreateSharedMemory( - size_t size) { - return NULL; -} - void NativeDesktopMediaList::Worker::OnCaptureCompleted( webrtc::DesktopFrame* frame) { current_frame_.reset(frame); diff --git a/chromium_src/chrome/browser/media/native_desktop_media_list.h b/chromium_src/chrome/browser/media/native_desktop_media_list.h index 80324397980..9814849a290 100644 --- a/chromium_src/chrome/browser/media/native_desktop_media_list.h +++ b/chromium_src/chrome/browser/media/native_desktop_media_list.h @@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_MEDIA_NATIVE_DESKTOP_MEDIA_LIST_H_ #define CHROME_BROWSER_MEDIA_NATIVE_DESKTOP_MEDIA_LIST_H_ -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/sequenced_task_runner.h" #include "chrome/browser/media/desktop_media_list.h" diff --git a/chromium_src/chrome/browser/printing/pdf_to_emf_converter.cc b/chromium_src/chrome/browser/printing/pdf_to_emf_converter.cc index e13effd64de..0d23a7c6d5a 100644 --- a/chromium_src/chrome/browser/printing/pdf_to_emf_converter.cc +++ b/chromium_src/chrome/browser/printing/pdf_to_emf_converter.cc @@ -104,7 +104,7 @@ class PdfToEmfUtilityProcessHostClient // UtilityProcessHostClient implementation. virtual void OnProcessCrashed(int exit_code) override; - virtual void OnProcessLaunchFailed() override; + virtual void OnProcessLaunchFailed(int exit_code) override; virtual bool OnMessageReceived(const IPC::Message& message) override; private: @@ -423,7 +423,7 @@ void PdfToEmfUtilityProcessHostClient::OnProcessCrashed(int exit_code) { OnFailed(); } -void PdfToEmfUtilityProcessHostClient::OnProcessLaunchFailed() { +void PdfToEmfUtilityProcessHostClient::OnProcessLaunchFailed(int exit_code) { OnFailed(); } diff --git a/chromium_src/chrome/browser/printing/pdf_to_emf_converter.h b/chromium_src/chrome/browser/printing/pdf_to_emf_converter.h index 859d4229313..bd292dd476a 100644 --- a/chromium_src/chrome/browser/printing/pdf_to_emf_converter.h +++ b/chromium_src/chrome/browser/printing/pdf_to_emf_converter.h @@ -5,9 +5,10 @@ #ifndef CHROME_BROWSER_PRINTING_PDF_TO_EMF_CONVERTER_H_ #define CHROME_BROWSER_PRINTING_PDF_TO_EMF_CONVERTER_H_ +#include + #include "base/callback.h" #include "base/memory/ref_counted_memory.h" -#include "base/memory/scoped_ptr.h" namespace base { class FilePath; diff --git a/chromium_src/chrome/browser/printing/print_job.h b/chromium_src/chrome/browser/printing/print_job.h index 5569f87679f..420622a7e96 100644 --- a/chromium_src/chrome/browser/printing/print_job.h +++ b/chromium_src/chrome/browser/printing/print_job.h @@ -5,7 +5,8 @@ #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_H_ #define CHROME_BROWSER_PRINTING_PRINT_JOB_H_ -#include "base/memory/scoped_ptr.h" +#include + #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "chrome/browser/printing/print_job_worker_owner.h" diff --git a/chromium_src/chrome/browser/printing/print_job_manager.h b/chromium_src/chrome/browser/printing/print_job_manager.h index 32d5b301b20..ddb4e97b42b 100644 --- a/chromium_src/chrome/browser/printing/print_job_manager.h +++ b/chromium_src/chrome/browser/printing/print_job_manager.h @@ -5,12 +5,12 @@ #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ #define CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ +#include #include #include #include "base/logging.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" #include "base/threading/non_thread_safe.h" #include "content/public/browser/notification_observer.h" diff --git a/chromium_src/chrome/browser/printing/print_job_worker.h b/chromium_src/chrome/browser/printing/print_job_worker.h index 6b15097b7af..343c0fa15f2 100644 --- a/chromium_src/chrome/browser/printing/print_job_worker.h +++ b/chromium_src/chrome/browser/printing/print_job_worker.h @@ -5,8 +5,9 @@ #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ +#include + #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread.h" #include "content/public/browser/browser_thread.h" 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 2bbafdd8e55..f771f6963d4 100644 --- a/chromium_src/chrome/browser/printing/print_view_manager_base.cc +++ b/chromium_src/chrome/browser/printing/print_view_manager_base.cc @@ -4,8 +4,9 @@ #include "chrome/browser/printing/print_view_manager_base.h" +#include + #include "base/bind.h" -#include "base/memory/scoped_ptr.h" #include "components/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" #include "base/timer/timer.h" diff --git a/chromium_src/chrome/browser/printing/printer_query.h b/chromium_src/chrome/browser/printing/printer_query.h index 934c1859264..d2f017d1895 100644 --- a/chromium_src/chrome/browser/printing/printer_query.h +++ b/chromium_src/chrome/browser/printing/printer_query.h @@ -5,9 +5,10 @@ #ifndef CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ #define CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ +#include + #include "base/callback.h" #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" #include "chrome/browser/printing/print_job_worker_owner.h" #include "printing/print_job_constants.h" diff --git a/chromium_src/chrome/browser/process_singleton_posix.cc b/chromium_src/chrome/browser/process_singleton_posix.cc index 5742b358520..bb999fb500c 100644 --- a/chromium_src/chrome/browser/process_singleton_posix.cc +++ b/chromium_src/chrome/browser/process_singleton_posix.cc @@ -74,8 +74,8 @@ #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" -#include "base/thread_task_runner_handle.h" #include "base/threading/platform_thread.h" +#include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "content/public/browser/browser_thread.h" diff --git a/chromium_src/chrome/browser/speech/tts_controller.h b/chromium_src/chrome/browser/speech/tts_controller.h index f4dcd774704..0587a1b8cb2 100644 --- a/chromium_src/chrome/browser/speech/tts_controller.h +++ b/chromium_src/chrome/browser/speech/tts_controller.h @@ -5,12 +5,12 @@ #ifndef CHROME_BROWSER_SPEECH_TTS_CONTROLLER_H_ #define CHROME_BROWSER_SPEECH_TTS_CONTROLLER_H_ +#include #include #include #include #include -#include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/memory/weak_ptr.h" #include "url/gurl.h" @@ -340,4 +340,4 @@ class TtsController { virtual ~TtsController() {} }; -#endif // CHROME_BROWSER_SPEECH_TTS_CONTROLLER_H_ \ No newline at end of file +#endif // CHROME_BROWSER_SPEECH_TTS_CONTROLLER_H_ diff --git a/chromium_src/chrome/browser/speech/tts_controller_impl.h b/chromium_src/chrome/browser/speech/tts_controller_impl.h index 6c8aa5747d2..749c60ad6dc 100644 --- a/chromium_src/chrome/browser/speech/tts_controller_impl.h +++ b/chromium_src/chrome/browser/speech/tts_controller_impl.h @@ -5,12 +5,12 @@ #ifndef CHROME_BROWSER_SPEECH_TTS_CONTROLLER_IMPL_H_ #define CHROME_BROWSER_SPEECH_TTS_CONTROLLER_IMPL_H_ +#include #include #include #include #include -#include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/speech/tts_controller.h" diff --git a/chromium_src/chrome/browser/speech/tts_linux.cc b/chromium_src/chrome/browser/speech/tts_linux.cc index b1e8bc40433..d0e0e2ee823 100644 --- a/chromium_src/chrome/browser/speech/tts_linux.cc +++ b/chromium_src/chrome/browser/speech/tts_linux.cc @@ -5,10 +5,10 @@ #include #include +#include #include "base/command_line.h" #include "base/debug/leak_annotations.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/synchronization/lock.h" #include "chrome/browser/speech/tts_platform.h" diff --git a/chromium_src/chrome/common/chrome_paths_linux.cc b/chromium_src/chrome/common/chrome_paths_linux.cc index e89ae822d90..745bc03adbe 100644 --- a/chromium_src/chrome/common/chrome_paths_linux.cc +++ b/chromium_src/chrome/common/chrome_paths_linux.cc @@ -4,10 +4,11 @@ #include "chrome/common/chrome_paths_internal.h" +#include + #include "base/base_paths.h" #include "base/environment.h" #include "base/files/file_util.h" -#include "base/memory/scoped_ptr.h" #include "base/nix/xdg_util.h" #include "base/path_service.h" #include "chrome/common/chrome_paths.h" diff --git a/chromium_src/chrome/renderer/media/chrome_key_systems.cc b/chromium_src/chrome/renderer/media/chrome_key_systems.cc index 417a61fcdab..79e1333a746 100644 --- a/chromium_src/chrome/renderer/media/chrome_key_systems.cc +++ b/chromium_src/chrome/renderer/media/chrome_key_systems.cc @@ -4,6 +4,8 @@ #include "chrome/renderer/media/chrome_key_systems.h" +#include + #include #include @@ -12,13 +14,10 @@ #include "base/strings/string_split.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/widevine_cdm_messages.h" -#include "components/cdm/renderer/widevine_key_systems.h" +#include "components/cdm/renderer/widevine_key_system_properties.h" #include "content/public/renderer/render_thread.h" #include "media/base/eme_constants.h" - -#if defined(OS_ANDROID) -#include "components/cdm/renderer/android_key_systems.h" -#endif +#include "media/base/key_system_properties.h" // #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. #include "third_party/widevine/cdm/stub/widevine_cdm_version.h" @@ -30,10 +29,13 @@ #include "base/version.h" #endif -using media::KeySystemInfo; +using media::KeySystemProperties; using media::SupportedCodecs; #if defined(ENABLE_PEPPER_CDMS) +static const char kExternalClearKeyPepperType[] = + "application/x-ppapi-clearkey-cdm"; + static bool IsPepperCdmAvailable( const std::string& pepper_type, std::vector* additional_param_names, @@ -49,6 +51,120 @@ static bool IsPepperCdmAvailable( return is_available; } +// KeySystemProperties implementation for external Clear Key systems. +class ExternalClearKeyProperties : public KeySystemProperties { + public: + explicit ExternalClearKeyProperties(const std::string& key_system_name) + : key_system_name_(key_system_name) {} + + std::string GetKeySystemName() const override { return key_system_name_; } + bool IsSupportedInitDataType( + media::EmeInitDataType init_data_type) const override { + switch (init_data_type) { + case media::EmeInitDataType::WEBM: + case media::EmeInitDataType::KEYIDS: + return true; + + case media::EmeInitDataType::CENC: +#if defined(USE_PROPRIETARY_CODECS) + return true; +#else + return false; +#endif // defined(USE_PROPRIETARY_CODECS) + + case media::EmeInitDataType::UNKNOWN: + return false; + } + NOTREACHED(); + return false; + } + + SupportedCodecs GetSupportedCodecs() const override { +#if defined(USE_PROPRIETARY_CODECS) + return media::EME_CODEC_MP4_ALL | media::EME_CODEC_WEBM_ALL; +#else + return media::EME_CODEC_WEBM_ALL; +#endif + } + + media::EmeConfigRule GetRobustnessConfigRule( + media::EmeMediaType media_type, + const std::string& requested_robustness) const override { + return requested_robustness.empty() ? media::EmeConfigRule::SUPPORTED + : media::EmeConfigRule::NOT_SUPPORTED; + } + + // Persistent license sessions are faked. + media::EmeSessionTypeSupport GetPersistentLicenseSessionSupport() + const override { + return media::EmeSessionTypeSupport::SUPPORTED; + } + + media::EmeSessionTypeSupport GetPersistentReleaseMessageSessionSupport() + const override { + return media::EmeSessionTypeSupport::NOT_SUPPORTED; + } + + media::EmeFeatureSupport GetPersistentStateSupport() const override { + return media::EmeFeatureSupport::REQUESTABLE; + } + + media::EmeFeatureSupport GetDistinctiveIdentifierSupport() const override { + return media::EmeFeatureSupport::NOT_SUPPORTED; + } + + std::string GetPepperType() const override { + return kExternalClearKeyPepperType; + } + + private: + const std::string key_system_name_; +}; + +// External Clear Key (used for testing). +static void AddExternalClearKey( + std::vector>* concrete_key_systems) { + static const char kExternalClearKeyKeySystem[] = + "org.chromium.externalclearkey"; + static const char kExternalClearKeyDecryptOnlyKeySystem[] = + "org.chromium.externalclearkey.decryptonly"; + static const char kExternalClearKeyFileIOTestKeySystem[] = + "org.chromium.externalclearkey.fileiotest"; + static const char kExternalClearKeyInitializeFailKeySystem[] = + "org.chromium.externalclearkey.initializefail"; + static const char kExternalClearKeyCrashKeySystem[] = + "org.chromium.externalclearkey.crash"; + + std::vector additional_param_names; + std::vector additional_param_values; + if (!IsPepperCdmAvailable(kExternalClearKeyPepperType, + &additional_param_names, + &additional_param_values)) { + return; + } + + concrete_key_systems->emplace_back( + new ExternalClearKeyProperties(kExternalClearKeyKeySystem)); + + // Add support of decrypt-only mode in ClearKeyCdm. + concrete_key_systems->emplace_back( + new ExternalClearKeyProperties(kExternalClearKeyDecryptOnlyKeySystem)); + + // A key system that triggers FileIO test in ClearKeyCdm. + concrete_key_systems->emplace_back( + new ExternalClearKeyProperties(kExternalClearKeyFileIOTestKeySystem)); + + // A key system that Chrome thinks is supported by ClearKeyCdm, but actually + // will be refused by ClearKeyCdm. This is to test the CDM initialization + // failure case. + concrete_key_systems->emplace_back( + new ExternalClearKeyProperties(kExternalClearKeyInitializeFailKeySystem)); + + // A key system that triggers a crash in ClearKeyCdm. + concrete_key_systems->emplace_back( + new ExternalClearKeyProperties(kExternalClearKeyCrashKeySystem)); +} + #if defined(WIDEVINE_CDM_AVAILABLE) // This function finds "codecs" and parses the value into the vector |codecs|. // Converts the codec strings to UTF-8 since we only expect ASCII strings and @@ -79,11 +195,11 @@ void GetSupportedCodecsForPepperCdm( } static void AddPepperBasedWidevine( - std::vector* concrete_key_systems) { + std::vector>* concrete_key_systems) { #if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) Version glibc_version(gnu_get_libc_version()); DCHECK(glibc_version.IsValid()); - if (glibc_version.IsOlderThan(WIDEVINE_CDM_MIN_GLIBC_VERSION)) + if (glibc_version < base::Version(WIDEVINE_CDM_MIN_GLIBC_VERSION)) return; #endif // defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) @@ -120,10 +236,12 @@ static void AddPepperBasedWidevine( #if defined(USE_PROPRIETARY_CODECS) if (codecs[i] == kCdmSupportedCodecAvc1) supported_codecs |= media::EME_CODEC_MP4_AVC1; + if (codecs[i] == kCdmSupportedCodecVp9) + supported_codecs |= media::EME_CODEC_MP4_VP9; #endif // defined(USE_PROPRIETARY_CODECS) } - cdm::AddWidevineWithCodecs( + concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties( supported_codecs, #if defined(OS_CHROMEOS) media::EmeRobustness::HW_SECURE_ALL, // Maximum audio robustness. @@ -131,27 +249,29 @@ static void AddPepperBasedWidevine( media::EmeSessionTypeSupport:: SUPPORTED_WITH_IDENTIFIER, // Persistent-license. media::EmeSessionTypeSupport:: - NOT_SUPPORTED, // Persistent-release-message. - media::EmeFeatureSupport::REQUESTABLE, // Persistent state. - media::EmeFeatureSupport::REQUESTABLE, // Distinctive identifier. + NOT_SUPPORTED, // Persistent-release-message. + media::EmeFeatureSupport::REQUESTABLE, // Persistent state. + media::EmeFeatureSupport::REQUESTABLE)); // Distinctive identifier. #else // (Desktop) media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness. media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness. media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. media::EmeSessionTypeSupport:: - NOT_SUPPORTED, // persistent-release-message. - media::EmeFeatureSupport::REQUESTABLE, // Persistent state. - media::EmeFeatureSupport::NOT_SUPPORTED, // Distinctive identifier. + NOT_SUPPORTED, // persistent-release-message. + media::EmeFeatureSupport::REQUESTABLE, // Persistent state. + media::EmeFeatureSupport::NOT_SUPPORTED)); // Distinctive identifier. #endif // defined(OS_CHROMEOS) - concrete_key_systems); } #endif // defined(WIDEVINE_CDM_AVAILABLE) #endif // defined(ENABLE_PEPPER_CDMS) -void AddChromeKeySystems(std::vector* key_systems_info) { +void AddChromeKeySystems( + std::vector>* key_systems_properties) { #if defined(ENABLE_PEPPER_CDMS) + AddExternalClearKey(key_systems_properties); + #if defined(WIDEVINE_CDM_AVAILABLE) - AddPepperBasedWidevine(key_systems_info); + AddPepperBasedWidevine(key_systems_properties); #endif // defined(WIDEVINE_CDM_AVAILABLE) #endif // defined(ENABLE_PEPPER_CDMS) } diff --git a/chromium_src/chrome/renderer/media/chrome_key_systems.h b/chromium_src/chrome/renderer/media/chrome_key_systems.h index dfec84f3b39..3e82ee70e2b 100644 --- a/chromium_src/chrome/renderer/media/chrome_key_systems.h +++ b/chromium_src/chrome/renderer/media/chrome_key_systems.h @@ -5,10 +5,16 @@ #ifndef CHROME_RENDERER_MEDIA_CHROME_KEY_SYSTEMS_H_ #define CHROME_RENDERER_MEDIA_CHROME_KEY_SYSTEMS_H_ +#include #include -#include "media/base/key_system_info.h" +namespace media { +class KeySystemProperties; +} -void AddChromeKeySystems(std::vector* key_systems_info); +// Register the key systems supported by populating |key_systems_properties|. +void AddChromeKeySystems( + std::vector>* + key_systems_properties); #endif // CHROME_RENDERER_MEDIA_CHROME_KEY_SYSTEMS_H_ diff --git a/chromium_src/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc b/chromium_src/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc index 7c219f60b81..9919fb47b03 100644 --- a/chromium_src/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc +++ b/chromium_src/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc @@ -4,7 +4,8 @@ #include "chrome/renderer/pepper/pepper_shared_memory_message_filter.h" -#include "base/memory/scoped_ptr.h" +#include + #include "base/memory/shared_memory.h" #include "base/process/process_handle.h" #include "content/public/common/content_client.h" 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 e3e64488097..0a00f2ebb1a 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper.h +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper.h @@ -5,11 +5,11 @@ #ifndef CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ #define CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ +#include #include #include "base/callback.h" #include "base/gtest_prod_util.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/shared_memory.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc index 608f406e623..216d8236a88 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc @@ -4,8 +4,9 @@ #include "chrome/renderer/printing/print_web_view_helper.h" +#include + #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "chrome/common/print_messages.h" #include "content/public/renderer/render_thread.h" #include "printing/metafile_skia_wrapper.h" diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc index 7ff17a388bc..96a128652a7 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc @@ -4,8 +4,9 @@ #include "chrome/renderer/printing/print_web_view_helper.h" +#include + #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/process/process_handle.h" #include "chrome/common/print_messages.h" #include "content/public/renderer/render_thread.h" diff --git a/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h b/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h index 4490c7a90e8..7e07d29273a 100644 --- a/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h +++ b/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h @@ -9,10 +9,10 @@ #ifndef CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_WORDITERATOR_H_ #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_WORDITERATOR_H_ +#include #include #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "third_party/icu/source/common/unicode/uscript.h" diff --git a/chromium_src/chrome/renderer/tts_dispatcher.h b/chromium_src/chrome/renderer/tts_dispatcher.h index 0a770d72183..45db9751c8b 100644 --- a/chromium_src/chrome/renderer/tts_dispatcher.h +++ b/chromium_src/chrome/renderer/tts_dispatcher.h @@ -8,7 +8,7 @@ #include #include "base/containers/hash_tables.h" -#include "content/public/renderer/render_process_observer.h" +#include "content/public/renderer/render_thread_observer.h" #include "third_party/WebKit/public/platform/WebSpeechSynthesizer.h" #include "third_party/WebKit/public/platform/WebSpeechSynthesizerClient.h" @@ -27,7 +27,7 @@ struct TtsVoice; // the utterance id (which is globally unique) matches. class TtsDispatcher : public blink::WebSpeechSynthesizer, - public content::RenderProcessObserver { + public content::RenderThreadObserver { public: explicit TtsDispatcher(blink::WebSpeechSynthesizerClient* client); diff --git a/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc b/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc index 2514c636cbe..0b16c1395eb 100644 --- a/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc +++ b/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc @@ -4,6 +4,8 @@ #include "net/test/embedded_test_server/stream_listen_socket.h" +#include + #if defined(OS_WIN) // winsock2.h must be included first in order to ensure it is included before // windows.h. @@ -20,7 +22,6 @@ #include "base/files/file_util.h" #include "base/logging.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/posix/eintr_wrapper.h" #include "base/sys_byteorder.h" #include "base/threading/platform_thread.h" diff --git a/chromium_src/net/test/embedded_test_server/stream_listen_socket.h b/chromium_src/net/test/embedded_test_server/stream_listen_socket.h index 7ad25437ec3..00d4b58dcf3 100644 --- a/chromium_src/net/test/embedded_test_server/stream_listen_socket.h +++ b/chromium_src/net/test/embedded_test_server/stream_listen_socket.h @@ -16,6 +16,8 @@ #ifndef NET_TEST_EMBEDDED_TEST_SERVER_STREAM_LISTEN_SOCKET_H_ #define NET_TEST_EMBEDDED_TEST_SERVER_STREAM_LISTEN_SOCKET_H_ +#include + #include "build/build_config.h" #if defined(OS_WIN) @@ -30,7 +32,6 @@ #include "base/macros.h" #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" #include "net/base/net_export.h" #include "net/socket/socket_descriptor.h" diff --git a/common.gypi b/common.gypi index 3389e18690a..2a22c957c91 100644 --- a/common.gypi +++ b/common.gypi @@ -14,11 +14,14 @@ 'python': 'python', 'openssl_fips': '', 'openssl_no_asm': 1, + 'use_openssl_def': 0, + 'OPENSSL_PRODUCT': 'libopenssl.a', 'node_release_urlbase': 'https://atom.io/download/atom-shell', 'node_byteorder': ' -Para establecer tu menú dock, puedes utilizar la API `app.dock.setMenu`, la cual sólo está disponible para OSX: +Para establecer tu menú dock, puedes utilizar la API `app.dock.setMenu`, la cual sólo está disponible para macOS: ```javascript var app = require('app'); diff --git a/docs-translations/es/tutorial/quick-start.md b/docs-translations/es/tutorial/quick-start.md index 47008d6f5fc..b54c1fc3642 100644 --- a/docs-translations/es/tutorial/quick-start.md +++ b/docs-translations/es/tutorial/quick-start.md @@ -35,8 +35,8 @@ porque la gestión de los recursos GUI nativos es peligrosa, y tiende a que ocur Si deseas realizar operaciones GUI en una página web, el proceso renderer de la página web debe comunicarse con el proceso principal, y solicitar a este que realice esas operaciones. -En Electron, hemos proveído el módulo [ipc](../api/ipc-renderer.md) para la comunicación -entre el proceso principal y el proceso renderer. Y también hay un módulo [remote](../api/remote.md) +En Electron, hemos proveído el módulo [ipc](../../../docs/api/ipc-renderer.md) para la comunicación +entre el proceso principal y el proceso renderer. Y también hay un módulo [remote](../../../docs/api/remote.md) para comunicación al estilo RPC. ## Escribe tu primera aplicación Electron diff --git a/docs-translations/es/tutorial/using-pepper-flash-plugin.md b/docs-translations/es/tutorial/using-pepper-flash-plugin.md index 85176f7f864..9015bafc643 100644 --- a/docs-translations/es/tutorial/using-pepper-flash-plugin.md +++ b/docs-translations/es/tutorial/using-pepper-flash-plugin.md @@ -4,7 +4,7 @@ El plugin Pepper Flash es soportado ahora. Para utilizar pepper flash en Electro ## Preparar una copia del plugin Flash -En OSX y Linux, el detalle del plugin puede encontrarse accediendo a `chrome://plugins` en el navegador. Su ubicación y versión son útiles para el soporte. También puedes copiarlo a otro lugar. +En macOS y Linux, el detalle del plugin puede encontrarse accediendo a `chrome://plugins` en el navegador. Su ubicación y versión son útiles para el soporte. También puedes copiarlo a otro lugar. ## Agrega la opción a Electron diff --git a/docs-translations/pt-BR/tutorial/application-distribution.md b/docs-translations/pt-BR/tutorial/application-distribution.md index 3bff230dae9..d2bc020bedf 100644 --- a/docs-translations/pt-BR/tutorial/application-distribution.md +++ b/docs-translations/pt-BR/tutorial/application-distribution.md @@ -1,11 +1,11 @@ # Distribuição de aplicações Para distribuir sua aplicação com o Electron, você deve nomear o diretório que contém sua aplicação como -`app` e dentro deste diretório colocar os recursos que você está utilizando (no OSX +`app` e dentro deste diretório colocar os recursos que você está utilizando (no macOS `Electron.app/Contents/Resources/`, no Linux e no Windows é em `resources/`): -No OSX: +No macOS: ```text electron/Electron.app/Contents/Resources/app/ @@ -37,7 +37,7 @@ Para usar um arquivo `asar` ao invés da pasta `app` você precisa mudar o nome arquivo para `app.asar` e colocá-lo sob o diretório de recursos do Electron como mostrado abaixo, então o Electron vai ler o arquivo e iniciar a aplicação a partir dele. -No OSX: +No macOS: ```text electron/Electron.app/Contents/Resources/ diff --git a/docs-translations/pt-BR/tutorial/using-native-node-modules.md b/docs-translations/pt-BR/tutorial/using-native-node-modules.md index 8cc883046eb..a7d68ad90cf 100644 --- a/docs-translations/pt-BR/tutorial/using-native-node-modules.md +++ b/docs-translations/pt-BR/tutorial/using-native-node-modules.md @@ -8,12 +8,12 @@ módulos nativos. ## Compatibilidade de Módulos Nativos do Node Módulos nativos podem quebrar quando utilizar a nova versão do Node, V8. -Para ter certeza que o módulo que você está interessado em trabalhar com o +Para ter certeza que o módulo que você está interessado em trabalhar com o Electron, você deve checar se a versão do Node utilizada é compatível com a usada pelo Electron. Você pode verificar qual versão do Node foi utilizada no Electron olhando na página [releases](https://github.com/electron/electron/releases) ou usando -`process.version` (veja [Quick Start](https://github.com/electron/electron/blob/master/docs/tutorial/quick-start.md) +`process.version` (veja em [Introdução](quick-start.md) por exemplo). Considere usar [NAN](https://github.com/nodejs/nan/) para seus próprios diff --git a/docs-translations/zh-CN/tutorial/quick-start.md b/docs-translations/zh-CN/tutorial/quick-start.md index 4330bde6336..aab47888a04 100644 --- a/docs-translations/zh-CN/tutorial/quick-start.md +++ b/docs-translations/zh-CN/tutorial/quick-start.md @@ -70,30 +70,30 @@ function createWindow() { }); } -// This method will be called when Electron has finished -// initialization and is ready to create browser windows. -// Some APIs can only be used after this event occurs. +// Electron 会在初始化后并准备 +// 创建浏览器窗口时,调用这个函数。 +// 部分 API 在 ready 事件触发后才能使用。 app.on('ready', createWindow); -// Quit when all windows are closed. +// 当全部窗口关闭时退出。 app.on('window-all-closed', () => { - // On macOS it is common for applications and their menu bar - // to stay active until the user quits explicitly with Cmd + Q + // 在 macOS 上,除非用户用 Cmd + Q 确定地退出, + // 否则绝大部分应用及其菜单栏会保持激活。 if (process.platform !== 'darwin') { app.quit(); } }); app.on('activate', () => { - // On macOS it's common to re-create a window in the app when the - // dock icon is clicked and there are no other windows open. + // 在 macOS 上,当点击 dock 图标并且该应用没有打开的窗口时, + // 绝大部分应用会重新创建一个窗口。 if (mainWindow === null) { createWindow(); } }); -// In this file you can include the rest of your app's specific main process -// code. You can also put them in separate files and require them here. +// 在这文件,你可以续写应用剩下主进程代码。 +// 也可以拆分成几个文件,然后用 require 导入。 ``` 最后,你想展示的 `index.html` : ```html @@ -151,11 +151,11 @@ $ ./Electron.app/Contents/MacOS/Electron your-app/ *注意:*运行时需要你的系统已经安装了 [Git][9] 和 [Node.js][10](包含 [npm][11])。 ```bash -# Clone the repository +# 克隆这仓库 $ git clone https://github.com/electron/electron-quick-start -# Go into the repository +# 进入仓库 $ cd electron-quick-start -# Install dependencies and run the app +# 安装依赖库并运行应用 $ npm install && npm start ``` [1]: https://github.com/electron/electron/blob/v1.1.3/docs/api/ipc-renderer.md diff --git a/docs/api/app.md b/docs/api/app.md index 76f3caa2439..114ac8c5e09 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -181,9 +181,9 @@ Returns: * `data` Buffer - PEM encoded data * `issuerName` String - Issuer's Common Name * `subjectName` String - Subject's Common Name - * `serialNumber` Buffer - DER encoded data - * `validStart` Integer - Start date of the certificate being valid - * `validExpiry` Integer - End date of the certificate being valid + * `serialNumber` String - Hex value represented string + * `validStart` Integer - Start date of the certificate being valid in seconds + * `validExpiry` Integer - End date of the certificate being valid in seconds * `fingerprint` String - Fingerprint of the certificate * `callback` Function @@ -214,9 +214,9 @@ Returns: * `data` Buffer - PEM encoded data * `issuerName` String - Issuer's Common Name * `subjectName` String - Subject's Common Name - * `serialNumber` - DER encoded data - * `validStart` Integer - Start date of the certificate being valid - * `validExpiry` Integer - End date of the certificate being valid + * `serialNumber` String - Hex value represented string + * `validStart` Integer - Start date of the certificate being valid in seconds + * `validExpiry` Integer - End date of the certificate being valid in seconds * `fingerprint` String - Fingerprint of the certificate * `callback` Function diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 86b06008449..73d53ed875c 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -253,8 +253,6 @@ The `webPreferences` option is an object that can have the following properties: Default is `false`. * `experimentalCanvasFeatures` Boolean - Enables Chromium's experimental canvas features. Default is `false`. -* `directWrite` Boolean - Enables DirectWrite font rendering system on - Windows. Default is `true`. * `scrollBounce` Boolean - Enables scroll bounce (rubber banding) effect on macOS. Default is `false`. * `blinkFeatures` String - A list of feature strings separated by `,`, like diff --git a/docs/api/file-object.md b/docs/api/file-object.md index d0f36e273df..b1e643c7408 100644 --- a/docs/api/file-object.md +++ b/docs/api/file-object.md @@ -24,8 +24,9 @@ Example on getting a real path from a dragged-onto-the-app file: }; holder.ondrop = (e) => { e.preventDefault(); - const file = e.dataTransfer.files[0]; - console.log('File you dragged here is', file.path); + for (let f of e.dataTransfer.files) { + console.log('File(s) you dragged here: ', f.path); + } return false; }; diff --git a/docs/api/native-image.md b/docs/api/native-image.md index f03178577b8..4bf12413f21 100644 --- a/docs/api/native-image.md +++ b/docs/api/native-image.md @@ -3,21 +3,21 @@ > Create tray, dock, and application icons using PNG or JPG files. In Electron, for the APIs that take images, you can pass either file paths or -`nativeImage` instances. An empty image will be used when `null` is passed. +`NativeImage` instances. An empty image will be used when `null` is passed. For example, when creating a tray or setting a window's icon, you can pass an image file path as a `String`: ```javascript -const appIcon = new Tray('/Users/somebody/images/icon.png'); -let win = new BrowserWindow({icon: '/Users/somebody/images/window.png'}); +const appIcon = new Tray('/Users/somebody/images/icon.png') +let win = new BrowserWindow({icon: '/Users/somebody/images/window.png'}) ``` Or read the image from the clipboard which returns a `nativeImage`: ```javascript -const image = clipboard.readImage(); -const appIcon = new Tray(image); +const image = clipboard.readImage() +const appIcon = new Tray(image) ``` ## Supported Formats @@ -25,8 +25,8 @@ const appIcon = new Tray(image); Currently `PNG` and `JPEG` image formats are supported. `PNG` is recommended because of its support for transparency and lossless compression. -On Windows, you can also load `ICO` icons from file paths, to get best visual -effects it is recommended to include at least followings sizes in the icon: +On Windows, you can also load `ICO` icons from file paths. For best visual +quality it is recommended to include at least the following sizes in the icon: * 16x16 * 32x32 @@ -35,8 +35,8 @@ effects it is recommended to include at least followings sizes in the icon: ## High Resolution Image -On platforms that have high-DPI support, you can append `@2x` after image's -base filename to mark it as a high resolution image. +On platforms that have high-DPI support such as Apple Retina displays, you can +append `@2x` after image's base filename to mark it as a high resolution image. For example if `icon.png` is a normal image that has standard resolution, then `icon@2x.png` will be treated as a high resolution image that has double DPI @@ -55,7 +55,7 @@ images/ ```javascript -let appIcon = new Tray('/Users/somebody/images/icon.png'); +let appIcon = new Tray('/Users/somebody/images/icon.png') ``` Following suffixes for DPI are also supported: @@ -91,22 +91,22 @@ To mark an image as a template image, its filename should end with the word ## Methods -The `nativeImage` class has the following methods: +The `nativeImage` module has the following methods, all of which return +an instance of the `NativeImage` class: ### `nativeImage.createEmpty()` -Creates an empty `nativeImage` instance. +Creates an empty `NativeImage` instance. ### `nativeImage.createFromPath(path)` * `path` String -Creates a new `nativeImage` instance from a file located at `path`. +Creates a new `NativeImage` instance from a file located at `path`. ```javascript -const nativeImage = require('electron').nativeImage; - -let image = nativeImage.createFromPath('/Users/somebody/images/icon.png'); +const {nativeImage} = require('electron') +let image = nativeImage.createFromPath('/Users/somebody/images/icon.png') ``` ### `nativeImage.createFromBuffer(buffer[, scaleFactor])` @@ -114,34 +114,38 @@ let image = nativeImage.createFromPath('/Users/somebody/images/icon.png'); * `buffer` [Buffer][buffer] * `scaleFactor` Double (optional) -Creates a new `nativeImage` instance from `buffer`. The default `scaleFactor` is +Creates a new `NativeImage` instance from `buffer`. The default `scaleFactor` is 1.0. ### `nativeImage.createFromDataURL(dataURL)` * `dataURL` String -Creates a new `nativeImage` instance from `dataURL`. +Creates a new `NativeImage` instance from `dataURL`. -## Instance Methods +## Class: NativeImage -The following methods are available on instances of `nativeImage`: +A native wrapper for images such as tray, dock, and application icons. -### `image.toPNG()` +### Instance Methods + +The following methods are available on instances of the `NativeImage` class: + +#### `image.toPNG()` Returns a [Buffer][buffer] that contains the image's `PNG` encoded data. -### `image.toJPEG(quality)` +#### `image.toJPEG(quality)` * `quality` Integer (**required**) - Between 0 - 100. Returns a [Buffer][buffer] that contains the image's `JPEG` encoded data. -### `image.toDataURL()` +#### `image.toDataURL()` Returns the data URL of the image. -### `image.getNativeHandle()` _macOS_ +#### `image.getNativeHandle()` _macOS_ Returns a [Buffer][buffer] that stores C pointer to underlying native handle of the image. On macOS, a pointer to `NSImage` instance would be returned. @@ -150,22 +154,22 @@ Notice that the returned pointer is a weak pointer to the underlying native image instead of a copy, so you _must_ ensure that the associated `nativeImage` instance is kept around. -### `image.isEmpty()` +#### `image.isEmpty()` Returns a boolean whether the image is empty. -### `image.getSize()` +#### `image.getSize()` Returns the size of the image. [buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer -### `image.setTemplateImage(option)` +#### `image.setTemplateImage(option)` * `option` Boolean -Marks the image as template image. +Marks the image as a template image. -### `image.isTemplateImage()` +#### `image.isTemplateImage()` Returns a boolean whether the image is a template image. diff --git a/docs/api/session.md b/docs/api/session.md index 2053a44a5f5..527effc4d0b 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -121,6 +121,8 @@ Writes any unwritten DOMStorage data to disk. * `config` Object * `pacScript` String - The URL associated with the PAC file. * `proxyRules` String - Rules indicating which proxies to use. + * `proxyBypassRules` String - Rules indicating which URLs should + bypass the proxy settings. * `callback` Function - Called when operation is done. Sets the proxy settings. @@ -153,6 +155,43 @@ For example: * `http=foopy;socks=foopy2` - Use HTTP proxy `foopy` for http URLs, and use `socks4://foopy2` for all other URLs. +The `proxyBypassRules` is a comma separated list of rules described below: + +* `[ URL_SCHEME "://" ] HOSTNAME_PATTERN [ ":" ]` + + Match all hostnames that match the pattern HOSTNAME_PATTERN. + + Examples: + "foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99", + "https://x.*.y.com:99" + + * `"." HOSTNAME_SUFFIX_PATTERN [ ":" PORT ]` + + Match a particular domain suffix. + + Examples: + ".google.com", ".com", "http://.google.com" + +* `[ SCHEME "://" ] IP_LITERAL [ ":" PORT ]` + + Match URLs which are IP address literals. + + Examples: + "127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99" + +* `IP_LITERAL "/" PREFIX_LENGHT_IN_BITS` + + Match any URL that is to an IP literal that falls between the + given range. IP range is specified using CIDR notation. + + Examples: + "192.168.1.1/16", "fefe:13::abc/33". + +* `` + + Match local addresses. The meaning of `` is whether the + host matches one of: "127.0.0.1", "::1", "localhost". + ### `ses.resolveProxy(url, callback)` * `url` URL diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 7e3a9542228..714d61eced9 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -231,9 +231,9 @@ Returns: * `data` Buffer - PEM encoded data * `issuerName` String - Issuer's Common Name * `subjectName` String - Subject's Common Name - * `serialNumber` - DER encoded data - * `validStart` Integer - Start date of the certificate being valid - * `validExpiry` Integer - End date of the certificate being valid + * `serialNumber` String - Hex value represented string + * `validStart` Integer - Start date of the certificate being valid in seconds + * `validExpiry` Integer - End date of the certificate being valid in seconds * `fingerprint` String - Fingerprint of the certificate * `callback` Function @@ -252,9 +252,9 @@ Returns: * `data` Buffer - PEM encoded data * `issuerName` String - Issuer's Common Name * `subjectName` String - Subject's Common Name - * `serialNumber` - DER encoded data - * `validStart` Integer - Start date of the certificate being valid - * `validExpiry` Integer - End date of the certificate being valid + * `serialNumber` String - Hex value represented string + * `validStart` Integer - Start date of the certificate being valid in seconds + * `validExpiry` Integer - End date of the certificate being valid in seconds * `fingerprint` String - Fingerprint of the certificate * `callback` Function @@ -367,7 +367,7 @@ Returns: was invoked on. Elements with source URLs are images, audio and video. * `mediaType` String - Type of the node the context menu was invoked on. Can be `none`, `image`, `audio`, `video`, `canvas`, `file` or `plugin`. - * `hasImageContent` Boolean - Whether the context menu was invoked on an image + * `hasImageContents` Boolean - Whether the context menu was invoked on an image which has non-empty contents. * `isEditable` Boolean - Whether the context is editable. * `selectionText` String - Text of the selection that the context menu was @@ -448,6 +448,10 @@ app.on('ready', () => { }) ``` +#### Event: 'view-painted' + +Emitted when a page's view is repainted. + ### Instance Methods #### `contents.loadURL(url[, options])` diff --git a/docs/api/web-view-tag.md b/docs/api/web-view-tag.md index 126ee5a424f..e5f6df811d4 100644 --- a/docs/api/web-view-tag.md +++ b/docs/api/web-view-tag.md @@ -121,9 +121,6 @@ than the minimum values or greater than the maximum. If "on", the guest page in `webview` will have node integration and can use node APIs like `require` and `process` to access low level system resources. -**Note:** Node integration will always be disabled in the `webview` if it is -disabled on the parent window. - ### `plugins` ```html diff --git a/docs/api/window-open.md b/docs/api/window-open.md index fd57790042c..4757f1ffe02 100644 --- a/docs/api/window-open.md +++ b/docs/api/window-open.md @@ -10,8 +10,8 @@ The proxy has limited standard functionality implemented to be compatible with traditional web pages. For full control of the new window you should create a `BrowserWindow` directly. -The newly created `BrowserWindow` will inherit parent window's options by -default, to override inherited options you can set them in the `features` +The newly created `BrowserWindow` will inherit the parent window's options by +default. To override inherited options you can set them in the `features` string. ### `window.open(url[, frameName][, features])` @@ -45,33 +45,33 @@ limited functionality with the child window. The `BrowserWindowProxy` object has the following instance methods: -#### `BrowserWindowProxy.blur()` +#### `win.blur()` Removes focus from the child window. -#### `BrowserWindowProxy.close()` +#### `win.close()` Forcefully closes the child window without calling its unload event. -#### `BrowserWindowProxy.closed` +#### `win.closed` Set to true after the child window gets closed. -#### `BrowserWindowProxy.eval(code)` +#### `win.eval(code)` * `code` String Evaluates the code in the child window. -#### `BrowserWindowProxy.focus()` +#### `win.focus()` Focuses the child window (brings the window to front). -#### `BrowserWindowProxy.print()` +#### `win.print()` Invokes the print dialog on the child window. -#### `BrowserWindowProxy.postMessage(message, targetOrigin)` +#### `win.postMessage(message, targetOrigin)` * `message` String * `targetOrigin` String diff --git a/docs/faq.md b/docs/faq.md index 1e96d47c210..51ebf687a41 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -9,7 +9,7 @@ depends on the amount of work involved with upgrading. Only the stable channel of Chrome is used. If an important fix is in beta or dev channel, we will back-port it. -For more information, please see the [security introduction](../tutorial/security.md). +For more information, please see the [security introduction](tutorial/security.md). ## When will Electron upgrade to latest Node.js? diff --git a/docs/tutorial/application-packaging.md b/docs/tutorial/application-packaging.md index 8a7f8701610..07caa681102 100644 --- a/docs/tutorial/application-packaging.md +++ b/docs/tutorial/application-packaging.md @@ -95,7 +95,7 @@ $.get('file:///path/to/example.asar/file.txt', (data) => { ### Treating an `asar` Archive as a Normal File For some cases like verifying the `asar` archive's checksum, we need to read the -content of `asar` archive as file. For this purpose you can use the built-in +content of an `asar` archive as a file. For this purpose you can use the built-in `original-fs` module which provides original `fs` APIs without `asar` support: ```javascript @@ -111,7 +111,7 @@ process.noAsar = true; fs.readFileSync('/path/to/example.asar'); ``` -## Limitations on Node API +## Limitations of the Node API Even though we tried hard to make `asar` archives in the Node API work like directories as much as possible, there are still limitations due to the diff --git a/electron.gyp b/electron.gyp index 3728eb4025b..4f8a1056c57 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '1.2.7', + 'version%': '1.3.0', }, 'includes': [ 'filenames.gypi', @@ -150,9 +150,11 @@ '<(libchromiumcontent_dir)/libEGL.dll', '<(libchromiumcontent_dir)/libGLESv2.dll', '<(libchromiumcontent_dir)/icudtl.dat', + '<(libchromiumcontent_dir)/blink_image_resources_200_percent.pak', '<(libchromiumcontent_dir)/content_resources_200_percent.pak', '<(libchromiumcontent_dir)/content_shell.pak', '<(libchromiumcontent_dir)/ui_resources_200_percent.pak', + '<(libchromiumcontent_dir)/views_resources_200_percent.pak', '<(libchromiumcontent_dir)/natives_blob.bin', '<(libchromiumcontent_dir)/snapshot_blob.bin', 'external_binaries/d3dcompiler_47.dll', @@ -207,6 +209,9 @@ 'vendor/node/node.gyp:node', ], 'defines': [ + # We need to access internal implementations of Node. + 'NODE_WANT_INTERNALS=1', + 'NODE_SHARED_MODE', # This is defined in skia/skia_common.gypi. 'SK_SUPPORT_LEGACY_GETTOPDEVICE', # Disable warnings for g_settings_list_schemas. diff --git a/lib/browser/api/ipc-main.js b/lib/browser/api/ipc-main.js index 62e1404731f..2e45b391f7e 100644 --- a/lib/browser/api/ipc-main.js +++ b/lib/browser/api/ipc-main.js @@ -1,3 +1,6 @@ const EventEmitter = require('events').EventEmitter module.exports = new EventEmitter() + +// Do not throw exception when channel name is "error". +module.exports.on('error', () => {}) diff --git a/lib/browser/rpc-server.js b/lib/browser/rpc-server.js index 083c5e4d03e..d240561837e 100644 --- a/lib/browser/rpc-server.js +++ b/lib/browser/rpc-server.js @@ -59,7 +59,7 @@ let valueToMeta = function (sender, value, optimizeSimpleObject = false) { // Recognize certain types of objects. if (value === null) { meta.type = 'value' - } else if (Buffer.isBuffer(value)) { + } else if (ArrayBuffer.isView(value)) { meta.type = 'buffer' } else if (Array.isArray(value)) { meta.type = 'array' @@ -148,7 +148,7 @@ const unwrapArgs = function (sender, args) { case 'array': return unwrapArgs(sender, meta.value) case 'buffer': - return new Buffer(meta.value) + return Buffer.from(meta.value) case 'date': return new Date(meta.value) case 'promise': diff --git a/lib/renderer/api/remote.js b/lib/renderer/api/remote.js index 40f067f3401..20d8ea574cb 100644 --- a/lib/renderer/api/remote.js +++ b/lib/renderer/api/remote.js @@ -30,7 +30,7 @@ const wrapArgs = function (args, visited) { } visited.delete(value) return meta - } else if (Buffer.isBuffer(value)) { + } else if (ArrayBuffer.isView(value)) { return { type: 'buffer', value: Array.prototype.slice.call(value, 0) @@ -163,7 +163,7 @@ const metaToValue = function (meta) { } return results case 'buffer': - return new Buffer(meta.value) + return Buffer.from(meta.value) case 'promise': return Promise.resolve({ then: metaToValue(meta.then) diff --git a/package.json b/package.json index ae2196c14eb..6dab962b19d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "1.2.7", + "version": "1.3.0", "devDependencies": { "asar": "^0.11.0", "request": "*", diff --git a/script/create-dist.py b/script/create-dist.py index d2862e90f50..ff2f22f4090 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -38,8 +38,10 @@ TARGET_BINARIES = { 'libGLESv2.dll', 'ffmpeg.dll', 'node.dll', + 'blink_image_resources_200_percent.pak', 'content_resources_200_percent.pak', 'ui_resources_200_percent.pak', + 'views_resources_200_percent.pak', 'xinput1_3.dll', 'natives_blob.bin', 'snapshot_blob.bin', diff --git a/script/lib/config.py b/script/lib/config.py index 08297c58a27..1b6fb12f667 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -8,7 +8,7 @@ import sys BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \ 'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '31144d583c19b70d8d9de7d4ef15f0f720779860' +LIBCHROMIUMCONTENT_COMMIT = '141739f27054dbe032226a6547ff27a9f5f5626c' PLATFORM = { 'cygwin': 'win32', diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index bd1a7e3d86b..83413e08f06 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -142,20 +142,25 @@ describe('ipc module', function () { }) describe('remote value in browser', function () { - var print = path.join(fixtures, 'module', 'print_name.js') + const print = path.join(fixtures, 'module', 'print_name.js') + const printName = remote.require(print) it('keeps its constructor name for objects', function () { - var buf = new Buffer('test') - var printName = remote.require(print) + const buf = new Buffer('test') assert.equal(printName.print(buf), 'Buffer') }) it('supports instanceof Date', function () { - var now = new Date() - var printName = remote.require(print) + const now = new Date() assert.equal(printName.print(now), 'Date') assert.deepEqual(printName.echo(now), now) }) + + it('supports TypedArray', function () { + const values = [1, 2, 3, 4] + const typedArray = printName.typedArray(values) + assert.deepEqual(values, typedArray) + }) }) describe('remote promise', function () { diff --git a/spec/api-protocol-spec.js b/spec/api-protocol-spec.js index f665210c0fd..597f061c6d8 100644 --- a/spec/api-protocol-spec.js +++ b/spec/api-protocol-spec.js @@ -51,6 +51,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data) { assert.equal(data, text) done() @@ -69,6 +70,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function () { return done('request succeeded but it should not') }, @@ -92,6 +94,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data) { assert.equal(data, text) done() @@ -124,6 +127,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data) { assert.equal(data, text) done() @@ -145,6 +149,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data, status, request) { assert.equal(data, text) assert.equal(request.getResponseHeader('Access-Control-Allow-Origin'), '*') @@ -170,6 +175,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data) { assert.equal(data, text) done() @@ -191,6 +197,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function () { done('request succeeded but it should not') }, @@ -216,6 +223,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data) { assert.equal(data, text) done() @@ -238,6 +246,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data, status, request) { assert.equal(data, text) assert.equal(request.getResponseHeader('Access-Control-Allow-Origin'), '*') @@ -263,6 +272,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data) { assert.equal(data, text) done() @@ -284,6 +294,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function () { done('request succeeded but it should not') }, @@ -312,6 +323,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data) { assert.equal(data, String(fileContent)) return done() @@ -333,6 +345,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data, status, request) { assert.equal(data, String(fileContent)) assert.equal(request.getResponseHeader('Access-Control-Allow-Origin'), '*') @@ -357,6 +370,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data) { assert.equal(data, String(fileContent)) done() @@ -379,6 +393,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data) { assert.equal(data, String(normalContent)) done() @@ -401,6 +416,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function () { done('request succeeded but it should not') }, @@ -422,6 +438,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function () { done('request succeeded but it should not') }, @@ -455,6 +472,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function (data) { assert.equal(data, text) done() @@ -479,6 +497,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function () { done('request succeeded but it should not') }, @@ -500,6 +519,7 @@ describe('protocol module', function () { } $.ajax({ url: protocolName + '://fake-host', + cache: false, success: function () { done('request succeeded but it should not') }, @@ -634,6 +654,7 @@ describe('protocol module', function () { } $.ajax({ url: 'http://fake-host', + cache: false, success: function (data) { assert.equal(data, text) done() @@ -655,6 +676,7 @@ describe('protocol module', function () { } $.ajax({ url: 'http://fake-host', + cache: false, success: function () { done('request succeeded but it should not') }, @@ -678,6 +700,7 @@ describe('protocol module', function () { } $.ajax({ url: 'http://fake-host', + cache: false, success: function (data) { assert.equal(data, text) done() @@ -702,6 +725,7 @@ describe('protocol module', function () { } $.ajax({ url: 'http://fake-host', + cache: false, success: function (data) { assert.equal(typeof data, 'object') assert.equal(data.value, 1) @@ -727,6 +751,7 @@ describe('protocol module', function () { } $.ajax({ url: 'http://fake-host', + cache: false, type: 'POST', data: postData, success: function (data) { @@ -752,6 +777,7 @@ describe('protocol module', function () { } $.ajax({ url: 'http://fake-host', + cache: false, success: function (data) { assert.equal(data, text) done() @@ -774,6 +800,7 @@ describe('protocol module', function () { } $.ajax({ url: 'http://fake-host', + cache: false, type: 'POST', data: postData, success: function (data) { @@ -821,6 +848,7 @@ describe('protocol module', function () { } $.ajax({ url: 'http://fake-host', + cache: false, type: 'POST', data: postData, success: function (data) { diff --git a/spec/api-session-spec.js b/spec/api-session-spec.js index 1696fedc4fe..640cc44551d 100644 --- a/spec/api-session-spec.js +++ b/spec/api-session-spec.js @@ -342,4 +342,31 @@ describe('session module', function () { w.loadURL(`${protocolName}://fake-host`) }) }) + + describe('ses.setProxy(options, callback)', function () { + it('allows configuring proxy settings', function (done) { + const config = { + proxyRules: 'http=myproxy:80' + } + session.defaultSession.setProxy(config, function () { + session.defaultSession.resolveProxy('http://localhost', function (proxy) { + assert.equal(proxy, 'PROXY myproxy:80') + done() + }) + }) + }) + + it('allows bypassing proxy settings', function (done) { + const config = { + proxyRules: 'http=myproxy:80', + proxyBypassRules: '' + } + session.defaultSession.setProxy(config, function () { + session.defaultSession.resolveProxy('http://localhost', function (proxy) { + assert.equal(proxy, 'DIRECT') + done() + }) + }) + }) + }) }) diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index a9519de131a..b9195702a32 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -63,12 +63,12 @@ describe('webContents module', function () { const specWebContents = remote.getCurrentWebContents() assert.equal(specWebContents.getId(), webContents.getFocusedWebContents().getId()) - specWebContents.on('devtools-opened', function () { + specWebContents.once('devtools-opened', function () { assert.equal(specWebContents.devToolsWebContents.getId(), webContents.getFocusedWebContents().getId()) specWebContents.closeDevTools() }) - specWebContents.on('devtools-closed', function () { + specWebContents.once('devtools-closed', function () { assert.equal(specWebContents.getId(), webContents.getFocusedWebContents().getId()) done() }) diff --git a/spec/fixtures/module/print_name.js b/spec/fixtures/module/print_name.js index db4f71d407b..fff59200eda 100644 --- a/spec/fixtures/module/print_name.js +++ b/spec/fixtures/module/print_name.js @@ -5,3 +5,11 @@ exports.print = function (obj) { exports.echo = function (obj) { return obj } + +exports.typedArray = function (name) { + const int16 = new Int16Array(name.length) + for (let i = 0; i < name.length; ++i) { + int16[i] = name[i] + } + return int16 +} diff --git a/vendor/brightray b/vendor/brightray index 91abdb01a18..fa17fc6b68c 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 91abdb01a1825c12522fd5fc2349a7ba9a091a48 +Subproject commit fa17fc6b68c43188ba4f85ba8fb87d66914a0be4 diff --git a/vendor/native_mate b/vendor/native_mate index a1efa285204..d9bfe6a49d8 160000 --- a/vendor/native_mate +++ b/vendor/native_mate @@ -1 +1 @@ -Subproject commit a1efa285204cb2fbbed450c317fb535a38ea8480 +Subproject commit d9bfe6a49d8585916bd8dc77165154afeee4e5b6 diff --git a/vendor/node b/vendor/node index d4528c219df..ee8c429deae 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit d4528c219df8f442d769bae054883e1af79f105e +Subproject commit ee8c429deaee0adeeef069c3ad34c0defe53a567