Merge pull request #5461 from electron/chrome50

Continue the work of Chrome 50 upgrade
This commit is contained in:
Cheng Zhao 2016-05-13 14:52:09 +09:00
commit faf896db67
67 changed files with 427 additions and 151 deletions

View file

@ -2,6 +2,8 @@
# http://www.appveyor.com/docs/appveyor-yml
version: "{build}"
os: Visual Studio 2015
init:
- git config --global core.autocrlf input
@ -10,7 +12,7 @@ platform:
- x64
install:
- cmd: SET PATH=C:\Program Files (x86)\MSBuild\12.0\bin\;%PATH%
- cmd: SET PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH%
- cmd: SET PATH=C:\python27;%PATH%
- cmd: python script/cibuild

View file

@ -89,11 +89,9 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
// Add the supported codecs as if they came from the component manifest.
std::vector<std::string> codecs;
codecs.push_back(kCdmSupportedCodecVorbis);
codecs.push_back(kCdmSupportedCodecVp8);
codecs.push_back(kCdmSupportedCodecVp9);
#if defined(USE_PROPRIETARY_CODECS)
codecs.push_back(kCdmSupportedCodecAac);
codecs.push_back(kCdmSupportedCodecAvc1);
#endif // defined(USE_PROPRIETARY_CODECS)
std::string codec_string = base::JoinString(
@ -181,6 +179,7 @@ base::string16 AtomContentClient::GetLocalizedString(int message_id) const {
void AtomContentClient::AddAdditionalSchemes(
std::vector<url::SchemeWithType>* standard_schemes,
std::vector<url::SchemeWithType>* referrer_schemes,
std::vector<std::string>* savable_schemes) {
standard_schemes->push_back({"chrome-extension", url::SCHEME_WITHOUT_PORT});
}

View file

@ -25,6 +25,7 @@ class AtomContentClient : public brightray::ContentClient {
base::string16 GetLocalizedString(int message_id) const override;
void AddAdditionalSchemes(
std::vector<url::SchemeWithType>* standard_schemes,
std::vector<url::SchemeWithType>* referrer_schemes,
std::vector<std::string>* savable_schemes) override;
void AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) override;

View file

@ -133,12 +133,12 @@ void GetCookiesOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
auto filtered_callback =
base::Bind(FilterCookies, base::Passed(&filter), callback);
net::CookieMonster* monster = GetCookieStore(getter)->GetCookieMonster();
// Empty url will match all url cookies.
if (url.empty())
monster->GetAllCookiesAsync(filtered_callback);
GetCookieStore(getter)->GetAllCookiesAsync(filtered_callback);
else
monster->GetAllCookiesForURLAsync(GURL(url), filtered_callback);
GetCookieStore(getter)->GetAllCookiesForURLAsync(GURL(url),
filtered_callback);
}
// Removes cookie with |url| and |name| in IO thread.
@ -162,7 +162,9 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
std::string url, name, value, domain, path;
bool secure = false;
bool http_only = false;
double creation_date;
double expiration_date;
double last_access_date;
details->GetString("url", &url);
details->GetString("name", &name);
details->GetString("value", &value);
@ -171,6 +173,13 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
details->GetBoolean("secure", &secure);
details->GetBoolean("httpOnly", &http_only);
base::Time creation_time;
if (details->GetDouble("creationDate", &creation_date)) {
creation_time = (creation_date == 0) ?
base::Time::UnixEpoch() :
base::Time::FromDoubleT(creation_date);
}
base::Time expiration_time;
if (details->GetDouble("expirationDate", &expiration_date)) {
expiration_time = (expiration_date == 0) ?
@ -178,9 +187,17 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
base::Time::FromDoubleT(expiration_date);
}
GetCookieStore(getter)->GetCookieMonster()->SetCookieWithDetailsAsync(
GURL(url), name, value, domain, path, expiration_time, secure, http_only,
false, false, false, net::COOKIE_PRIORITY_DEFAULT,
base::Time last_access_time;
if (details->GetDouble("lastAccessDate", &last_access_date)) {
last_access_time = (last_access_date == 0) ?
base::Time::UnixEpoch() :
base::Time::FromDoubleT(last_access_date);
}
GetCookieStore(getter)->SetCookieWithDetailsAsync(
GURL(url), name, value, domain, path, creation_time,
expiration_time, last_access_time, secure, http_only,
false, false, net::COOKIE_PRIORITY_DEFAULT,
base::Bind(OnSetCookie, callback));
}

View file

@ -30,7 +30,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::GetNativeScreen()->GetCursorScreenPoint();
location = gfx::Screen::GetScreen()->GetCursorScreenPoint();
} else {
gfx::Point origin = view->GetViewBounds().origin();
location = gfx::Point(origin.x() + x, origin.y() + y);

View file

@ -99,7 +99,7 @@ v8::Local<v8::Value> Screen::Create(v8::Isolate* isolate) {
return v8::Null(isolate);
}
gfx::Screen* screen = gfx::Screen::GetNativeScreen();
gfx::Screen* screen = gfx::Screen::GetScreen();
if (!screen) {
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate, "Failed to get screen information")));

View file

@ -22,7 +22,7 @@
#include "atom/common/node_includes.h"
#include "base/files/file_path.h"
#include "base/guid.h"
#include "base/prefs/pref_service.h"
#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"

View file

@ -63,6 +63,7 @@
#include "net/url_request/static_http_user_agent_settings.h"
#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/base/l10n/l10n_util.h"
#include "atom/common/node_includes.h"
@ -144,7 +145,7 @@ struct Converter<net::HttpResponseHeaders*> {
net::HttpResponseHeaders* headers) {
base::DictionaryValue response_headers;
if (headers) {
void* iter = nullptr;
size_t iter = 0;
std::string key;
std::string value;
while (headers->EnumerateHeaderLines(&iter, &key, &value)) {

View file

@ -32,18 +32,18 @@ AtomAccessTokenStore::~AtomAccessTokenStore() {
}
void AtomAccessTokenStore::LoadAccessTokens(
const LoadAccessTokensCallbackType& callback) {
AccessTokenSet access_token_set;
const LoadAccessTokensCallback& callback) {
AccessTokenMap access_token_map;
// Equivelent to access_token_set[kGeolocationProviderURL].
// Equivelent to access_token_map[kGeolocationProviderURL].
// Somehow base::string16 is causing compilation errors when used in a pair
// of std::map on Linux, this can work around it.
std::pair<GURL, base::string16> token_pair;
token_pair.first = GURL(kGeolocationProviderURL);
access_token_set.insert(token_pair);
access_token_map.insert(token_pair);
auto browser_context = AtomBrowserMainParts::Get()->browser_context();
callback.Run(access_token_set, browser_context->url_request_context_getter());
callback.Run(access_token_map, browser_context->url_request_context_getter());
}
void AtomAccessTokenStore::SaveAccessToken(const GURL& server_url,

View file

@ -18,7 +18,7 @@ class AtomAccessTokenStore : public content::AccessTokenStore {
// content::AccessTokenStore:
void LoadAccessTokens(
const LoadAccessTokensCallbackType& callback) override;
const LoadAccessTokensCallback& callback) override;
void SaveAccessToken(const GURL& server_url,
const base::string16& access_token) override;

View file

@ -21,7 +21,7 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/prefs/pref_registry_simple.h"
#include "components/prefs/pref_registry_simple.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/threading/sequenced_worker_pool.h"

View file

@ -12,7 +12,7 @@
#include "atom/browser/ui/file_dialog.h"
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/prefs/pref_service.h"
#include "components/prefs/pref_service.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"

View file

@ -40,7 +40,7 @@ void AtomPermissionManager::SetPermissionRequestHandler(
if (handler.is_null() && !pending_requests_.empty()) {
for (const auto& request : pending_requests_) {
if (!WebContentsDestroyed(request.second.render_process_id))
request.second.callback.Run(content::PERMISSION_STATUS_DENIED);
request.second.callback.Run(content::PermissionStatus::DENIED);
}
pending_requests_.clear();
}
@ -51,7 +51,6 @@ int AtomPermissionManager::RequestPermission(
content::PermissionType permission,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
bool user_gesture,
const ResponseCallback& response_callback) {
int process_id = render_frame_host->GetProcess()->GetID();
@ -74,7 +73,7 @@ int AtomPermissionManager::RequestPermission(
return request_id_;
}
response_callback.Run(content::PERMISSION_STATUS_GRANTED);
response_callback.Run(content::PermissionStatus::GRANTED);
return kNoPendingOperation;
}
@ -82,7 +81,6 @@ int AtomPermissionManager::RequestPermissions(
const std::vector<content::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(
const std::vector<content::PermissionStatus>&)>& callback) {
// FIXME(zcbenz): Just ignore multiple permissions request for now.
@ -92,7 +90,7 @@ int AtomPermissionManager::RequestPermissions(
content::ChildProcessSecurityPolicy::GetInstance()->
GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID());
}
permissionStatuses.push_back(content::PERMISSION_STATUS_GRANTED);
permissionStatuses.push_back(content::PermissionStatus::GRANTED);
}
callback.Run(permissionStatuses);
return kNoPendingOperation;
@ -115,7 +113,7 @@ void AtomPermissionManager::CancelPermissionRequest(int request_id) {
auto request = pending_requests_.find(request_id);
if (request != pending_requests_.end()) {
if (!WebContentsDestroyed(request->second.render_process_id))
request->second.callback.Run(content::PERMISSION_STATUS_DENIED);
request->second.callback.Run(content::PermissionStatus::DENIED);
pending_requests_.erase(request);
}
}
@ -130,7 +128,7 @@ content::PermissionStatus AtomPermissionManager::GetPermissionStatus(
content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin) {
return content::PERMISSION_STATUS_GRANTED;
return content::PermissionStatus::GRANTED;
}
void AtomPermissionManager::RegisterPermissionUsage(

View file

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

View file

@ -16,8 +16,8 @@
#include "atom/browser/web_dialog_helper.h"
#include "atom/common/atom_constants.h"
#include "base/files/file_util.h"
#include "base/prefs/pref_service.h"
#include "base/prefs/scoped_user_pref_update.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "chrome/browser/printing/print_preview_message_handler.h"
#include "chrome/browser/printing/print_view_manager_basic.h"
#include "chrome/browser/ui/browser_dialogs.h"

View file

@ -17,7 +17,7 @@
#include "atom/common/options_switches.h"
#include "base/files/file_util.h"
#include "base/json/json_writer.h"
#include "base/prefs/pref_service.h"
#include "components/prefs/pref_service.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "brightray/browser/inspectable_web_contents.h"
@ -318,9 +318,9 @@ void NativeWindow::CapturePage(const gfx::Rect& rect,
// current system, increase the requested bitmap size to capture it all.
gfx::Size bitmap_size = view_size;
const gfx::NativeView native_view = view->GetNativeView();
gfx::Screen* const screen = gfx::Screen::GetScreenFor(native_view);
const float scale =
screen->GetDisplayNearestWindow(native_view).device_scale_factor();
gfx::Screen::GetScreen()->GetDisplayNearestWindow(native_view)
.device_scale_factor();
if (scale > 1.0f)
bitmap_size = gfx::ScaleToCeiledSize(view_size, scale);

View file

@ -623,7 +623,9 @@ void NativeWindowViews::SetBackgroundColor(const std::string& color_name) {
// Set the background color of native window.
HBRUSH brush = CreateSolidBrush(skia::SkColorToCOLORREF(background_color));
ULONG_PTR previous_brush = SetClassLongPtr(
GetAcceleratedWidget(), GCLP_HBRBACKGROUND, (LONG)brush);
GetAcceleratedWidget(),
GCLP_HBRBACKGROUND,
reinterpret_cast<LONG_PTR>(brush));
if (previous_brush)
DeleteObject((HBRUSH)previous_brush);
#endif

View file

@ -100,7 +100,7 @@ void ToDictionary(base::DictionaryValue* details,
return;
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
void* iter = nullptr;
size_t iter = 0;
std::string key;
std::string value;
while (headers->EnumerateHeaderLines(&iter, &key, &value)) {

View file

@ -64,7 +64,8 @@ void MapToCommonID(const std::vector<base::string16>& buttons,
(*button_flags) |= common.button;
} else {
// It is a custom button.
dialog_buttons->push_back({i + kIDStart, buttons[i].c_str()});
dialog_buttons->push_back(
{static_cast<int>(i + kIDStart), buttons[i].c_str()});
}
}
}
@ -135,7 +136,8 @@ int ShowMessageBoxUTF16(HWND parent,
std::vector<TASKDIALOG_BUTTON> dialog_buttons;
if (options & MESSAGE_BOX_NO_LINK) {
for (size_t i = 0; i < buttons.size(); ++i)
dialog_buttons.push_back({i + kIDStart, buttons[i].c_str()});
dialog_buttons.push_back(
{static_cast<int>(i + kIDStart), buttons[i].c_str()});
} else {
MapToCommonID(buttons, &id_map, &config.dwCommonButtons, &dialog_buttons);
}

View file

@ -104,7 +104,7 @@ int MenuBar::GetAcceleratorIndex(base::char16 key) {
void MenuBar::ActivateAccelerator(base::char16 key) {
int i = GetAcceleratorIndex(key);
if (i != -1)
static_cast<SubmenuButton*>(child_at(i))->Activate();
static_cast<SubmenuButton*>(child_at(i))->Activate(nullptr);
}
int MenuBar::GetItemCount() const {
@ -141,22 +141,22 @@ const char* MenuBar::GetClassName() const {
void MenuBar::ButtonPressed(views::Button* sender, const ui::Event& event) {
}
void MenuBar::OnMenuButtonClicked(views::View* source,
const gfx::Point& point) {
void MenuBar::OnMenuButtonClicked(views::MenuButton* source,
const gfx::Point& point,
const ui::Event* event) {
// Hide the accelerator when a submenu is activated.
SetAcceleratorVisibility(false);
if (!menu_model_)
return;
views::MenuButton* button = static_cast<views::MenuButton*>(source);
int id = button->tag();
int id = source->tag();
ui::MenuModel::ItemType type = menu_model_->GetTypeAt(id);
if (type != ui::MenuModel::TYPE_SUBMENU)
return;
MenuDelegate menu_delegate(this);
menu_delegate.RunMenu(menu_model_->GetSubmenuModelAt(id), button);
menu_delegate.RunMenu(menu_model_->GetSubmenuModelAt(id), source);
}
} // namespace atom

View file

@ -57,8 +57,10 @@ class MenuBar : public views::View,
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
// views::MenuButtonListener:
void OnMenuButtonClicked(views::View* source,
const gfx::Point& point) override;
void OnMenuButtonClicked(views::MenuButton* source,
const gfx::Point& point,
const ui::Event* event) override;
private:
SkColor background_color_;

View file

@ -112,7 +112,7 @@ views::MenuItemView* MenuDelegate::GetSiblingMenu(
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(base::IgnoreResult(&views::MenuButton::Activate),
base::Unretained(button)));
base::Unretained(button), nullptr));
}
return nullptr;

View file

@ -26,7 +26,7 @@ base::string16 FilterAccelerator(const base::string16& label) {
SubmenuButton::SubmenuButton(views::ButtonListener* listener,
const base::string16& title,
views::MenuButtonListener* menu_button_listener)
: views::MenuButton(listener, FilterAccelerator(title),
: views::MenuButton(FilterAccelerator(title),
menu_button_listener, false),
accelerator_(0),
show_underline_(false),

View file

@ -155,7 +155,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::GetNativeScreen()->GetCursorScreenPoint());
rect.set_origin(gfx::Screen::GetScreen()->GetCursorScreenPoint());
views::MenuRunner menu_runner(
menu_model,

View file

@ -35,7 +35,7 @@ void OnPointerLockResponse(content::WebContents* web_contents, bool allowed) {
void OnPermissionResponse(const base::Callback<void(bool)>& callback,
content::PermissionStatus status) {
if (status == content::PERMISSION_STATUS_GRANTED)
if (status == content::PermissionStatus::GRANTED)
callback.Run(true);
else
callback.Run(false);
@ -60,7 +60,7 @@ void WebContentsPermissionHelper::RequestPermission(
web_contents_->GetBrowserContext()->GetPermissionManager());
auto origin = web_contents_->GetLastCommittedURL();
permission_manager->RequestPermission(
permission, rfh, origin, user_gesture,
permission, rfh, origin,
base::Bind(&OnPermissionResponse, callback));
}

View file

@ -180,8 +180,6 @@ void WebContentsPreferences::OverrideWebkitPrefs(
prefs->text_areas_are_resizable = b;
if (self->web_preferences_.GetBoolean("webgl", &b))
prefs->experimental_webgl_enabled = b;
if (self->web_preferences_.GetBoolean("webaudio", &b))
prefs->webaudio_enabled = b;
if (self->web_preferences_.GetBoolean("webSecurity", &b)) {
prefs->web_security_enabled = b;
prefs->allow_displaying_insecure_content = !b;

View file

@ -13,7 +13,7 @@
#include "base/bind.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/prefs/pref_service.h"
#include "components/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/render_view_host.h"

View file

@ -63,7 +63,7 @@ float GetScaleFactorFromPath(const base::FilePath& path) {
// We don't try to convert string to float here because it is very very
// expensive.
for (unsigned i = 0; i < arraysize(kScaleFactorPairs); ++i) {
for (unsigned i = 0; i < node::arraysize(kScaleFactorPairs); ++i) {
if (base::EndsWith(filename, kScaleFactorPairs[i].name,
base::CompareCase::INSENSITIVE_ASCII))
return kScaleFactorPairs[i].scale;

View file

@ -14,22 +14,6 @@
#include "native_mate/dictionary.h"
#include "v8/include/v8-profiler.h"
// Following code should be removed after we upgraded to Chrome 50.
#if !defined(COMPILER_MSVC)
namespace base {
template <typename T1, typename T2>
inline size_t HashInts(T1 value1, T2 value2) {
// This condition is expected to be compile-time evaluated and optimised away
// in release builds.
if (sizeof(T1) > sizeof(uint32_t) || (sizeof(T2) > sizeof(uint32_t)))
return HashInts64(value1, value2);
return HashInts32(value1, value2);
}
} // namespace base
namespace std {
// The hash function used by DoubleIDWeakMap.
@ -41,7 +25,6 @@ struct hash<std::pair<Type1, Type2>> {
};
} // namespace std
#endif // defined(COMPILER_MSVC)
namespace mate {

View file

@ -8,7 +8,7 @@
#ifndef ATOM_COMMON_CHROME_VERSION_H_
#define ATOM_COMMON_CHROME_VERSION_H_
#define CHROME_VERSION_STRING "49.0.2623.75"
#define CHROME_VERSION_STRING "50.0.2661.102"
#define CHROME_VERSION "v" CHROME_VERSION_STRING
#endif // ATOM_COMMON_CHROME_VERSION_H_

View file

@ -8,3 +8,4 @@
#include "chrome/common/print_messages.h"
#include "chrome/common/tts_messages.h"
#include "chrome/common/widevine_cdm_messages.h"
#include "chrome/common/chrome_utility_messages.h"

View file

@ -327,7 +327,7 @@ void CrashService::OnClientConnected(void* context,
void CrashService::OnClientExited(void* context,
const google_breakpad::ClientInfo* client_info) {
ProcessingLock lock;
ProcessingLock processing_lock;
VLOG(1) << "client end. pid = " << client_info->pid();
CrashService* self = static_cast<CrashService*>(context);
::InterlockedIncrement(&self->clients_terminated_);

View file

@ -130,9 +130,9 @@ bool Converter<content::PermissionStatus>::FromV8(
return false;
if (result)
*out = content::PERMISSION_STATUS_GRANTED;
*out = content::PermissionStatus::GRANTED;
else
*out = content::PERMISSION_STATUS_DENIED;
*out = content::PermissionStatus::DENIED;
return true;
}

View file

@ -21,6 +21,7 @@
#undef CHECK_LT
#undef DISALLOW_COPY_AND_ASSIGN
#undef NO_RETURN
#undef arraysize
#undef debug_string // This is defined in OS X 10.9 SDK in AssertMacros.h.
#include "vendor/node/src/env.h"
#include "vendor/node/src/env-inl.h"

View file

@ -27,7 +27,6 @@
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/WebKit/public/web/WebScriptSource.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "ui/base/resource/resource_bundle.h"
#include "native_mate/dictionary.h"
@ -89,9 +88,6 @@ void AtomRenderViewObserver::DidCreateDocumentElement(
blink::WebLocalFrame* frame) {
document_created_ = true;
// Make sure every page will get a script context created.
frame->executeScript(blink::WebScriptSource("void 0"));
// Read --zoom-factor from command line.
std::string zoom_factor_str = base::CommandLine::ForCurrentProcess()->
GetSwitchValueASCII(switches::kZoomFactor);

View file

@ -29,9 +29,11 @@
#include "content/public/renderer/render_view.h"
#include "ipc/ipc_message_macros.h"
#include "third_party/WebKit/public/web/WebCustomElement.h"
#include "third_party/WebKit/public/web/WebFrameWidget.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPluginParams.h"
#include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/WebKit/public/web/WebScriptSource.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "third_party/WebKit/public/web/WebView.h"
@ -140,20 +142,30 @@ void AtomRendererClient::RenderFrameCreated(
}
void AtomRendererClient::RenderViewCreated(content::RenderView* render_view) {
new printing::PrintWebViewHelper(render_view);
new AtomRenderViewObserver(render_view, this);
blink::WebFrameWidget* web_frame_widget = render_view->GetWebFrameWidget();
if (!web_frame_widget)
return;
base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
if (cmd->HasSwitch(switches::kGuestInstanceID)) { // webview.
// Set transparent background.
render_view->GetWebView()->setBaseBackgroundColor(SK_ColorTRANSPARENT);
web_frame_widget->setBaseBackgroundColor(SK_ColorTRANSPARENT);
} else { // normal window.
// If backgroundColor is specified then use it.
std::string name = cmd->GetSwitchValueASCII(switches::kBackgroundColor);
// Otherwise use white background.
SkColor color = name.empty() ? SK_ColorWHITE : ParseHexColor(name);
render_view->GetWebView()->setBaseBackgroundColor(color);
web_frame_widget->setBaseBackgroundColor(color);
}
}
new printing::PrintWebViewHelper(render_view);
new AtomRenderViewObserver(render_view, this);
void AtomRendererClient::RunScriptsAtDocumentStart(
content::RenderFrame* render_frame) {
// Make sure every page will get a script context created.
render_frame->GetWebFrame()->executeScript(
blink::WebScriptSource("void 0"));
}
blink::WebSpeechSynthesizer* AtomRendererClient::OverrideSpeechSynthesizer(

View file

@ -40,6 +40,7 @@ class AtomRendererClient : public content::ContentRendererClient,
void RenderThreadStarted() override;
void RenderFrameCreated(content::RenderFrame*) override;
void RenderViewCreated(content::RenderView*) override;
void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override;
blink::WebSpeechSynthesizer* OverrideSpeechSynthesizer(
blink::WebSpeechSynthesizerClient* client) override;
bool OverrideCreatePlugin(content::RenderFrame* render_frame,

View file

@ -53,7 +53,7 @@ v8::Local<v8::Uint8Array> BlinkUint8ArrayNew(
ab, mate::ConvertToV8(isolate, offset), mate::ConvertToV8(isolate, size)
};
return v8::Local<v8::Uint8Array>::Cast(constructor->NewInstance(
context, arraysize(args), args).ToLocalChecked());
context, node::arraysize(args), args).ToLocalChecked());
}
} // namespace

158
chromium_src/SkUserConfig.h Normal file
View file

@ -0,0 +1,158 @@
/*
* 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

View file

@ -4,10 +4,13 @@
#include "chrome/browser/extensions/global_shortcut_listener_x11.h"
#include <stddef.h>
#include "base/macros.h"
#include "content/public/browser/browser_thread.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
#include "ui/events/platform/x11/x11_event_source.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/x/x11_error_tracker.h"
#include "ui/gfx/x/x11_types.h"
@ -69,7 +72,7 @@ void GlobalShortcutListenerX11::StartListening() {
DCHECK(!registered_hot_keys_.empty()); // Also don't start if no hotkey is
// registered.
ui::X11EventSource::GetInstance()->AddPlatformEventDispatcher(this);
ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
is_listening_ = true;
}
@ -79,7 +82,7 @@ void GlobalShortcutListenerX11::StopListening() {
DCHECK(registered_hot_keys_.empty()); // Make sure the set is clean before
// ending.
ui::X11EventSource::GetInstance()->RemovePlatformEventDispatcher(this);
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
is_listening_ = false;
}
@ -149,7 +152,6 @@ void GlobalShortcutListenerX11::OnXKeyPressEvent(::XEvent* x_event) {
modifiers |= (x_event->xkey.state & ShiftMask) ? ui::EF_SHIFT_DOWN : 0;
modifiers |= (x_event->xkey.state & ControlMask) ? ui::EF_CONTROL_DOWN : 0;
modifiers |= (x_event->xkey.state & Mod1Mask) ? ui::EF_ALT_DOWN : 0;
// For Windows key
modifiers |= (x_event->xkey.state & Mod4Mask) ? ui::EF_COMMAND_DOWN: 0;
ui::Accelerator accelerator(

View file

@ -5,9 +5,12 @@
#ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_X11_H_
#define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_X11_H_
#include <stdint.h>
#include <X11/Xlib.h>
#include <set>
#include "base/macros.h"
#include "chrome/browser/extensions/global_shortcut_listener.h"
#include "ui/events/platform/platform_event_dispatcher.h"
@ -20,20 +23,18 @@ class GlobalShortcutListenerX11 : public GlobalShortcutListener,
public ui::PlatformEventDispatcher {
public:
GlobalShortcutListenerX11();
virtual ~GlobalShortcutListenerX11();
~GlobalShortcutListenerX11() override;
// ui::PlatformEventDispatcher implementation.
virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
bool CanDispatchEvent(const ui::PlatformEvent& event) override;
uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
private:
// GlobalShortcutListener implementation.
virtual void StartListening() override;
virtual void StopListening() override;
virtual bool RegisterAcceleratorImpl(
const ui::Accelerator& accelerator) override;
virtual void UnregisterAcceleratorImpl(
const ui::Accelerator& accelerator) override;
void StartListening() override;
void StopListening() override;
bool RegisterAcceleratorImpl(const ui::Accelerator& accelerator) override;
void UnregisterAcceleratorImpl(const ui::Accelerator& accelerator) override;
// Invoked when a global shortcut is pressed.
void OnXKeyPressEvent(::XEvent* x_event);

View file

@ -6,7 +6,7 @@
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_service.h"
#include "components/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
#include "base/timer/timer.h"
#include "chrome/browser/browser_process.h"

View file

@ -6,7 +6,7 @@
#define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_
#include "base/memory/ref_counted.h"
#include "base/prefs/pref_member.h"
#include "components/prefs/pref_member.h"
#include "base/strings/string16.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"

View file

@ -71,10 +71,6 @@ void RenderParamsFromPrintSettings(const PrintSettings& settings,
params->margin_top = settings.page_setup_device_units().content_area().y();
params->margin_left = settings.page_setup_device_units().content_area().x();
params->dpi = settings.dpi();
// Currently hardcoded at 1.25. See PrintSettings' constructor.
params->min_shrink = settings.min_shrink();
// Currently hardcoded at 2.0. See PrintSettings' constructor.
params->max_shrink = settings.max_shrink();
// Currently hardcoded at 72dpi. See PrintSettings' constructor.
params->desired_dpi = settings.desired_dpi();
// Always use an invalid cookie.
@ -144,7 +140,7 @@ void PrintingMessageFilter::OnDuplicateSection(
base::SharedMemoryHandle* browser_handle) {
// Duplicate the handle in this process right now so the memory is kept alive
// (even if it is not mapped)
base::SharedMemory shared_buf(renderer_handle, true, PeerHandle());
base::SharedMemory shared_buf(renderer_handle, true);
shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), browser_handle);
}
#endif

View file

@ -79,7 +79,7 @@
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/net_util.h"
#include "net/base/network_interfaces.h"
#include "ui/base/l10n/l10n_util.h"
#if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) && !defined(OS_CHROMEOS)

View file

@ -4,6 +4,8 @@
#include "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h"
#include <stddef.h>
#include "base/pickle.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_thread.h"
@ -48,10 +50,10 @@ ui::ClipboardType ConvertClipboardType(uint32_t type) {
// clipboard interface for custom data.
bool JumpToFormatInPickle(const base::string16& format,
base::PickleIterator* iter) {
size_t size = 0;
if (!iter->ReadSizeT(&size))
uint32_t size = 0;
if (!iter->ReadUInt32(&size))
return false;
for (size_t i = 0; i < size; ++i) {
for (uint32_t i = 0; i < size; ++i) {
base::string16 stored_format;
if (!iter->ReadString16(&stored_format))
return false;
@ -83,7 +85,7 @@ std::string ReadDataFromPickle(const base::string16& format,
bool WriteDataToPickle(const std::map<base::string16, std::string>& data,
base::Pickle* pickle) {
pickle->WriteSizeT(data.size());
pickle->WriteUInt32(data.size());
for (std::map<base::string16, std::string>::const_iterator it = data.begin();
it != data.end();
++it) {

View file

@ -21,7 +21,7 @@
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/common/pepper_plugin_info.h"
#include "net/base/net_util.h"
#include "net/base/network_interfaces.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/host/dispatch_host_message.h"
#include "ppapi/host/host_message_context.h"

View file

@ -124,7 +124,7 @@ static void AddPepperBasedWidevine(
}
cdm::AddWidevineWithCodecs(
cdm::WIDEVINE, supported_codecs,
supported_codecs,
#if defined(OS_CHROMEOS)
media::EmeRobustness::HW_SECURE_ALL, // Maximum audio robustness.
media::EmeRobustness::HW_SECURE_ALL, // Maximim video robustness.

View file

@ -39,6 +39,7 @@
#include "third_party/WebKit/public/web/WebSettings.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "third_party/WebKit/public/web/WebViewClient.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/base/resource/resource_bundle.h"
using content::WebPreferences;
@ -62,9 +63,9 @@ int GetDPI(const PrintMsg_Print_Params* print_params) {
bool PrintMsg_Print_Params_IsValid(const PrintMsg_Print_Params& params) {
return !params.content_size.IsEmpty() && !params.page_size.IsEmpty() &&
!params.printable_area.IsEmpty() && params.document_cookie &&
params.desired_dpi && params.max_shrink && params.min_shrink &&
params.dpi && (params.margin_top >= 0) && (params.margin_left >= 0) &&
params.dpi > kMinDpi && params.document_cookie != 0;
params.desired_dpi && params.dpi && params.margin_top >= 0 &&
params.margin_left >= 0 && params.dpi > kMinDpi &&
params.document_cookie != 0;
}
PrintMsg_Print_Params GetCssPrintParams(
@ -425,8 +426,9 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient,
blink::WebLocalFrame* parent,
blink::WebTreeScopeType scope,
const blink::WebString& name,
blink::WebSandboxFlags sandboxFlags,
const blink::WebFrameOwnerProperties& frameOwnerProperties) override;
const blink::WebString& unique_name,
blink::WebSandboxFlags sandbox_flags,
const blink::WebFrameOwnerProperties& frame_owner_properties) override;
void frameDetached(blink::WebFrame* frame, DetachType type) override;
private:
@ -491,6 +493,7 @@ void PrepareFrameAndViewForPrint::ResizeForPrinting() {
// think the page is 125% larger so the size of the page is correct for
// minimum (default) scaling.
// This is important for sites that try to fill the page.
// The 1.25 value is |printingMinimumShrinkFactor|.
gfx::Size print_layout_size(web_print_params_.printContentArea.width,
web_print_params_.printContentArea.height);
print_layout_size.set_height(
@ -573,8 +576,9 @@ blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
blink::WebLocalFrame* parent,
blink::WebTreeScopeType scope,
const blink::WebString& name,
blink::WebSandboxFlags sandboxFlags,
const blink::WebFrameOwnerProperties& frameOwnerProperties) {
const blink::WebString& unique_name,
blink::WebSandboxFlags sandbox_flags,
const blink::WebFrameOwnerProperties& frame_owner_properties) {
blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this);
parent->appendChild(frame);
return frame;
@ -1263,11 +1267,7 @@ bool PrintWebViewHelper::PrintPreviewContext::CreatePreviewDocument(
}
metafile_.reset(new PdfMetafileSkia);
if (!metafile_->Init()) {
set_error(PREVIEW_ERROR_METAFILE_INIT_FAILED);
LOG(ERROR) << "PdfMetafileSkia Init failed";
return false;
}
CHECK(metafile_->Init());
current_page_index_ = 0;
pages_to_render_ = pages;

View file

@ -83,9 +83,9 @@ class PrintWebViewHelper
PREVIEW_ERROR_NONE, // Always first.
PREVIEW_ERROR_BAD_SETTING,
PREVIEW_ERROR_METAFILE_COPY_FAILED,
PREVIEW_ERROR_METAFILE_INIT_FAILED,
PREVIEW_ERROR_METAFILE_INIT_FAILED_DEPRECATED,
PREVIEW_ERROR_ZERO_PAGES,
PREVIEW_ERROR_MAC_DRAFT_METAFILE_INIT_FAILED,
PREVIEW_ERROR_MAC_DRAFT_METAFILE_INIT_FAILED_DEPRECATED,
PREVIEW_ERROR_PAGE_RENDERED_WITHOUT_METAFILE,
PREVIEW_ERROR_INVALID_PRINTER_SETTINGS,
PREVIEW_ERROR_LAST_ENUM // Always last.

View file

@ -123,7 +123,7 @@ void PrintWebViewHelper::PrintPageInternal(
&content_area);
gfx::Rect canvas_area = content_area;
skia::PlatformCanvas* canvas = metafile->GetVectorCanvasForNewPage(
SkCanvas* canvas = metafile->GetVectorCanvasForNewPage(
page_size, canvas_area, scale_factor);
if (!canvas)
return;

View file

@ -12,9 +12,9 @@
#include "chrome/common/print_messages.h"
#include "printing/metafile_skia_wrapper.h"
#include "printing/page_size_margins.h"
#include "skia/ext/platform_device.h"
#include "third_party/WebKit/public/platform/WebCanvas.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/skia/include/core/SkCanvas.h"
namespace printing {
@ -24,8 +24,7 @@ void PrintWebViewHelper::PrintPageInternal(
const PrintMsg_PrintPage_Params& params,
WebFrame* frame) {
PdfMetafileSkia metafile;
if (!metafile.Init())
return;
CHECK(metafile.Init());
int page_number = params.page_number;
gfx::Size page_size_in_dpi;
@ -63,12 +62,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
if (render_to_draft) {
draft_metafile.reset(new PdfMetafileSkia());
if (!draft_metafile->Init()) {
print_preview_context_.set_error(
PREVIEW_ERROR_MAC_DRAFT_METAFILE_INIT_FAILED);
LOG(ERROR) << "Draft PdfMetafileSkia Init failed";
return false;
}
CHECK(draft_metafile->Init());
initial_render_metafile = draft_metafile.get();
}

View file

@ -158,7 +158,7 @@ void PrintWebViewHelper::PrintPageInternal(
frame->getPrintPageShrink(params.page_number);
float scale_factor = css_scale_factor * webkit_page_shrink_factor;
skia::PlatformCanvas* canvas = metafile->GetVectorCanvasForNewPage(
SkCanvas* canvas = metafile->GetVectorCanvasForNewPage(
page_size, canvas_area, scale_factor);
if (!canvas)
return;

View file

@ -27,7 +27,7 @@
#include "build/build_config.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
#include "net/base/network_interfaces.h"
#include "net/base/sockaddr_storage.h"
#include "net/socket/socket_descriptor.h"

View file

@ -22,7 +22,7 @@
#include "base/sys_byteorder.h"
#include "base/threading/platform_thread.h"
#include "build/build_config.h"
#include "net/base/net_util.h"
#include "net/base/network_interfaces.h"
#include "net/base/winsock_init.h"
#include "net/socket/socket_descriptor.h"

View file

@ -49,6 +49,7 @@
4054, #
4055, # 'type cast' : from data pointer 'void *' to function pointer
4057, # 'function' : 'volatile LONG *' differs in indirection to slightly different base types from 'unsigned long *'
4065, # switch statement contains 'default' but no 'case' labels
4189, #
4131, # uses old-style declarator
4133, # incompatible types
@ -62,7 +63,12 @@
4232, # address of dllimport 'free' is not static, identity not guaranteed
4291, # no matching operator delete found
4295, # array is too small to include a terminating null character
4311, # 'type cast': pointer truncation from 'void *const ' to 'unsigned long'
4389, # '==' : signed/unsigned mismatch
4456, # declaration of 'm' hides previous local declaration
4457, # declaration of 'message' hides function parameter
4459, # declaration of 'wq' hides global declaration
4477, # format string '%.*s' requires an argument of type 'int'
4505, # unreferenced local function has been removed
4701, # potentially uninitialized local variable 'sizew' used
4703, # potentially uninitialized local pointer variable 'req' used
@ -234,9 +240,12 @@
4189, # local variable is initialized but not referenced
4201, # (uv.h) nameless struct/union
4267, # conversion from 'size_t' to 'int', possible loss of data
4302, # (atldlgs.h) 'type cast': truncation from 'LPCTSTR' to 'WORD'
4458, # (atldlgs.h) declaration of 'dwCommonButtons' hides class member
4503, # decorated name length exceeded, name was truncated
4800, # (v8.h) forcing value to bool 'true' or 'false'
4819, # The file contains a character that cannot be represented in the current code page
4838, # (atlgdi.h) conversion from 'int' to 'UINT' requires a narrowing conversion
4996, # (atlapp.h) 'GetVersionExW': was declared deprecated
],
},

View file

@ -4,7 +4,7 @@
'product_name%': 'Electron',
'company_name%': 'GitHub, Inc',
'company_abbr%': 'github',
'version%': '1.0.2',
'version%': '1.1.0',
},
'includes': [
'filenames.gypi',
@ -298,6 +298,10 @@
'$(SDKROOT)/System/Library/Frameworks/QTKit.framework',
],
},
'xcode_settings': {
# ReactiveCocoa which is used by Squirrel requires using __weak.
'CLANG_ENABLE_OBJC_WEAK': 'YES',
},
}], # OS=="mac" and mas_build==0
['OS=="mac" and mas_build==1', {
'defines': [

View file

@ -5,7 +5,8 @@ import os
import subprocess
import sys
from lib.util import atom_gyp
from lib.config import get_target_arch
from lib.util import atom_gyp, import_vs_env
CONFIGURATIONS = ['Release', 'Debug']
@ -15,6 +16,9 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
os.chdir(SOURCE_ROOT)
# Update the VS build env.
import_vs_env(get_target_arch())
ninja = os.path.join('vendor', 'depot_tools', 'ninja')
if sys.platform == 'win32':
ninja += '.exe'

View file

@ -8,7 +8,7 @@ import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '1a4c5e51a670633ff3ecd4448ad01ba21b440542'
LIBCHROMIUMCONTENT_COMMIT = 'e5ddff3e0d277703e2c1adc363d49709cf1bc56a'
PLATFORM = {
'cygwin': 'win32',
@ -45,7 +45,7 @@ def get_target_arch():
def get_chromedriver_version():
return 'v2.15'
return 'v2.21'
def s3_config():

71
script/lib/env_util.py Normal file
View file

@ -0,0 +1,71 @@
#!/usr/bin/env python
from __future__ import print_function
import itertools
import subprocess
import sys
def validate_pair(ob):
if not (len(ob) == 2):
print("Unexpected result:", ob, file=sys.stderr)
return False
else:
return True
def consume(iter):
try:
while True: next(iter)
except StopIteration:
pass
def get_environment_from_batch_command(env_cmd, initial=None):
"""
Take a command (either a single command or list of arguments)
and return the environment created after running that command.
Note that if the command must be a batch file or .cmd file, or the
changes to the environment will not be captured.
If initial is supplied, it is used as the initial environment passed
to the child process.
"""
if not isinstance(env_cmd, (list, tuple)):
env_cmd = [env_cmd]
# Construct the command that will alter the environment.
env_cmd = subprocess.list2cmdline(env_cmd)
# Create a tag so we can tell in the output when the proc is done.
tag = 'END OF BATCH COMMAND'
# Construct a cmd.exe command to do accomplish this.
cmd = 'cmd.exe /s /c "{env_cmd} && echo "{tag}" && set"'.format(**vars())
# Launch the process.
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=initial)
# Parse the output sent to stdout.
lines = proc.stdout
# Consume whatever output occurs until the tag is reached.
consume(itertools.takewhile(lambda l: tag not in l, lines))
# Define a way to handle each KEY=VALUE line.
handle_line = lambda l: l.rstrip().split('=',1)
# Parse key/values into pairs.
pairs = map(handle_line, lines)
# Make sure the pairs are valid.
valid_pairs = filter(validate_pair, pairs)
# Construct a dictionary of the pairs.
result = dict(valid_pairs)
# Let the process finish.
proc.communicate()
return result
def get_vs_env(vs_version, arch):
"""
Returns the env object for VS building environment.
The vs_version can be strings like "12.0" (e.g. VS2013), the arch has to
be one of "x86", "amd64", "arm", "x86_amd64", "x86_arm", "amd64_x86",
"amd64_arm", e.g. the args passed to vcvarsall.bat.
"""
vsvarsall = "C:\\Program Files (x86)\\Microsoft Visual Studio {0}\\VC\\vcvarsall.bat".format(vs_version)
return get_environment_from_batch_command([vsvarsall, arch])

View file

@ -16,6 +16,7 @@ import os
import zipfile
from config import is_verbose_mode
from env_util import get_vs_env
def get_host_arch():
@ -223,3 +224,15 @@ def s3put(bucket, access_key, secret_key, prefix, key_prefix, files):
] + files
execute(args, env)
def import_vs_env(target_arch):
if sys.platform != 'win32':
return
if target_arch == 'ia32':
vs_arch = 'amd64_x86'
else:
vs_arch = 'x86_amd64'
env = get_vs_env('14.0', vs_arch)
os.environ.update(env)

View file

@ -8,7 +8,7 @@
# Do NOT CHANGE this if you don't know what you're doing -- see
# https://code.google.com/p/chromium/wiki/UpdatingClang
# Reverting problematic clang rolls is safe, though.
CLANG_REVISION=247874
CLANG_REVISION=261368
# This is incremented when pushing a new build of Clang at the same revision.
CLANG_SUB_REVISION=1

View file

@ -7,7 +7,7 @@ import subprocess
import sys
from lib.config import get_target_arch, PLATFORM
from lib.util import get_host_arch
from lib.util import get_host_arch, import_vs_env
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
@ -49,11 +49,14 @@ def update_gyp():
def run_gyp(target_arch, component):
# Update the VS build env.
import_vs_env(target_arch)
env = os.environ.copy()
if PLATFORM == 'linux' and target_arch != get_host_arch():
env['GYP_CROSSCOMPILE'] = '1'
elif PLATFORM == 'win32':
env['GYP_MSVS_VERSION'] = '2013'
env['GYP_MSVS_VERSION'] = '2015'
python = sys.executable
if sys.platform == 'cygwin':
# Force using win32 python on cygwin.

View file

@ -23,6 +23,11 @@ describe('crash-reporter module', function () {
w.destroy()
})
// It is not working on 64bit Windows.
if (process.platform === 'win32' && process.arch === 'x64') {
return
}
if (process.mas) {
return
}

2
vendor/brightray vendored

@ -1 +1 @@
Subproject commit a98267c714b2c3435c1b86e50fd40523ef428a23
Subproject commit a266ffbdf446b41b9b5d09e55134ebadd774b357

2
vendor/crashpad vendored

@ -1 +1 @@
Subproject commit db713da7554f565e43c6dcf9a51b59ccc4f06066
Subproject commit e2073935d7c674f4a9e7fced821f611c5b13f07b

2
vendor/node vendored

@ -1 +1 @@
Subproject commit 6bcd8af891a991f8aa196e49e6bf908ebbe24cae
Subproject commit 454e37c47804706c5524d3639f18de02f5ad18c9