Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
chromium 55 wip
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Feb 8, 2017
1 parent 45d5ccd commit 29ab583
Show file tree
Hide file tree
Showing 59 changed files with 203 additions and 248 deletions.
10 changes: 1 addition & 9 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -355,20 +355,12 @@ source_set("native_mate") {
]
}

electron_framework_sources = [
"$root_out_dir/chrome_100_percent.pak",
]
electron_framework_sources = []

electron_framework_public_deps = [
":packed_resources",
]

if (enable_hidpi) {
electron_framework_sources += [
"$root_out_dir/chrome_200_percent.pak",
]
}

if (icu_use_data_file) {
electron_framework_sources += [
"$root_out_dir/icudtl.dat"
Expand Down
1 change: 0 additions & 1 deletion app/mac/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ mac_framework_bundle("electron_framework") {

deps = [
"//chrome:chrome_framework_helpers",
"//chrome:chrome_framework_locales",
"//electron/build/node:node_resources",
":widevine_cdm_adapter",
":external_binaries_resources",
Expand Down
1 change: 1 addition & 0 deletions atom/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ source_set("app") {
}

deps = [
"//content/public/common:interfaces",
"//third_party/widevine/cdm:headers",
"//third_party/kasko",
]
Expand Down
7 changes: 4 additions & 3 deletions atom/browser/api/atom_api_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class ResolveProxyHelper {
// Start the request.
int result = proxy_service->ResolveProxy(
url, "GET", &proxy_info_, completion_callback,
&pac_req_, nullptr, net::BoundNetLog());
&pac_req_, nullptr, net::NetLogWithSource());

// Completed synchronously.
if (result != net::ERR_IO_PENDING)
Expand Down Expand Up @@ -299,7 +299,7 @@ void SetProxyInIO(net::URLRequestContextGetter* getter,
new net::ProxyConfigServiceFixed(config)));
// Refetches and applies the new pac script if provided.
proxy_service->ForceReloadProxyConfig();
RunCallbackInUI(callback);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(&base::DoNothing));
}

void SetCertVerifyProcInIO(
Expand All @@ -319,7 +319,8 @@ void ClearHostResolverCacheInIO(
cache->clear();
DCHECK_EQ(0u, cache->size());
if (!callback.is_null())
RunCallbackInUI(callback);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&base::DoNothing));
}
}

Expand Down
9 changes: 5 additions & 4 deletions atom/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,14 @@ bool WebContents::ShouldCreateWebContents(
}

void WebContents::WebContentsCreated(content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) {
if (guest_delegate_) {
guest_delegate_->WebContentsCreated(source_contents,
opener_render_process_id,
opener_render_frame_id,
frame_name,
target_url,
Expand Down Expand Up @@ -865,7 +867,6 @@ void WebContents::DidGetResourceResponseStart(
}

void WebContents::DidGetRedirectForResourceRequest(
content::RenderFrameHost* render_frame_host,
const content::ResourceRedirectDetails& details) {
Emit("did-get-redirect-request",
details.url,
Expand Down Expand Up @@ -916,7 +917,7 @@ void WebContents::DidFinishNavigation(
void WebContents::SecurityStyleChanged(
content::SecurityStyle security_style,
const content::SecurityStyleExplanations& explanations) {
if (explanations.displayed_insecure_content &&
if (explanations.displayed_mixed_content &&
security_style == content::SECURITY_STYLE_UNAUTHENTICATED) {
Emit("security-style-changed", "passive-mixed-content");
} else {
Expand Down Expand Up @@ -1380,7 +1381,7 @@ void WebContents::InspectServiceWorker() {

for (const auto& agent_host : content::DevToolsAgentHost::GetOrCreateAll()) {
if (agent_host->GetType() ==
content::DevToolsAgentHost::TYPE_SERVICE_WORKER) {
content::DevToolsAgentHost::kTypeServiceWorker) {
OpenDevTools(nullptr);
managed_web_contents()->AttachTo(agent_host);
break;
Expand Down Expand Up @@ -2086,7 +2087,7 @@ void WebContents::OnTabCreated(const mate::Dictionary& options,
bool was_blocked = false;
AddNewContents(source,
tab,
active ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB,
active ? WindowOpenDisposition::NEW_FOREGROUND_TAB : WindowOpenDisposition::NEW_BACKGROUND_TAB,
gfx::Rect(),
user_gesture,
&was_blocked);
Expand Down
17 changes: 11 additions & 6 deletions atom/browser/api/atom_api_web_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ struct Converter<WindowOpenDisposition> {
WindowOpenDisposition val) {
std::string disposition = "other";
switch (val) {
case CURRENT_TAB: disposition = "default"; break;
case NEW_FOREGROUND_TAB: disposition = "foreground-tab"; break;
case NEW_BACKGROUND_TAB: disposition = "background-tab"; break;
case NEW_POPUP: disposition = "new-popup"; break;
case NEW_WINDOW: disposition = "new-window"; break;
case WindowOpenDisposition::CURRENT_TAB:
disposition = "default"; break;
case WindowOpenDisposition::NEW_FOREGROUND_TAB:
disposition = "foreground-tab"; break;
case WindowOpenDisposition::NEW_BACKGROUND_TAB:
disposition = "background-tab"; break;
case WindowOpenDisposition::NEW_POPUP:
disposition = "new-popup"; break;
case WindowOpenDisposition::NEW_WINDOW:
disposition = "new-window"; break;
default: disposition = "other"; break;
}
return mate::ConvertToV8(isolate, disposition);
Expand Down Expand Up @@ -307,6 +312,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) override;
void WebContentsCreated(content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
Expand Down Expand Up @@ -388,7 +394,6 @@ class WebContents : public mate::TrackableObject<WebContents>,
void DidGetResourceResponseStart(
const content::ResourceRequestDetails& details) override;
void DidGetRedirectForResourceRequest(
content::RenderFrameHost* render_frame_host,
const content::ResourceRedirectDetails& details) override;
void DidStartNavigation(
content::NavigationHandle* navigation_handle) override;
Expand Down
1 change: 0 additions & 1 deletion atom/browser/atom_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ void AtomBrowserClient::OverrideWebkitPrefs(
prefs->allow_universal_access_from_file_urls = false;
prefs->allow_file_access_from_file_urls = false;
prefs->experimental_webgl_enabled = true;
prefs->allow_displaying_insecure_content = false;
prefs->allow_running_insecure_content = false;

// Custom preferences of guest page.
Expand Down
19 changes: 9 additions & 10 deletions atom/browser/atom_security_state_model_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

#include "atom/browser/atom_security_state_model_client.h"

#include "content/public/browser/cert_store.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/ssl_status.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/origin_util.h"
#include "content/public/common/ssl_status.h"
#include "net/cert/x509_certificate.h"

DEFINE_WEB_CONTENTS_USER_DATA_KEY(atom::AtomSecurityStateModelClient);
Expand All @@ -27,7 +26,7 @@ SecurityStateModel::SecurityLevel GetSecurityLevelForSecurityStyle(
case content::SECURITY_STYLE_UNAUTHENTICATED:
return SecurityStateModel::NONE;
case content::SECURITY_STYLE_AUTHENTICATION_BROKEN:
return SecurityStateModel::SECURITY_ERROR;
return SecurityStateModel::DANGEROUS;
case content::SECURITY_STYLE_WARNING:
return SecurityStateModel::SECURITY_WARNING;
case content::SECURITY_STYLE_AUTHENTICATED:
Expand All @@ -48,19 +47,19 @@ AtomSecurityStateModelClient::AtomSecurityStateModelClient(
AtomSecurityStateModelClient::~AtomSecurityStateModelClient() {
}

const SecurityStateModel::SecurityInfo&
AtomSecurityStateModelClient::GetSecurityInfo() const {
return security_state_model_->GetSecurityInfo();
void AtomSecurityStateModelClient::GetSecurityInfo(
SecurityStateModel::SecurityInfo* result) const {
security_state_model_->GetSecurityInfo(result);
}

bool AtomSecurityStateModelClient::RetrieveCert(
scoped_refptr<net::X509Certificate>* cert) {
content::NavigationEntry* entry =
web_contents_->GetController().GetVisibleEntry();
if (!entry)
if (!entry || !entry->GetSSL().certificate)
return false;
return content::CertStore::GetInstance()->RetrieveCert(
entry->GetSSL().cert_id, cert);
*cert = entry->GetSSL().certificate;
return true;
}

bool AtomSecurityStateModelClient::UsedPolicyInstalledCertificate() {
Expand All @@ -86,7 +85,7 @@ void AtomSecurityStateModelClient::GetVisibleSecurityState(
const content::SSLStatus& ssl = entry->GetSSL();
state->initial_security_level =
GetSecurityLevelForSecurityStyle(ssl.security_style);
state->cert_id = ssl.cert_id;
state->certificate = ssl.certificate;
state->cert_status = ssl.cert_status;
state->connection_status = ssl.connection_status;
state->security_bits = ssl.security_bits;
Expand Down
4 changes: 2 additions & 2 deletions atom/browser/atom_security_state_model_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class AtomSecurityStateModelClient
public:
~AtomSecurityStateModelClient() override;

const security_state::SecurityStateModel::SecurityInfo&
GetSecurityInfo() const;
void GetSecurityInfo(
security_state::SecurityStateModel::SecurityInfo* result) const;

// security_state::SecurityStateModelClient:
void GetVisibleSecurityState(
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/autofill/atom_autofill_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ PrefService* AtomAutofillClient::GetPrefs() {
return user_prefs::UserPrefs::Get(web_contents()->GetBrowserContext());
}

sync_driver::SyncService* AtomAutofillClient::GetSyncService() {
syncer::SyncService* AtomAutofillClient::GetSyncService() {
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion atom/browser/autofill/atom_autofill_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AtomAutofillClient
PersonalDataManager* GetPersonalDataManager() override;
scoped_refptr<AutofillWebDataService> GetDatabase() override;
PrefService* GetPrefs() override;
sync_driver::SyncService* GetSyncService() override;
syncer::SyncService* GetSyncService() override;
IdentityProvider* GetIdentityProvider() override;
rappor::RapporService* GetRapporService() override;
void ShowAutofillSettings() override;
Expand Down
2 changes: 2 additions & 0 deletions atom/browser/browser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
#include "atom/browser/native_window.h"
#include "atom/browser/window_list.h"
#include "base/files/file_util.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/trace_event_impl.h"
#include "brightray/browser/brightray_paths.h"

namespace atom {
Expand Down
24 changes: 13 additions & 11 deletions atom/browser/common_web_contents_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,15 @@ content::SecurityStyle SecurityLevelToSecurityStyle(
SecurityStateModel::SecurityLevel security_level) {
switch (security_level) {
case SecurityStateModel::NONE:
case SecurityStateModel::HTTP_SHOW_WARNING:
return content::SECURITY_STYLE_UNAUTHENTICATED;
case SecurityStateModel::SECURITY_WARNING:
case SecurityStateModel::SECURITY_POLICY_WARNING:
case SecurityStateModel::SECURE_WITH_POLICY_INSTALLED_CERT:
return content::SECURITY_STYLE_WARNING;
case SecurityStateModel::EV_SECURE:
case SecurityStateModel::SECURE:
return content::SECURITY_STYLE_AUTHENTICATED;
case SecurityStateModel::SECURITY_ERROR:
case SecurityStateModel::DANGEROUS:
return content::SECURITY_STYLE_AUTHENTICATION_BROKEN;
}

Expand All @@ -190,8 +191,8 @@ void AddConnectionExplanation(

// Avoid showing TLS details when we couldn't even establish a TLS connection
// (e.g. for net errors) or if there was no real connection (some tests). We
// check the |cert_id| to see if there was a connection.
if (security_info.cert_id == 0 || security_info.connection_status == 0) {
// check the |certificate| to see if there was a connection.
if (!security_info.certificate || security_info.connection_status == 0) {
return;
}

Expand Down Expand Up @@ -482,7 +483,8 @@ content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle(
content::SecurityStyleExplanations* security_style_explanations) {
auto model_client =
AtomSecurityStateModelClient::FromWebContents(web_contents);
auto security_info = model_client->GetSecurityInfo();
security_state::SecurityStateModel::SecurityInfo security_info;
model_client->GetSecurityInfo(&security_info);

const content::SecurityStyle security_style =
SecurityLevelToSecurityStyle(security_info.security_level);
Expand Down Expand Up @@ -513,22 +515,22 @@ content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle(
content::SecurityStyleExplanation(
l10n_util::GetStringUTF8(IDS_MAJOR_SHA1),
l10n_util::GetStringUTF8(IDS_MAJOR_SHA1_DESCRIPTION),
security_info.cert_id));
!!security_info.certificate));
} else if (security_info.sha1_deprecation_status ==
SecurityStateModel::DEPRECATED_SHA1_MINOR) {
security_style_explanations->unauthenticated_explanations.push_back(
content::SecurityStyleExplanation(
l10n_util::GetStringUTF8(IDS_MINOR_SHA1),
l10n_util::GetStringUTF8(IDS_MINOR_SHA1_DESCRIPTION),
security_info.cert_id));
!!security_info.certificate));
}

security_style_explanations->ran_insecure_content =
security_style_explanations->ran_mixed_content =
security_info.mixed_content_status ==
SecurityStateModel::CONTENT_STATUS_RAN ||
security_info.mixed_content_status ==
SecurityStateModel::CONTENT_STATUS_DISPLAYED_AND_RAN;
security_style_explanations->displayed_insecure_content =
security_style_explanations->displayed_mixed_content =
security_info.mixed_content_status ==
SecurityStateModel::CONTENT_STATUS_DISPLAYED ||
security_info.mixed_content_status ==
Expand All @@ -542,7 +544,7 @@ content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle(
l10n_util::GetStringUTF8(IDS_CERTIFICATE_CHAIN_ERROR),
l10n_util::GetStringFUTF8(
IDS_CERTIFICATE_CHAIN_ERROR_DESCRIPTION_FORMAT, error_string),
security_info.cert_id);
!!security_info.certificate);

if (net::IsCertStatusMinorError(security_info.cert_status))
security_style_explanations->unauthenticated_explanations.push_back(
Expand All @@ -560,7 +562,7 @@ content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle(
l10n_util::GetStringUTF8(IDS_VALID_SERVER_CERTIFICATE),
l10n_util::GetStringUTF8(
IDS_VALID_SERVER_CERTIFICATE_DESCRIPTION),
security_info.cert_id));
!!security_info.certificate));
}
}

Expand Down
3 changes: 2 additions & 1 deletion atom/browser/extensions/api/atom_extensions_api_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ class AtomManagementAPIDelegate : public ManagementAPIDelegate {
// Creates an app shortcut.
bool CreateAppShortcutFunctionDelegate(
ManagementCreateAppShortcutFunction* function,
const Extension* extension) const override {
const Extension* extension,
std::string* error) const override {
NOTIMPLEMENTED();
return false;
}
Expand Down
5 changes: 5 additions & 0 deletions atom/browser/extensions/atom_extensions_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "extensions/common/features/feature.h"
#include "extensions/common/features/feature_provider.h"
#include "extensions/common/manifest_handlers/incognito_info.h"
#include "extensions/shell/browser/delegates/shell_kiosk_delegate.h"
#include "ui/base/resource/resource_bundle.h"

// URLRequestResourceBundleJob
Expand Down Expand Up @@ -493,6 +494,10 @@ AtomExtensionsBrowserClient::GetExtensionWebContentsObserver(
return AtomExtensionWebContentsObserver::FromWebContents(web_contents);;
}

KioskDelegate* AtomExtensionsBrowserClient::GetKioskDelegate() {
return nullptr;
}

void AtomExtensionsBrowserClient::CleanUpWebView(
content::BrowserContext* browser_context,
int embedder_process_id,
Expand Down
2 changes: 2 additions & 0 deletions atom/browser/extensions/atom_extensions_browser_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "build/build_config.h"
#include "extensions/browser/extension_host_delegate.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/kiosk/kiosk_delegate.h"

namespace base {
class CommandLine;
Expand Down Expand Up @@ -110,6 +111,7 @@ class AtomExtensionsBrowserClient : public ExtensionsBrowserClient {
bool IsMinBrowserVersionSupported(const std::string& min_version) override;
ExtensionWebContentsObserver* GetExtensionWebContentsObserver(
content::WebContents* web_contents) override;
KioskDelegate* GetKioskDelegate() override;
void CleanUpWebView(content::BrowserContext* browser_context,
int embedder_process_id,
int view_instance_id) override;
Expand Down
Loading

0 comments on commit 29ab583

Please sign in to comment.