Commit graph

1360 commits

Author SHA1 Message Date
Zhuo Lu
ab24a1e36d feat: netLog API for dynamic logging control (#13068)
* Introduce `net.{start|stop}Logging()`

- Slight regression right now as Electron won't automatically start logging net-logs at launch, will soon be fixed
- To implement callback for async controls

* Add `net.isLogging` & optional callback param for `net.stopLogging()`

* Fix small regression on --log-net-log

--log-net-log should work again

* Error on empty file path

* Only start with valid file path

* Remove unused var

* Allow setting log file path before URLRequestContextGetter starts logging

* Add net log tests

* Remove redundant checks

* Use brightray::NetLog

* Clean up code

* Should automatically stop listening

* 🎨 Attempt to fix styles

* Only run non-null callback

* Dump file to tmpdir

* Simplify net log spec

Spawned Electron process on Linux CI can fail to launch

* Separate netLog module

* Remove net logging test from net spec

* Add tests for netLog

* Fix header guard

* Clean up code

* Add netLog.currentlyLoggingPath

* Callback with filepath

* Add test for case when only .stopLogging() is called

* Add docs

* Reintroduce error on invalid arg

* Update copyright

* Update error message

* Juggle file path string types
2018-06-19 11:45:58 +10:00
Cheng Zhao
18dde0a0bd load all pak files on macOS 2018-06-18 16:51:36 +09:00
Zhuo Lu
fd25f594cd Do not capture cookies and credentials (#13065) 2018-05-24 14:46:54 -07:00
Cheng Zhao
5f461cd5cd fix release build on arm 2018-05-18 10:50:31 +09:00
Jeremy Apthorp
b160093b91
refactor: GN builds on linux (#12957) 2018-05-16 12:51:11 -07:00
Cheng Zhao
874af5c982
Merge pull request #12837 from nornagon/build-gn
GN build
2018-05-15 14:02:51 +09:00
Jeremy Apthorp
9aa18d29a5
Merge pull request #12885 from nornagon/is-desktop-unity
Don't declare IsDesktopEnvironmentUnity on non-Linux
2018-05-10 14:41:29 -07:00
Jeremy Apthorp
87d0175c76 Require !OS_MACOSX as well as TOOLKIT_VIEWS for views code 2018-05-10 14:11:19 -07:00
Jeremy Apthorp
f2b1b3f6b8 Add GN build 2018-05-10 14:03:02 -07:00
Jeremy Apthorp
26f5390ac0 Don't declare IsDesktopEnvironmentUnity on non-Linux 2018-05-10 13:59:48 -07:00
Shelley Vohr
21e5a2e071
Add clang-format script and precommit hook (#12651)
* add second arg to hook

* fix clang-format script

* remove format script

* help

* first pass at only checking formatting for changed files

* ensure clang-format only runs against changes

* add quiet option for print output

* fix script outputs for clang-format

* wrap conditional for exit error

* remove cpplint include ordering from brightray

* fix python style errors

* add clang-format to linting

* fix var error and add mm extension

* fix diff checking for commit hook

* show incorrectly formatted lines when linting fails

* don't try to check formatting for deleted files
2018-04-27 13:01:12 -04:00
Shelley Vohr
12a57ff1c2 clang-format objc files (#12673) 2018-04-20 11:47:04 -07:00
Cheng Zhao
28b85762fd
Merge pull request #12660 from electron/mac-views
Refactor NativeWindow (Part 8): Prepare work for using views::Widget on macOS
2018-04-20 21:31:28 +09:00
Robo
ff571f3b5d Part I: Move from base::Bind to base::BindOnce and remove unneeded base::Passed (#12661) 2018-04-20 19:55:05 +09:00
Cheng Zhao
1c6c75da4f Merge the logic of managing ViewsDelegate 2018-04-20 19:10:37 +09:00
deepak1556
6d0ac6593c [chromium-style] Complex class/struct needs an explicit out-of-line copy constructor. 2018-04-19 11:12:58 -07:00
Jeremy Apthorp
f3c00e96aa Bring mac code into conformance with -Wunguarded-availability 2018-04-19 11:12:58 -07:00
Jeremy Apthorp
27cee90e5e [chromium-style] move methods out of headers 2018-04-19 11:12:58 -07:00
Jeremy Apthorp
f1587da480 [chromium-style] out-of-line default constructors and destructors 2018-04-19 11:12:58 -07:00
Jeremy Apthorp
6c26bb1cf8 [chromium-style] destructors of ref-counted objects should be private 2018-04-19 11:12:10 -07:00
Jeremy Apthorp
e6695cf2ec [chromium-style] override / virtual warnings 2018-04-19 11:12:10 -07:00
Jeremy Apthorp
a635f078c6 [chromium-style] auto variable type must not deduce to a raw pointer type 2018-04-19 11:10:52 -07:00
Shelley Vohr
49c8c31220
format previously misses .cc files 2018-04-17 21:56:12 -04:00
Shelley Vohr
284aca68c0
clang-format brightray 2018-04-17 21:46:27 -04:00
Shelley Vohr
d722008367
remove unnecessary ptr_util.h include 2018-04-12 22:34:26 -04:00
Shelley Vohr
b05932310b
replace base::MakeUnique with std::make_unique 2018-04-12 08:48:32 -04:00
Robo
171230e45d Cleanup destruction of URLRequestContextGetter (#12305)
- Add Leak detector
 - Indicate shutdown of request context from Browser Context
 - Change stored references to URLRequestContextGetter to use BrowserContext
 - Destroy session properties explicitly
2018-03-30 08:24:55 -05:00
Cheng Zhao
c70150847d Ignore warning LNK4199
We are now sharing the /DELAYLOAD settings between configurations.
2018-03-20 10:13:17 +03:00
deepak1556
f5e1ee010b FIXME: disable pdf viewer feature 2018-03-20 10:13:17 +03:00
deepak1556
c3f8f6bc42 re-use request context from IOThread 2018-03-20 10:13:17 +03:00
Cheng Zhao
246f6318e4 Fix release build on Windows 2018-03-20 10:13:16 +03:00
Cheng Zhao
ecefe41728 Linker behaves differently on arm 2018-03-20 10:13:16 +03:00
Cheng Zhao
34cb9cf1fe Use lld for linking on both Debug/Release builds
This follows Chromium's config, otherwise we get linking error:
/usr/bin/ld: shared_library/libmirclient.so.9: __cxa_finalize: invalid needed version 2
shared_library/libmirclient.so.9: error adding symbols: Bad value
2018-03-20 10:13:16 +03:00
Tomas Rycl
f2116c50c0 Unity detection now works in all OSes - returns false. 2018-03-20 10:13:15 +03:00
Tomas Rycl
c15e09b71e rtc_base_approved renamed to generic 2018-03-20 10:13:15 +03:00
deepak1556
b9bb4dfc06 FIXME: re-enable guest webcontents based on OOPIF feature 2018-03-20 10:13:15 +03:00
deepak1556
b552ad7065 add taskpriority when creating sequences task runners 2018-03-20 10:13:15 +03:00
Aleksei Kuzmin
fa3d9d32ae Use XDG_CURRENT_DESKTOP to determine if the desktop environment is Unity
https://chromium-review.googlesource.com/682615
2018-03-20 10:13:15 +03:00
deepak1556
007ea500d0 REVIEW: Re-use devtools network throttling from content layer
https://chromium-review.googlesource.com/c/chromium/src/+/664356
2018-03-20 10:13:15 +03:00
Samuel Attard
78266db427 Fix webrtc linking issues 2018-03-20 10:13:15 +03:00
Samuel Attard
9181db1304 Disable tautological check for chromium code 2018-03-20 10:13:15 +03:00
Samuel Attard
e65815e34c Implement GetBackgroundFetchDelegate in brightray::BrowserContext 2018-03-20 10:08:58 +03:00
Samuel Attard
de2981a767 Move proxy constructor to ProxyService namespace 2018-03-20 10:08:58 +03:00
Samuel Attard
6f695b93d5 Fix system proxy config resolver constructor 2018-03-20 10:08:58 +03:00
Samuel Attard
f2edd5d068 v8 proxy service has been removed 2018-03-20 10:08:58 +03:00
Samuel Attard
f0ef11b856 BlockingPool has been removed 2018-03-20 10:08:58 +03:00
Samuel Attard
12066a60f3 make_scoped_refptr --> WrapRefCounted 2018-03-20 10:08:58 +03:00
Samuel Attard
461e33104e HandleCommand now takes session_id and returns success boolean. It is assumed a nullptr from the handler means failure 2018-03-20 10:08:57 +03:00
Ales Pergl
84ce3a9ea1 Use same delay-load settings in both debug and release 2018-03-16 17:10:38 +01:00
Charles Kerr
dd2c2660b9
Fix desktop-id notification edge case (#12216)
* Fix desktop-id notification edge case

* Extract-method platform_util::GetDesktopName()

This removes duplicated code from libnotify_notifications.cc
and atom/common/linux/application_info.cc.

* Check for empty case in GetDesktopName().

* Move GetDesktopName() to brightray::util

* Remove unnecessary changes in platform_util

* Add a brightray::platform_util namespace
2018-03-12 16:02:47 +09:00
Charles Kerr
86af20ded0
Linux named notifications (#12192)
* Set name & desktop-entry on Linux notifications

* DBusMock now honors verbose mode flag

* Disable DBus Notification tests on ia32
2018-03-12 09:33:06 +09:00
Cheng Zhao
51f89048d6 Use bundled freetype from Chromium 2018-03-08 10:47:19 -05:00
Cheng Zhao
cc6bcb6c81 Fix some flaky tests in CI (#12153)
* Guard whole InitPrefs with ScopedAllowIO

Saw a crash:
0 0x7f8d2f7d918d base::debug::StackTrace::StackTrace()
1 0x7f8d2f7d755c base::debug::StackTrace::StackTrace()
2 0x7f8d2f867caa logging::LogMessage::~LogMessage()
3 0x7f8d2fa157c7 base::ThreadRestrictions::AssertIOAllowed()
4 0x7f8d2f83453a base::OpenFile()
5 0x7f8d2f82a967 base::ReadFileToStringWithMaxSize()
6 0x7f8d2f82ad44 base::ReadFileToString()
7 0x7f8d2f846f73 JSONFileValueDeserializer::ReadFileToString()
8 0x7f8d2f84738c JSONFileValueDeserializer::Deserialize()
9 0x7f8d35a5d1f6 <unknown>
10 0x7f8d35a5c217 JsonPrefStore::ReadPrefs()
11 0x7f8d35a87d3e PrefService::InitFromStorage()
12 0x7f8d35a87c60 PrefService::PrefService()
13 0x7f8d35a91a10 PrefServiceFactory::Create()
14 0x000000e86e1b brightray::BrowserContext::InitPrefs()
15 0x000000c2bd64 atom::AtomBrowserContext::AtomBrowserContext()
16 0x000000c320db atom::AtomBrowserContext::From()
17 0x000000b4b8b5 atom::api::Session::FromPartition()

* Fix done being called twice in setInterval test

The callback passed to browser process is called asyncly, so it is
possible that multiple callbacks has already been scheduled before we
can clearInternval.

* Fix failing test when dir name has special chars

The pdfSource is not escaped while parsedURL.search is.

* Call done with Error instead of string

* Fix crash caused by not removing input observer

Solve crash:
0 libcontent.dylib content::RenderWidgetHostImpl::DispatchInputEventWithLatencyInfo(blink::WebInputEvent const&, ui::LatencyInfo*) + 214
1 libcontent.dylib content::RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo(blink::WebMouseEvent const&, ui::LatencyInfo const&) + 1350
2 libcontent.dylib content::RenderWidgetHostViewMac::ProcessMouseEvent(blink::WebMouseEvent const&, ui::LatencyInfo const&) + 44
3 libcontent.dylib content::RenderWidgetHostInputEventRouter::RouteMouseEvent(content::RenderWidgetHostViewBase*, blink::WebMouseEvent*, ui::LatencyInfo const&) + 1817

* Print detailed error

* Run tests after server is ready
2018-03-07 14:40:27 +09:00
Cheng Zhao
53229e3d6c Fix network delegate race condition (#12044)
* Fix race condition when getting network delegate

* Remove the evil URLRequestContextGetter::network_delegate

* Move the arguments instead of const referrencing

Safer and more efficient.
2018-02-26 06:23:59 -08:00
Cheng Zhao
b25175a19a Fix assertion when get X11 error in new thread 2018-02-23 10:22:00 +09:00
Cheng Zhao
b7b40d9c3a Fix linking error with atomic 2018-02-23 10:22:00 +09:00
Aleksei Kuzmin
0ec2eba2a3 Add init_webrtc lib to the list of static libraries 2018-02-23 10:21:24 +09:00
deepak1556
041b32b01f remove invalid cookie_details.h filename from brightray 2018-02-23 10:21:24 +09:00
deepak1556
cdab073614 FIX: add chrome-devtools:// to list of WebUI schemes
https://chromium-review.googlesource.com/c/chromium/src/+/617598
2018-02-23 10:21:24 +09:00
deepak1556
5eb0a89579 REVIEW: let browser context manage cookie change sub list 2018-02-23 10:21:24 +09:00
deepak1556
f52f752acd fxedit is removed and pdfwindow renamed to pwl
https://pdfium-review.googlesource.com/c/pdfium/+/8552
https://pdfium-review.googlesource.com/c/pdfium/+/8791
2018-02-23 10:21:24 +09:00
deepak1556
248d572077 REVIEW: Subscribe to cookie store for changes in place of CookieMonsterDelegate 2018-02-23 10:21:23 +09:00
Tomas Rycl
8d6c7955ad Add path to skia gpu 2018-02-23 10:21:23 +09:00
Shelley Vohr
233679865b fix some more compilation errors 2018-02-23 10:21:23 +09:00
Tomas Rycl
6a61ec7763 Add path to khrplatform.h file 2018-02-23 10:21:23 +09:00
Tomas Rycl
1b866e20c6 REVIEW: Disable warning 4275 on Windows
It prevents Brightray classes to be inherited from other classes
from V8, Chromium, etc...
2018-02-23 10:21:23 +09:00
deepak1556
75c17cf846 Use generic base::Value::SetKey
Remove base::Value::SetDoubleWithoutPathExpansion
https://chromium-review.googlesource.com/591654

Remove base::Value::SetStringWithoutPathExpansion
https://chromium-review.googlesource.com/592368

Remove base::Value::SetIntegerWithoutPathExpansion
https://chromium-review.googlesource.com/591655
2018-02-23 10:21:23 +09:00
Tomas Rycl
8250dbd172 Removing some function parameters 2018-02-23 10:21:23 +09:00
Tomas Rycl
0d83b69fe2 FIXME: Fix brightray::DevToolsNetworkTransaction compilation
See
https://chromium-review.googlesource.com/631119
https://chromium-review.googlesource.com/611089
2018-02-23 10:21:23 +09:00
Aleksei Kuzmin
dda64bd652 Use c++14
https://chromium-review.googlesource.com/c/chromium/src/+/583635
2018-02-23 10:21:23 +09:00
Ales Pergl
89d5e4a2f0 Explicitly disable executable stack in all Linux binaries 2018-02-21 17:57:53 +01:00
Ales Pergl
c3dbba00a6 Use --icf=all on architectures where it's supported 2018-02-21 17:55:28 +01:00
Charles Kerr
8d086a43cb
Fix brightray::GetApplicationName(), ..Version() on Linux (#11980)
* add brightray API to override app version

* in atom browser, use brightray app version API

* on Linux, have GetApplicationVersion() use brightray version API

* on Linux, implement brightray::GetApplicationName()

* fix typo in brightray API

* make browser.GetName() logic follow GetVersion() logic

* improve variable name in OverrideApplicationVersion declaration

* fix typo in brightray impl
2018-02-20 10:16:51 -06:00
Charles Kerr
2a16b28be4
Cache libnotify server caps (#11965)
* cache libnotify server capabilities

* fix broken production cache in NotifierSupportsActions()

* log a warning if LibnotifyNotification::Initialize() fails
2018-02-20 07:53:10 -06:00
John Kleinschmidt
78ccfa0612
Merge pull request #11879 from electron/fix-gtk-deprecations
Fix GTK+ 3 deprecations
2018-02-16 10:01:01 -05:00
Charles Kerr
d30310a2f2 don't build libgtkui files on non-GTK+ platforms 2018-02-15 15:15:26 -06:00
Cheng Zhao
af92b04eb9
Merge pull request #11654 from sethlu/set-notification-close-button-text
feat: Set macOS notification close button title
2018-02-15 16:01:30 +09:00
Cheng Zhao
fdda1c55c5
Merge pull request #11647 from sethlu/accept-additional-notification-actions
feat: Accept additional notification actions
2018-02-15 15:46:36 +09:00
Charles Kerr
402201ac39
Fix cppcheck warnings (#11883)
* remove unused variable

* limit scope of variable 'ret'

* pass shared_ptr<SkBitmap> by reference

* silence warning: value reassign before read

* fix oops

* don't refer to 'response' after std::move()ing it

* make the linter happy
2018-02-14 02:21:46 -06:00
Zhuo Lu
0b7a629a41 Overload method for naming consistency 2018-02-10 03:20:20 -08:00
Zhuo Lu
75b990faff Use std::string::empty to check 2018-02-10 03:20:20 -08:00
Zhuo Lu
1e1087abbb Simplify formatting 2018-02-10 03:20:20 -08:00
Zhuo Lu
31baafab3b NSUserNotification should respond
NSUserNotification is expected to responsd to `@selector(setContentImage:)` with macOS ^10.9
2018-02-10 03:20:20 -08:00
Zhuo Lu
09d51f0a3d Fix include order 2018-02-10 03:20:20 -08:00
Zhuo Lu
844ee0a3f4 Accept additional notification actions
Change to the existing API definition: The first action with type `button` seen will be displayed on the notification, the rest listed as additional actions (shown when holding down on the primary action button)
2018-02-10 03:20:20 -08:00
Zhuo Lu
29f9929703 Organize code 2018-02-10 03:19:47 -08:00
Zhuo Lu
be118d4f13 Make it able to set close button text 2018-02-10 03:19:47 -08:00
Aleš Pergl
efb44050db Enable official build (#11847)
* Updated libchromiumcontent submodule

* Use same LTO settings as libcc

* Use whole program optimization, favour speed, remove redundancies

* Don't use variable template as it confuses LTCG

* Use lld and ThinLTO only on limited set of architectures
2018-02-08 13:26:23 -06:00
shelley vohr
ca34978e73 add app.setLocale() (#11469)
* infrastructure for setLocale via klang

* add documentation for setLocale

* add test for setLocale

* fix spec

* add spec and update docs

* fix carriage feeds on windows

* SetLocale() sets LC_ALL on Linux

* in SetLocale() on Linux, use g_setenv()

* fix tyop: '#ifdef OSX_POSIX'

* make the linter happy

* improvements from review
2018-02-08 08:26:37 -06:00
Cheng Zhao
8ac52b418b Coding style fixes 2018-02-05 17:29:59 +09:00
Samuel Attard
9676c0a4f9 Fix build and ensure no breaking change 2018-02-05 17:29:59 +09:00
Cheng Zhao
1c43768104 Coding style fixes 2018-02-05 17:29:59 +09:00
Samuel Attard
87c2f0f14f Fix build and ensure no breaking change 2018-02-05 17:29:59 +09:00
Samuel Attard
5f7a173d1d Add missing header import 2018-02-05 17:29:59 +09:00
Samuel Attard
72464a6db5 Fix implicit appUserModelId set 2018-02-05 17:29:59 +09:00
Cheng Zhao
0cce6b3d21 Fix cpplint warning 2018-01-03 17:32:18 +09:00
Cheng Zhao
d6068759b6 win: Fix assertion when creating Notification 2018-01-03 17:25:19 +09:00
deepak1556
abe1faea5c REVIEW: setup request context for NSS OCSP only once 2018-01-02 16:37:11 +09:00
deepak1556
a1592446da REVIEW: access GetApplicationLocale on sequence that allows IO 2018-01-02 16:37:08 +09:00
deepak1556
ebb0e46380 REVIEW: create AtomNetworkDelegate on the IO thread 2018-01-02 16:37:08 +09:00