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

C69 #642

Open
wants to merge 141 commits into
base: master
Choose a base branch
from
Open

C69 #642

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
0da8407
Update patches to 69.0.3472.3
hferreiro Jul 4, 2018
9828071
Rename //net:net_browser_services to //net/dns:mojo_service
hferreiro Jul 4, 2018
c5188ec
TODO: Use net::CompletionOnceCallback in place of net::CompletionCall…
hferreiro Jul 5, 2018
44d39c6
Remove PlatformNotificationService::CheckPermissionOn{UI/IO}Thread
hferreiro Jul 6, 2018
f58494a
DeleteCookiePredicate was moved to network::SessionCleanupCookieStore
hferreiro Jul 6, 2018
b09cd6b
Add resource_coordinator:mojo_bindings dependency
hferreiro Jul 6, 2018
5b4904a
Change CreateWebUIControllerForURL() to return a unique_ptr
hferreiro Jul 6, 2018
a89c3ba
REVIEW: DispatchNonPerisistentClickEvent() parameters
hferreiro Jul 6, 2018
2d47fed
CreateLoginDelegate() parameters
hferreiro Jul 9, 2018
cd3ab8d
Rename WebFrameClient to WebLocalFrameClient
hferreiro Jul 9, 2018
bd53398
TODO: Migrate from base::Bind() to base::BindOnce() or base::BindRepe…
hferreiro Jul 9, 2018
a357eae
Add missing GetAppGuid() to configurator
ltilve Jul 9, 2018
2db4659
Rename WebContentsDelegate methods
ltilve Jul 9, 2018
10f27db
Refactor RenderWidgetHost RendererUnresponsive() into generic base::C…
ltilve Jul 9, 2018
80cadb7
Moved and renamed some Speech Recognition mojom files to Blink
ltilve Jul 9, 2018
fcd1b85
Remove WebContents::WasRecentlyAudible and fix use in extensions_tab_…
ltilve Jul 9, 2018
aa08fe0
Move ExtensionService to extensions:: namespace
hferreiro Jul 10, 2018
b3c4113
UserDataKey() return type changed to const void*
hferreiro Jul 10, 2018
7bbf5bc
component_updater::ComponentUpdateServiceFactory() changed params
hferreiro Jul 10, 2018
cdb0144
NetworkService: Add ClearHostCache() method
hferreiro Jul 10, 2018
582d2a0
Capture Gaia password hashes used in content area
ltilve Jul 10, 2018
9f616ce
Add missing resource_coordinator:site_characteristics_proto dep
ltilve Jul 10, 2018
5d0fe83
Update GetCurrentPrintPreviewStatus params
ltilve Jul 10, 2018
c45beac
TODO: Fixed reporting for iframe ugprade-insecure-requests upgrades
ltilve Jul 10, 2018
a2554de
Remove unused RunMicrotasksObserver
ltilve Jul 10, 2018
b656050
C69 updates to io_thread.cc
hferreiro Jul 11, 2018
e01e46c
Rename PasswordSyncState to SyncState
hferreiro Jul 11, 2018
e352027
AutofillClient::ConfirmSaveCreditCardToCloud() parameters
hferreiro Jul 12, 2018
6fc98ef
Implement AtomAutofillClient::GetUkmSourceId()
hferreiro Jul 12, 2018
a5e051c
Stub AtomAutofillClient::GetSecurityLevelForUmaHistograms()
hferreiro Jul 12, 2018
fa71ce7
Refactor the password generation UI flows
hferreiro Jul 12, 2018
1d320e1
Remove ResourceCoordinatorTabHelper::IsEnabled()
hferreiro Jul 12, 2018
c059aea
Move PresaveGeneratedPassword to PasswordManagerClient
hferreiro Jul 12, 2018
f8d245a
Refactor of ServiceManagerContext
hferreiro Jul 12, 2018
81fc5c4
Separate out HttpAuthPreferences that can't change
ltilve Jul 12, 2018
56738b4
Remove password generation command line flags
hferreiro Jul 13, 2018
888435d
CHECK: Stop using x-devtools-emulate-network-conditions-client-id header
hferreiro Jul 13, 2018
e0a60cb
Added new struct for CdmCapability
ltilve Jul 16, 2018
fc27b38
Update master_patch changes to renamed render_widget_host_ns_view_bri…
ltilve Jul 16, 2018
e48a405
Remove unused SetOverrideVersionedDirectory
ltilve Jul 17, 2018
4c639fb
C69 updates to print_review_message_handler.cc
hferreiro Jul 17, 2018
d7e6c5b
Update vendor/node to C69 branch
hferreiro Jul 18, 2018
22da3bf
Fix C69 linking issues
hferreiro Jul 18, 2018
34723da
Fix lint issue
hferreiro Jul 19, 2018
cf161c1
Update patches to 69.0.3493.3
hferreiro Jul 4, 2018
40d9ba6
Remove Expect-Staple code
hferreiro Jul 20, 2018
345b350
Delete mojo/edk
hferreiro Jul 20, 2018
e2b95b6
Move //device/geolocation to //services/device
hferreiro Jul 20, 2018
922d4c8
Use AddBrave*Features method instead of a provider class
hferreiro Jul 20, 2018
3916938
Override Configurator::URLLoaderFactory() in BraveConfigurator
hferreiro Jul 20, 2018
359b378
NetworkDelegate::OnCanGetCookies() parameters
hferreiro Jul 20, 2018
b0e115c
ExtensionSystem::InstallUpdate() parameters
hferreiro Jul 23, 2018
460d2b5
Stop using ResourceContext::GetHostResolver()
hferreiro Jul 23, 2018
e9cdbc6
Rename ChildProcessSecurityPolicy::GrantOrigin() to GrantRequestOrigin
hferreiro Jul 23, 2018
01cbf81
Move kApplicationLocale pref to components/language/
hferreiro Jul 23, 2018
507a4ac
Revert "Parameterize Callback to accept both OnceCallback and Repeati…
hferreiro Jul 23, 2018
8555b75
Remove SupportsOCSPStapling from CertVerifier
hferreiro Jul 23, 2018
5431510
Add missing IsCapturingDesktop()
ltilve Jul 24, 2018
88114f1
Add Priority parameter for OnDemandUpdate()
ltilve Jul 24, 2018
281f37b
Make content::PermissionManager a delegate of PermissionController
ltilve Jul 24, 2018
37ac3c6
Moved NetworkConnectionTracker to //content/public/browser.
ltilve Jul 24, 2018
3f0fe96
Clean up wheel scroll latching and async wheel events flags
ltilve Jul 24, 2018
125c5e5
Changed InitOriginPermissions to AddOriginAccessPermissions
ltilve Jul 25, 2018
bb042ce
Add missing "base/callback.h" include
hferreiro Jul 25, 2018
ea81eec
AutofillClient::ShowAutofillPopup() parameters
hferreiro Jul 25, 2018
383f72b
CreateSSLConfigService() now returns a unique_ptr
hferreiro Jul 25, 2018
958dc65
Stub AutofillClient::ShowLocalCardMigrationPrompt()
hferreiro Jul 25, 2018
9fb88ed
Stub AutofillClient::ConfirmSaveAutofillProfile()
hferreiro Jul 25, 2018
eac46e2
Remove NetworkChangeNotifier's HistogramWatcher
ltilve Jul 25, 2018
d7de615
Add isDemoSession to AtomExtensionsBrowserClient
ltilve Jul 25, 2018
12d0c82
Change GetAutofillWebData() to GetProfileAutofillWebData()
ltilve Jul 25, 2018
bd412ca
Revert "Revert "Parameterize Callback to accept both OnceCallback and…
ltilve Jul 25, 2018
84b4765
TabLifecycleUnitSource() parameters
hferreiro Jul 26, 2018
e6ca7e2
media: Rename CdmSessionType enums
ltilve Jul 26, 2018
f3f7b16
TODO: Workaround for mac build
ltilve Jul 26, 2018
5c98f94
fixup! Fix C69 linking issues for Mac
ltilve Jul 26, 2018
289f452
Remove datausage aggregator based tracking
hferreiro Jul 30, 2018
f782603
Remove references to exe_and_shlib_deps
hferreiro Jul 30, 2018
7301b50
Remove dep to //chrome/common/extensions/api:api_registration
hferreiro Jul 30, 2018
55db0e7
fixup! Update master_patch changes to renamed render_widget_host_ns_v…
ltilve Aug 15, 2018
0c61d22
fixup! Remove references to exe_and_shlib_deps
ltilve Aug 15, 2018
5b699a1
Rename content::PermissionManager into content::PermissionControllerD…
ltilve Aug 15, 2018
817796a
Removed ReloadType::DISABLE_PREVIEWS
ltilve Aug 15, 2018
e6bf1d7
WIP: Port //services/device/geolocation to network::SimpleURLLoader
ltilve Aug 15, 2018
a25247c
Add stub for ReadNextPersistentNotificationId()
ltilve Aug 15, 2018
450fd34
REVIEW: Replace base::Timer with behavior-specific timers
ltilve Aug 16, 2018
5afbf07
Wire the in-memory datastore into PersonalDataManager
ltilve Aug 16, 2018
b2e870d
Use frame-associated bindings for PasswordManagerDriver
ltilve Aug 16, 2018
aec5c62
Move CredentialManager interface into blink.mojom namespace
ltilve Aug 16, 2018
802dca3
Fix C69 linking issues
ltilve Aug 16, 2018
77be746
Remove PlatformAccelerator
ltilve Aug 16, 2018
8724366
fixup! Fix C69 linking issues
ltilve Aug 16, 2018
49e6258
TMP: Fix build with master_patch changes
ltilve Aug 16, 2018
9bed971
fixup! Wire the in-memory datastore into PersonalDataManager
ltilve Aug 17, 2018
0f5f02c
fixup! fixup! Fix C69 linking issues
ltilve Aug 21, 2018
966974e
WIP: Disable broken preference check
ltilve Aug 25, 2018
7a6ba8f
Update patches to Chromium 69.0.3497.57
ltilve Aug 25, 2018
8571c63
WIP: Workaround for Win linking issues
ltilve Aug 26, 2018
1b68872
Make sure seatbelt server initialize sandbox
darkdh Aug 27, 2018
89f795a
use the correct MessagePump subclass
bridiver Aug 27, 2018
bcba196
Bump v8.1.0+69.0.3497.57
bridiver Aug 27, 2018
d406516
Fix CHECK failure "FATAL:web_request_api.cc(1935)] Check failed: !blo…
darkdh Aug 28, 2018
4af2977
bump chromedriver version
bridiver Aug 28, 2018
0261f4d
Merge pull request #644 from brave/remote-require
bridiver Aug 28, 2018
d59e473
Implement getAllInWindow
darkdh Jul 26, 2018
0ca0bee
Implement GetInitatorSchemeBypassingDocumentBlocking to avoid CORB
darkdh Jul 26, 2018
b41ae1c
Handle relative url in chrome.tabs.create()
darkdh Aug 28, 2018
59777ca
lint fix
darkdh Aug 28, 2018
d926bef
Register pdf_compositor service
darkdh Aug 29, 2018
f4c5df1
Inherits `autofill::mojom::PasswordManagerDriver`
darkdh Aug 29, 2018
246b9fa
Remove check which causes crash seen in brave/browser-laptop#15025
bsclifton Aug 29, 2018
b7e5c7e
Merge pull request #646 from brave/fix-issue-15025
darkdh Aug 29, 2018
54a8578
Revert "Merge pull request #646 from brave/fix-issue-15025"
darkdh Aug 29, 2018
901e3cf
Update callback in WebContentsPermissionHelper to be OnceCallback
darkdh Aug 29, 2018
f405c2f
Fix persistent notification display and ReadNextPersistentNotificatio…
darkdh Aug 29, 2018
18115e7
Fix broken fix of
darkdh Aug 29, 2018
a67ee7a
Cleanup SetPlatformAccelerator
darkdh Aug 30, 2018
26d811a
Fix broken geo location caused by
darkdh Aug 30, 2018
0396bc3
Force cocoa to send non-cmd key event to menu
darkdh Aug 31, 2018
7050961
base::allocator::ReleaseFreeMemory needs to be called every minutes
darkdh Aug 31, 2018
232da3e
ClearHostCacheCallback should be in IsOffTheRecord block
darkdh Aug 31, 2018
1247459
Turn IsSyncAccountEmail to default false
darkdh Aug 31, 2018
5cfec9e
Bump v8.1.1+69.0.3497.57
bridiver Aug 31, 2018
b9cec60
Emit WebGestureEvent attributes for scroll-touch-edge event
darkdh Sep 2, 2018
973fc2e
Bump v8.1.2+69.0.3497.57
bridiver Sep 2, 2018
86b6c02
Merge pull request #647 from brave/get-country-name
bridiver Sep 4, 2018
811ba76
Bump v8.1.3+69.0.3497.81
bridiver Sep 4, 2018
c8ec091
fix build error from last chromium .81 bump
bridiver Sep 4, 2018
a4b05ce
Bump v8.1.4+69.0.3497.92
darkdh Sep 11, 2018
d9620b3
Fix Windows blob.mojom.h not found error by
darkdh Sep 12, 2018
d57534a
Update incognito session initialization
bsclifton Sep 13, 2018
a712524
Merge pull request #648 from brave/fix-15191
darkdh Sep 13, 2018
2f20a5c
Bump v8.1.5+69.0.3497.92
darkdh Sep 13, 2018
6c2f235
disable mac views browser
bridiver Sep 17, 2018
ff90369
fix broken build from disabling mac_views_browser
bridiver Sep 17, 2018
e755b44
Bump v8.1.6+69.0.3497.100
darkdh Sep 17, 2018
487188c
remove unused and dangerous apis
bridiver Sep 27, 2018
6ad02d0
Bump v8.1.7+69.0.3497.100
darkdh Sep 28, 2018
c18663a
Issue: 15232 AllowScript should use atom::ContentSettingsManager like…
jumde Oct 2, 2018
b67288b
Merge pull request #651 from brave/noscript_issue
darkdh Oct 4, 2018
e9c4a09
Bump v8.1.8+69.0.3497.100
darkdh Oct 4, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ if (is_win) {
chromedriver = "$chromedriver.exe"
}

chromedriver_version = "2.38"
chromedriver_version = "2.40"

copy("electron_chromedriver_dist_resources") {
sources = [
Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use_relative_paths = True

deps = {
"vendor/node": "https://github.com/brave/node.git@18f874a7222698fee07c977b84dc6082e114e185",
"vendor/node": "https://github.com/brave/node.git@86deba03b1b5a9c391dd8dfaec9f02cdf59b59f1",
"vendor/ad-block": "https://github.com/brave/ad-block.git@5377ddea390a0641d99556e0cf9d9c15b8ef275c",
"vendor/tracking-protection": "https://github.com/brave/tracking-protection.git@bad1cf834508eab25ba6051d04edfb4d68e45401",
"vendor/hashset-cpp": "https://github.com/brave/hashset-cpp.git@edd90e8215ea34582811446a143a7c8063f535f0",
Expand Down
1 change: 0 additions & 1 deletion app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ executable("electron_app") {
"//electron:electron_framework_resources",
"//electron:electron_app_resources",
"//base",
"//build/config:exe_and_shlib_deps",
"//third_party/fontconfig",
"//chrome/common:constants",
"//chrome/common:version_header",
Expand Down
8 changes: 3 additions & 5 deletions app/mac/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ mac_app_bundle("electron_app") {
]

sources = [
"//electron/chromium_src/chrome/app/chrome_exe_main_mac.c",
"//electron/chromium_src/chrome/app/chrome_exe_main_mac.cc",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this also need the seatbelt dep?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I referenced upstream chrome/BUILD.gn and it doesn't seem to be needed

  mac_app_bundle("chrome_app") {
    output_name = chrome_product_full_name

    info_plist_target = ":chrome_app_plist"
    extra_substitutions = [
      "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id",
      "CHROMIUM_SHORT_NAME=$chrome_product_short_name",
      "CHROMIUM_CREATOR=$chrome_mac_creator_code",
    ]

    sources = [
      "app/chrome_exe_main_mac.cc",
    ]

    extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]

    deps = [
      ":chrome_app_strings_bundle_data",
      ":chrome_resources",
      ":chrome_versioned_bundle_data",
      "//chrome/common:version_header",
    ]
...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mainly it only uses seatbelt in helper's code block

if defined(HELPER_EXECUTABLE)

]

deps = [
":electron_versioned_bundle_data",
"//electron:electron_app_resources",
"//build/config:exe_and_shlib_deps",
"//chrome/common:version_header",
]

Expand Down Expand Up @@ -114,7 +113,6 @@ mac_framework_bundle("electron_framework") {
"//chrome:chrome_framework_helpers",
":external_binaries_resources",
"//electron:electron_framework_resources",
"//build/config:exe_and_shlib_deps",
":electron_xibs",
"//chrome/app/nibs:localizer_table",
]
Expand Down Expand Up @@ -195,12 +193,12 @@ mac_app_bundle("electron_helper_app") {
defines = [ "HELPER_EXECUTABLE" ]

sources = [
"//electron/chromium_src/chrome/app/chrome_exe_main_mac.c",
"//electron/chromium_src/chrome/app/chrome_exe_main_mac.cc",
]

deps = [
"//build/config:exe_and_shlib_deps",
"//chrome/common:version_header",
"//sandbox/mac:seatbelt",
]

ldflags = []
Expand Down
1 change: 0 additions & 1 deletion app/win/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ executable("electron_exe") {
deps = [
":electron_exe_version",
":electron_manifest",
"//build/config:exe_and_shlib_deps",
"//electron:browser_dependencies",
"//electron:child_dependencies",
"//base",
Expand Down
7 changes: 7 additions & 0 deletions atom/app/atom_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#endif

#if defined(OS_MACOSX)
#include "atom/browser/mac/atom_application.h"
#include "chrome/app/chrome_main_mac.h"
#include "chrome/browser/mac/relauncher.h"
#include "chrome/common/mac/cfbundle_blocker.h"
Expand Down Expand Up @@ -399,4 +400,10 @@ AtomMainDelegate::CreateContentClient() {
return std::unique_ptr<brightray::ContentClient>(new AtomContentClient);
}

void AtomMainDelegate::PreContentInitialization() {
#if defined(OS_MACOSX)
atom_application_mac::RegisterBrowserCrApp();
#endif
}

} // namespace atom
1 change: 1 addition & 0 deletions atom/app/atom_main_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class AtomMainDelegate : public brightray::MainDelegate {
#if defined(OS_POSIX) && !defined(OS_MACOSX)
void ZygoteForked() override;
#endif
void PreContentInitialization() override;

#if defined(OS_MACOSX)
bool ShouldSendMachPort(const std::string& process_type) override;
Expand Down
1 change: 0 additions & 1 deletion atom/app/atom_main_delegate_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

void AtomMainDelegate::OverrideFrameworkBundlePath() {
base::FilePath* version_path = new base::FilePath(GetFrameworksPath());
chrome::SetOverrideVersionedDirectory(version_path);
base::mac::SetOverrideFrameworkBundlePath(
GetFrameworksPath().Append(PRODUCT_SHORTNAME_STRING " Framework.framework"));
}
Expand Down
2 changes: 0 additions & 2 deletions atom/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ source_set("browser") {
"native_window_mac.h",
"native_window_mac.mm",
"relauncher_mac.cc",
"ui/accelerator_util_mac.mm",
"ui/cocoa/atom_menu_controller.h",
"ui/cocoa/atom_menu_controller.mm",
"ui/drag_util_mac.mm",
Expand All @@ -221,7 +220,6 @@ source_set("browser") {
"api/atom_api_menu_views.h",
"common_web_contents_delegate_views.cc",
"native_window_views.h",
"ui/accelerator_util_views.cc",
"ui/views/frameless_view.cc",
"ui/views/frameless_view.h",
"ui/views/menu_bar.cc",
Expand Down
70 changes: 70 additions & 0 deletions atom/browser/api/atom_api_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@
#include "base/strings/utf_string_conversions.h"
#endif

#if defined(OS_MACOSX)
#import <CoreFoundation/CoreFoundation.h>
#endif

#if defined(OS_LINUX)
#include <locale.h>
#endif

#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "brave/browser/api/brave_api_extension.h"
#include "chrome/browser/chrome_notification_types.h"
Expand Down Expand Up @@ -714,6 +722,67 @@ void App::SetLocale(std::string locale) {
g_browser_process->SetApplicationLocale(locale);
}

std::string App::GetCountryName() {
std::string country = "";

#if defined(OS_WIN)
// for more info, see:
// https://docs.microsoft.com/en-us/windows/desktop/api/winnls/nf-winnls-getlocaleinfoex
// https://docs.microsoft.com/en-us/windows/desktop/Intl/locale-slocalized-constants
WCHAR localized_country_name[80];
int country_name_length = GetLocaleInfoEx(
LOCALE_NAME_USER_DEFAULT,
LOCALE_SLOCALIZEDCOUNTRYNAME,
(LPWSTR)&localized_country_name,
sizeof(localized_country_name) / sizeof(WCHAR));
if (country_name_length > 0) {
base::WideToUTF8(localized_country_name,
country_name_length,
&country);
}

#elif defined(OS_MACOSX)
// for more info, see:
// https://developer.apple.com/documentation/corefoundation/1543547-cflocalegetvalue?language=objc
// https://developer.apple.com/documentation/corefoundation/cflocalekey?language=objc
CFLocaleRef cflocale = CFLocaleCopyCurrent();
CFStringRef country_code = (CFStringRef)CFLocaleGetValue(
cflocale, kCFLocaleCountryCode);
if (country_code) {
CFIndex kCountryNameLength = CFStringGetLength(country_code) + 1;
char localized_country_name[kCountryNameLength];
if (CFStringGetCString(country_code, localized_country_name,
kCountryNameLength, kCFStringEncodingUTF8)) {
country = std::string(localized_country_name);
}
}

#elif defined(OS_LINUX)
// for more info, see:
// https://en.cppreference.com/w/cpp/locale/setlocale
// https://www.gnu.org/software/libc/manual/html_node/Setting-the-Locale.html

// capture currently set locale (strdup since value gets clobbered)
const char* old_locale = setlocale(LC_ALL, NULL);
char* saved_locale = old_locale ? strdup(old_locale) : NULL;
if (saved_locale) {
// set C locale to user-preferred locale
setlocale(LC_ALL, "");
// get the name of this locale
const char* locale = setlocale(LC_ALL, NULL);
if (locale) {
country = std::string(locale);
}
// restore original locale
setlocale(LC_ALL, saved_locale);
free(saved_locale);
}

#endif

return country;
}

bool App::GetBooleanPref(const std::string& path) {
return g_browser_process->local_state()->GetBoolean(path);
}
Expand Down Expand Up @@ -954,6 +1023,7 @@ void App::BuildPrototype(
.SetMethod("setDesktopName", &App::SetDesktopName)
.SetMethod("getLocale", &App::GetLocale)
.SetMethod("setLocale", &App::SetLocale)
.SetMethod("getCountryName", &App::GetCountryName)
.SetMethod("getBooleanPref", &App::GetBooleanPref)
.SetMethod("setBooleanPref", &App::SetBooleanPref)
.SetMethod("makeSingleInstance", &App::MakeSingleInstance)
Expand Down
1 change: 1 addition & 0 deletions atom/browser/api/atom_api_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class App : public AtomBrowserClient::Delegate,
void SetDesktopName(const std::string& desktop_name);
void SetLocale(std::string);
std::string GetLocale();
std::string GetCountryName();
void SetBooleanPref(const std::string& path, bool value);
bool GetBooleanPref(const std::string& path);
bool MakeSingleInstance(
Expand Down
24 changes: 13 additions & 11 deletions atom/browser/api/atom_api_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ void DoCacheActionInIO(

void SetCertVerifyProcInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
const AtomCertVerifier::VerifyProc& proc) {
AtomCertVerifier::VerifyProc proc) {
auto request_context = context_getter->GetURLRequestContext();
static_cast<AtomCertVerifier*>(request_context->cert_verifier())->
SetVerifyProc(proc);
SetVerifyProc(std::move(proc));
}

void ClearHostResolverCacheInIO(
Expand Down Expand Up @@ -492,15 +492,17 @@ void Session::SetDownloadPath(const base::FilePath& path) {
void Session::SetCertVerifyProc(v8::Local<v8::Value> val,
mate::Arguments* args) {
AtomCertVerifier::VerifyProc proc;
if (!(val->IsNull() || mate::ConvertFromV8(args->isolate(), val, &proc))) {
args->ThrowError("Must pass null or function");
return;
}
// TODO(hferreiro)
// if (!(val->IsNull() ||
// mate::ConvertFromV8(args->isolate(), val, std::move(proc)))) {
// args->ThrowError("Must pass null or function");
// return;
//}

BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&SetCertVerifyProcInIO,
request_context_getter_,
proc));
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::BindOnce(&SetCertVerifyProcInIO, request_context_getter_,
std::move(proc)));
}

void Session::SetPermissionRequestHandler(v8::Local<v8::Value> val,
Expand All @@ -511,7 +513,7 @@ void Session::SetPermissionRequestHandler(v8::Local<v8::Value> val,
return;
}
auto permission_manager = static_cast<brave::BravePermissionManager*>(
profile_->GetPermissionManager());
profile_->GetPermissionControllerDelegate());
permission_manager->SetPermissionRequestHandler(handler);
}

Expand Down
36 changes: 18 additions & 18 deletions atom/browser/api/atom_api_user_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,51 +60,51 @@ Profile* UserPrefs::profile() {
}

void UserPrefs::RegisterStringPref(const std::string& path,
const std::string& default_value, bool overlay) {
const std::string& default_value, bool persist) {
profile()->pref_registry()->RegisterStringPref(path, default_value);
if (overlay)
profile()->AddOverlayPref(path);
if (persist)
profile()->RegisterPersistentPref(path);
}

void UserPrefs::RegisterDictionaryPref(const std::string& path,
const base::DictionaryValue& default_value, bool overlay) {
const base::DictionaryValue& default_value, bool persist) {
std::unique_ptr<base::DictionaryValue> copied(
default_value.CreateDeepCopy());
profile()->pref_registry()->
RegisterDictionaryPref(path, std::move(copied));
if (overlay)
profile()->AddOverlayPref(path);
if (persist)
profile()->RegisterPersistentPref(path);
}

void UserPrefs::RegisterListPref(const std::string& path,
const base::ListValue& default_value, bool overlay) {
const base::ListValue& default_value, bool persist) {
std::unique_ptr<base::ListValue> copied(
default_value.CreateDeepCopy());
profile()->pref_registry()->
RegisterListPref(path, std::move(copied));
if (overlay)
profile()->AddOverlayPref(path);
if (persist)
profile()->RegisterPersistentPref(path);
}

void UserPrefs::RegisterBooleanPref(const std::string& path,
bool default_value, bool overlay) {
bool default_value, bool persist) {
profile()->pref_registry()->RegisterBooleanPref(path, default_value);
if (overlay)
profile()->AddOverlayPref(path);
if (persist)
profile()->RegisterPersistentPref(path);
}

void UserPrefs::RegisterIntegerPref(const std::string& path,
int default_value, bool overlay) {
int default_value, bool persist) {
profile()->pref_registry()->RegisterIntegerPref(path, default_value);
if (overlay)
profile()->AddOverlayPref(path);
if (persist)
profile()->RegisterPersistentPref(path);
}

void UserPrefs::RegisterDoublePref(const std::string& path,
double default_value, bool overlay) {
double default_value, bool persist) {
profile()->pref_registry()->RegisterDoublePref(path, default_value);
if (overlay)
profile()->AddOverlayPref(path);
if (persist)
profile()->RegisterPersistentPref(path);
}

std::string UserPrefs::GetStringPref(const std::string& path) {
Expand Down
Loading