Merge pull request #232 from electron/chrome52

Upgrade to Chrome 52
This commit is contained in:
Cheng Zhao 2016-07-22 08:38:28 -06:00 committed by GitHub
commit 06489342a9
12 changed files with 113 additions and 85 deletions

View file

@ -26,6 +26,7 @@
'<(libchromiumcontent_src_dir)',
'<(libchromiumcontent_src_dir)/skia/config',
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
'<(libchromiumcontent_src_dir)/third_party/skia/include/config',
'<(libchromiumcontent_src_dir)/third_party/icu/source/common',
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
'<(libchromiumcontent_src_dir)/third_party/WebKit',

View file

@ -35,14 +35,6 @@
'MACOSX_DEPLOYMENT_TARGET': '10.8',
'RUN_CLANG_STATIC_ANALYZER': 'YES',
'USE_HEADER_MAP': 'NO',
'WARNING_CFLAGS': [
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
'-Wno-deprecated-declarations',
'-Wno-unneeded-internal-declaration',
],
},
'msvs_configuration_attributes': {
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
@ -91,24 +83,6 @@
],
},
},
'msvs_disabled_warnings': [
4100, # unreferenced formal parameter
4121, # alignment of a member was sensitive to packing
4127, # conditional expression is constant
4189, # local variable is initialized but not referenced
4244, # 'initializing' : conversion from 'double' to 'size_t', possible loss of data
4245, # 'initializing' : conversion from 'int' to 'const net::QuicVersionTag', signed/unsigned mismatch
4251, # class 'std::xx' needs to have dll-interface.
4310, # cast truncates constant value
4355, # 'this' : used in base member initializer list
4480, # nonstandard extension used: specifying underlying type for enum
4481, # nonstandard extension used: override specifier 'override'
4510, # default constructor could not be generated
4512, # assignment operator could not be generated
4610, # user defined constructor required
4702, # unreachable code
4819, # The file contains a character that cannot be represented in the current code page
],
'configurations': {
# The "Debug" and "Release" configurations are not actually used.
'Debug': {},
@ -341,5 +315,46 @@
],
}],
], # target_conditions
# Ignored compiler warnings of Chromium.
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
'-Wno-deprecated-declarations',
'-Wno-unneeded-internal-declaration',
'-Wno-inconsistent-missing-override',
],
},
}],
['OS=="linux"', {
'cflags': [
'-Wno-inconsistent-missing-override',
],
}],
['OS=="win"', {
'msvs_disabled_warnings': [
4100, # unreferenced formal parameter
4121, # alignment of a member was sensitive to packing
4127, # conditional expression is constant
4189, # local variable is initialized but not referenced
4244, # 'initializing' : conversion from 'double' to 'size_t', possible loss of data
4245, # 'initializing' : conversion from 'int' to 'const net::QuicVersionTag', signed/unsigned mismatch
4251, # class 'std::xx' needs to have dll-interface.
4310, # cast truncates constant value
4355, # 'this' : used in base member initializer list
4480, # nonstandard extension used: specifying underlying type for enum
4481, # nonstandard extension used: override specifier 'override'
4510, # default constructor could not be generated
4512, # assignment operator could not be generated
4610, # user defined constructor required
4702, # unreachable code
4819, # The file contains a character that cannot be represented in the current code page
],
}],
], # conditions
}, # target_defaults
}

View file

@ -115,6 +115,12 @@ BrowserContext::BrowserContext(const std::string& partition, bool in_memory)
browser_context_map_[PartitionKey(partition, in_memory)] = GetWeakPtr();
}
BrowserContext::~BrowserContext() {
BrowserThread::DeleteSoon(BrowserThread::IO,
FROM_HERE,
resource_context_.release());
}
void BrowserContext::InitPrefs() {
auto prefs_path = GetPath().Append(FILE_PATH_LITERAL("Preferences"));
PrefServiceFactory prefs_factory;
@ -129,16 +135,15 @@ void BrowserContext::InitPrefs() {
prefs_ = prefs_factory.Create(registry.get());
}
BrowserContext::~BrowserContext() {
BrowserThread::DeleteSoon(BrowserThread::IO,
FROM_HERE,
resource_context_.release());
}
void BrowserContext::RegisterInternalPrefs(PrefRegistrySimple* registry) {
InspectableWebContentsImpl::RegisterPrefs(registry);
}
URLRequestContextGetter* BrowserContext::GetRequestContext() {
return static_cast<URLRequestContextGetter*>(
GetDefaultStoragePartition(this)->GetURLRequestContext());
}
net::URLRequestContextGetter* BrowserContext::CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector protocol_interceptors) {
@ -174,27 +179,6 @@ bool BrowserContext::IsOffTheRecord() const {
return in_memory_;
}
net::URLRequestContextGetter* BrowserContext::GetRequestContext() {
return GetDefaultStoragePartition(this)->GetURLRequestContext();
}
net::URLRequestContextGetter* BrowserContext::GetMediaRequestContext() {
return GetRequestContext();
}
net::URLRequestContextGetter*
BrowserContext::GetMediaRequestContextForRenderProcess(
int renderer_child_id) {
return GetRequestContext();
}
net::URLRequestContextGetter*
BrowserContext::GetMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) {
return GetRequestContext();
}
content::ResourceContext* BrowserContext::GetResourceContext() {
return resource_context_.get();
}
@ -238,4 +222,16 @@ BrowserContext::CreateRequestContextForStoragePartition(
return nullptr;
}
net::URLRequestContextGetter*
BrowserContext::CreateMediaRequestContext() {
return url_request_getter_.get();
}
net::URLRequestContextGetter*
BrowserContext::CreateMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) {
return nullptr;
}
} // namespace brightray

View file

@ -39,16 +39,13 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
return weak_factory_.GetWeakPtr();
}
// Get the request context, if there is no one, create it.
URLRequestContextGetter* GetRequestContext();
// content::BrowserContext:
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
const base::FilePath& partition_path) override;
bool IsOffTheRecord() const override;
net::URLRequestContextGetter* GetRequestContext() override;
net::URLRequestContextGetter* GetMediaRequestContext() override;
net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
int renderer_child_id) override;
net::URLRequestContextGetter* GetMediaRequestContextForStoragePartition(
const base::FilePath& partition_path, bool in_memory) override;
content::ResourceContext* GetResourceContext() override;
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
content::BrowserPluginGuestManager* GetGuestManager() override;
@ -65,6 +62,10 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
bool in_memory,
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) override;
net::URLRequestContextGetter* CreateMediaRequestContext() override;
net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) override;
URLRequestContextGetter* url_request_context_getter() const {
return url_request_getter_.get();

View file

@ -19,9 +19,11 @@
#include "media/base/media_resources.h"
#include "net/proxy/proxy_resolver_v8.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/material_design/material_design_controller.h"
#if defined(USE_AURA)
#include "ui/gfx/screen.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/views/widget/desktop_aura/desktop_screen.h"
#endif
@ -33,7 +35,7 @@
#include "base/environment.h"
#include "base/path_service.h"
#include "base/nix/xdg_util.h"
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread_task_runner_handle.h"
#include "browser/brightray_paths.h"
#include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
#include "ui/base/x/x11_util.h"
@ -175,6 +177,8 @@ void BrowserMainParts::PreEarlyInitialization() {
}
void BrowserMainParts::ToolkitInitialized() {
ui::MaterialDesignController::Initialize();
#if defined(USE_AURA) && defined(USE_X11)
views::LinuxUI::instance()->Initialize();
wm_state_.reset(new wm::WMState);
@ -238,8 +242,8 @@ void BrowserMainParts::PostMainMessageLoopRun() {
int BrowserMainParts::PreCreateThreads() {
#if defined(USE_AURA)
gfx::Screen* screen = views::CreateDesktopScreen();
gfx::Screen::SetScreenInstance(screen);
display::Screen* screen = views::CreateDesktopScreen();
display::Screen::SetScreenInstance(screen);
#if defined(USE_X11)
views::LinuxUI::instance()->UpdateDeviceScaleFactor(
screen->GetPrimaryDisplay().device_scale_factor());

View file

@ -5,25 +5,22 @@
#include "browser/inspectable_web_contents_impl.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/metrics/histogram.h"
#include "base/strings/pattern.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "browser/browser_client.h"
#include "browser/browser_context.h"
#include "browser/browser_main_parts.h"
#include "browser/inspectable_web_contents_delegate.h"
#include "browser/inspectable_web_contents_view.h"
#include "browser/inspectable_web_contents_view_delegate.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/metrics/histogram.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/prefs/pref_registry_simple.h"
#include "base/strings/pattern.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/render_frame_host.h"
@ -33,7 +30,8 @@
#include "net/http/http_response_headers.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_response_writer.h"
#include "ui/gfx/screen.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
namespace brightray {
@ -92,7 +90,7 @@ bool IsPointInRect(const gfx::Point& point, const gfx::Rect& rect) {
}
bool IsPointInScreen(const gfx::Point& point) {
for (const auto& display : gfx::Screen::GetScreen()->GetAllDisplays()) {
for (const auto& display : display::Screen::GetScreen()->GetAllDisplays()) {
if (IsPointInRect(point, display.bounds()))
return true;
}
@ -223,7 +221,7 @@ InspectableWebContentsImpl::InspectableWebContentsImpl(
devtools_bounds_.set_width(800);
}
if (!IsPointInScreen(devtools_bounds_.origin())) {
gfx::Rect display = gfx::Screen::GetScreen()->
gfx::Rect display = display::Screen::GetScreen()->
GetDisplayNearestWindow(web_contents->GetNativeView()).bounds();
devtools_bounds_.set_x(display.x() + (display.width() - devtools_bounds_.width()) / 2);
devtools_bounds_.set_y(display.y() + (display.height() - devtools_bounds_.height()) / 2);
@ -369,7 +367,7 @@ void InspectableWebContentsImpl::ActivateWindow() {
}
void InspectableWebContentsImpl::CloseWindow() {
GetDevToolsWebContents()->DispatchBeforeUnload(false);
GetDevToolsWebContents()->DispatchBeforeUnload();
}
void InspectableWebContentsImpl::LoadCompleted() {

View file

@ -147,4 +147,12 @@ void MediaCaptureDevicesDispatcher::OnCreatingAudioStream(
int render_view_id) {
}
void MediaCaptureDevicesDispatcher::OnSetCapturingLinkSecured(
int render_process_id,
int render_frame_id,
int page_request_id,
content::MediaStreamType stream_type,
bool is_secure) {
}
} // namespace brightray

View file

@ -61,6 +61,11 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver {
content::MediaRequestState state) override;
void OnCreatingAudioStream(int render_process_id,
int render_view_id) override;
void OnSetCapturingLinkSecured(int render_process_id,
int render_frame_id,
int page_request_id,
content::MediaStreamType stream_type,
bool is_secure) override;
private:
friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>;

View file

@ -55,19 +55,19 @@ PlatformNotificationService::PlatformNotificationService(
PlatformNotificationService::~PlatformNotificationService() {}
blink::WebNotificationPermission PlatformNotificationService::CheckPermissionOnUIThread(
blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnUIThread(
content::BrowserContext* browser_context,
const GURL& origin,
int render_process_id) {
render_process_id_ = render_process_id;
return blink::WebNotificationPermissionAllowed;
return blink::mojom::PermissionStatus::GRANTED;
}
blink::WebNotificationPermission PlatformNotificationService::CheckPermissionOnIOThread(
blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnIOThread(
content::ResourceContext* resource_context,
const GURL& origin,
int render_process_id) {
return blink::WebNotificationPermissionAllowed;
return blink::mojom::PermissionStatus::GRANTED;
}
void PlatformNotificationService::DisplayNotification(

View file

@ -20,11 +20,11 @@ class PlatformNotificationService
protected:
// content::PlatformNotificationService:
blink::WebNotificationPermission CheckPermissionOnUIThread(
blink::mojom::PermissionStatus CheckPermissionOnUIThread(
content::BrowserContext* browser_context,
const GURL& origin,
int render_process_id) override;
blink::WebNotificationPermission CheckPermissionOnIOThread(
blink::mojom::PermissionStatus CheckPermissionOnIOThread(
content::ResourceContext* resource_context,
const GURL& origin,
int render_process_id) override;

View file

@ -381,7 +381,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
it != protocol_interceptors_.rend();
++it) {
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
std::move(top_job_factory), make_scoped_ptr(*it)));
std::move(top_job_factory), base::WrapUnique(*it)));
}
protocol_interceptors_.weak_clear();

@ -1 +1 @@
Subproject commit 31144d583c19b70d8d9de7d4ef15f0f720779860
Subproject commit 0b5aa7b6ca450681c58087e14f72238aab5ab823