A ScreenOrientationDelegate has been added to handle platform specific implementations. Such as actual locking/unlocking, as well as if the actions are supported.
BUG=396760
Review URL: https://codereview.chromium.org/546453004
Cr-Commit-Position: refs/heads/master@{#298719}
While attempting to resolve a flaky browser_test, it became clear that
AudioMirroringManager was not outliving its use. In the original change
that introduced this class, it was instantiated and owned by
BrowserMainLoop as a matter of convenience. However, with some
debugging, it's clear that it must outlive objects that can outlive
BrowserMainLoop (e.g., WebContentsAudioInputStream).
Side notes: I've checked the feasibility of other solutions, confirming
that the shutdown of AudioManager does NOT guarantee complete teardown
of an AudioInputStream, so it's not sufficient to simply change the
destruction order of the objects in BrowserMainLoop to resolve this
problem. As AudioMirroringManager provides a browser-wide service and
owns no objects, it seems reasonable for it to exist as a global
LazyInstance.
BUG=396413
Review URL: https://codereview.chromium.org/499483003
Cr-Commit-Position: refs/heads/master@{#292258}
This CL enables chromeos chrome startup trace when chrome in restarted on
user log in: startup trace should be saved to disk on process exit if
"trace-startup-duration" period has not ended yet.
BUG=346913
TEST=manual
Review URL: https://codereview.chromium.org/359473006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281061 0039d316-1c4b-4281-b951-d872f2087c98
zone changes.
On Mac, this listens for NSSystemTimeZoneDidChangeNotification notifications.
The Mac implementation also contains a sandbox hole to allow time zone
information (/etc/localtime and /usr/share/zoneinfo) to be read from within
sandboxed renderer processes.
On Windows, this listens for WM_TIMECHANGE messages.
On Linux (but not Chrome OS or Android), this watches for changes to
/etc/localtime, /etc/timezone, and /etc/TZ. There isn't a better standard for
watching for time zone changes on Linux. The actual mechanism is
libc-specific, but this should work with common libc implementations. Time
zone watching is suppressed if the TZ environment variable is set. Linux
(including Chrome OS and Android) already contains a sandbox workaround
(ProxyLocaltimeCallToBrowser) that allows renderer processes to get time zone
information from the browser.
On Android, this uses a Java bridge to listen for
Intent.ACTION_TIMEZONE_CHANGED.
This unifies the existing time zone change notification from Chrome OS with
the other platform implementations.
On Mac, Linux, Chrome OS, and Android renderers should pick up the new time
zone name and UTC offset. On Windows, renderers may only be able to pick up
the new UTC offset only, and the sandbox may blocks them from picking up the
new time zone name, although in my test on Windows Server 2012, they were able
to pick up both the UTC offset and the time zone name upon change.
This is a continuation of https://codereview.chromium.org/183763041/ (Mac) and
https://codereview.chromium.org/193763002/ (Windows).
BUG=288697
TEST=http://crbug.com/288697#c12: load the page, change the system time zone,
and then click "recheck" to ensure that the renderer picks up the new
time zone. Don't reload the page, which is likely to give you a new
renderer process, use the "recheck" link on the page.
R=bulach@chromium.org, cpu@chromium.org, jeremy@chromium.org, jln@chromium.org, jochen@chromium.org, pastarmovj@chromium.org, rsesek@chromium.org
Review URL: https://codereview.chromium.org/251613002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267226 0039d316-1c4b-4281-b951-d872f2087c98
On Chrome OS, it is possible for chrome to start without the X11
server (e.g. X server has crashed, and hasn't restarted since). In
such cases, Chrome ends up causing a crash. So instead of the crash,
abort the startup sequence if the toolkit initialization step fails.
BUG=364929
R=jam@chromium.org
Review URL: https://codereview.chromium.org/250723002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266231 0039d316-1c4b-4281-b951-d872f2087c98
ThreadSanitizer caught multiple instances where PowerMonitor::Get or PowerMonitor::Add/RemoveObserver were being called concurrently with the PowerMonitor constructor in the main thread. These functions access a process-global PowerMontior instance (g_power_monitor), which was not thread safe.
This change adds locks around PowerMonitor creation and deletion, and forces Add/RemoveObserver to be called in a threadsafe manner. It also removes the need to call PowerMonitor::Get.
BUG=268924
Review URL: https://codereview.chromium.org/179923006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262018 0039d316-1c4b-4281-b951-d872f2087c98
Fix all forward-declares and header files referencing CommandLine.
This keeps a "using base::CommandLine" in the command line header file so that the rest of the source files can be changes in a follow-up.
TBR=sky
Review URL: https://codereview.chromium.org/196413016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257514 0039d316-1c4b-4281-b951-d872f2087c98
Currently DeviceMonitorMac is constructed from BrowserMainLoop in the
first compasses of Chrome bringup. DeviceMonitorMac creates either a
QTKitMonitorImpl or a AVFoundationMonitorImpl, that immediately
starts observing the system capture devices. This monitoring is
not needed until the user actively starts operating the devices,
that happens in MediaStreamManager.
This CL adds a method StartMonitoring() to DeviceMonitorMac that is
exercised from MediaStreamManager::StartMonitoring().
The performance regression in bugs 349616 and 348020 affects only
AVFoundation, but both implementations would benefit from a delayed
startup.
Tested locally via using --[enable/disable]-avfoundation, connecting
and disconnecting devices etc.
BUG=288562, 349616, 348020
Review URL: https://codereview.chromium.org/189443010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256483 0039d316-1c4b-4281-b951-d872f2087c98
Naming cleanup based on following rules:
- MidiFooBar ... use this style to be consistent with chromium
- WebMIDIFooBar ... Web API name related things, or names in blink
- MIDIFooBar ... APIs and structures defined by each operating systems
Other cleanup:
- Modify some TODO(crogers) to TODO(toyoshim)
- Add some crbug links.
- Remove some obsolete UI TODOs related to infobars
BUG=none
TEST=build for all platforms
Review URL: https://codereview.chromium.org/151343002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248686 0039d316-1c4b-4281-b951-d872f2087c98
This is useful for embedded linux setups, which often don't include udev support.
TEST=Build content_shell on linux with use_udev=0 then run ldd on output binaries to verify libudev is not listed (and is listed if built with use_udev=1 or unspecified)
BUG=318315,318413
Review URL: https://codereview.chromium.org/12374068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236204 0039d316-1c4b-4281-b951-d872f2087c98
Trace memory, swap, ZRAM, and disk activity and
place the data in JSON to be displayed by trace-viewer.
BUG=236763
TEST=base_unittests TraceSystemStatsMonitorTest.*
Review URL: https://chromiumcodereview.appspot.com/22836004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223806 0039d316-1c4b-4281-b951-d872f2087c98
On Android we can get a second request to start the browser while
the an asynchronous request is in progress. Since the second
request may be synchronous, we may have switch to completing
initialization synchronously. This patch handles this by tracking
which initialization tasks have been run, and running the remaining
initialization tasks.
BUG=260574
Review URL: https://chromiumcodereview.appspot.com/22691002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219795 0039d316-1c4b-4281-b951-d872f2087c98
It works like this on the browser side:
A new object UserInputMonitor is created on BrowserMainLoop and passed to AudioInputRendererHost to pass to AudioInputController.
AudioInputController::DoRecord calls UserInputMonitor::AddKeyStrokeListener --> UserInputMonitor listens to system key events (only implemented on Linux) --> AudioInputController::OnKeyPressed is called and sets key_pressed_ --> When AudioInputController::OnData called, it writes key_pressed_ to shared memory along with the audio data buffer.
On the renderer side a new param "key_pressed" is added through the code path of passing the flag to the webrtc voice engine.
This CL includes all these changes except the implementation of UserInputMonitor for Windows and Mac. The impl of UserInputMonitor is mostly copied from remoting/host/local_input_monitor_linux.cc
BUG=
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=217768
Review URL: https://chromiumcodereview.appspot.com/21183002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217844 0039d316-1c4b-4281-b951-d872f2087c98
> Adding key press detection in the browser process.
> It works like this on the browser side:
> A new object KeyPressMonitor is created on BrowserMainLoop and passed to AudioInputRendererHost to pass to AudioInputController.
> AudioInputController::DoRecord calls KeyPressMonitor::AddKeyPressListener --> KeyPressMonitor listens to system key events through UserInputMonitor(only implemented on Linux) --> AudioInputController::OnKeyPressed is called and sets key_pressed_ --> When AudioInputController::OnData called, it writes key_pressed_ to shared memory along with the audio data buffer.
> On the renderer side a new param "key_pressed" is added through the code path of passing the flag to the webrtc voice engine.
> This CL includes all these changes except the implementation of UserInputMonitor for Windows and Mac. The impl of UserInputMonitor is mostly copied from remoting/host/local_input_monitor_linux.cc
>
>
> BUG=
>
> Review URL: https://chromiumcodereview.appspot.com/21183002TBR=jiayl@chromium.org
Review URL: https://codereview.chromium.org/22871007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217774 0039d316-1c4b-4281-b951-d872f2087c98
It works like this on the browser side:
A new object KeyPressMonitor is created on BrowserMainLoop and passed to AudioInputRendererHost to pass to AudioInputController.
AudioInputController::DoRecord calls KeyPressMonitor::AddKeyPressListener --> KeyPressMonitor listens to system key events through UserInputMonitor(only implemented on Linux) --> AudioInputController::OnKeyPressed is called and sets key_pressed_ --> When AudioInputController::OnData called, it writes key_pressed_ to shared memory along with the audio data buffer.
On the renderer side a new param "key_pressed" is added through the code path of passing the flag to the webrtc voice engine.
This CL includes all these changes except the implementation of UserInputMonitor for Windows and Mac. The impl of UserInputMonitor is mostly copied from remoting/host/local_input_monitor_linux.cc
BUG=
Review URL: https://chromiumcodereview.appspot.com/21183002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217768 0039d316-1c4b-4281-b951-d872f2087c98
This CL splits the later parts of startup, from thread creation onwards,
into multiple UI thread tasks. Depending on the StartupTaskRunner passed
to CreateThreads the tasks are all run immediately, or are queued one at
a time on the UI thread. This, on platforms where the UI is
already running, allows the UI to remain interactive while Chrome is
initialized.
BUG=231856
Review URL: https://chromiumcodereview.appspot.com/19957002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215042 0039d316-1c4b-4281-b951-d872f2087c98
This allows about:tracing to show tcmalloc heap memory allocation over time.
The implementation:
* Adds a "memory" checkbox to about:tracing
* Uses thread-local-storage to store the "stack" of trace events per thread while about:tracing is running.
* Introduces a StackGeneratorFunction callback into tcmalloc, allowing it to call back into Chrome to get a "stack" of trace events.
* Parses the heap profiler output of tcmalloc and converts it to JSON to be displayed by a visualizer in the about:tracing trace viewer.
BUG=243895
TEST=base_unittests TraceMemoryTest.*
Review URL: https://chromiumcodereview.appspot.com/15418002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213473 0039d316-1c4b-4281-b951-d872f2087c98
use ChildThread for main loop - fix Android build
whitespace fix
minor style fix
last minute compile fixes
address Antoine's comments
minor changes to reflect latest Blink API -- address palmer comments
last minute include order fix
address last minute style nits
stub out other OSes
support Takashi's MIDIAccessor
fix minor build err
undo param traits changes
get rid of param_traits - other minor style nits
address scherkus comments
use int64 for ParamTraits
WIP fix white-space issues more style basically working some cleanup -- support for multiple clients forgot midi_manager.cc Get MIDI port information sent to renderer formatting fixes lots of cleanup - added RequestAccess and Send style more style only bother sending received messages to renderer if approval was asked early steps to granting permission to Blink some progress to sending port info to Blink send client_id when requesting access fix minor style issues in .gyp files fix context/browser DEPS fix include paths
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207992 0039d316-1c4b-4281-b951-d872f2087c98
The SystemMonitor is a mixed monitor which not only monitors
the power state changes but also the devices changes. This
patch is to separate the power monitor from SystemMonitor
as a new class PowerMonitor which is dedicated to monitor
power state.
The next step is to seek a opportunity to refactor SystemMonitor
as something like DeviceMonitor.
BUG=149059
TEST=base_unittests --gtest_filter=PowerMonitorTest.*
Review URL: https://chromiumcodereview.appspot.com/10959020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192114 0039d316-1c4b-4281-b951-d872f2087c98
This adds a "using" to the header to avoid having to update everything at once. However, all forward declares and the locations that use the forward declares need to be updated (since they don't see the using in message_loop.h).
BUG=
Review URL: https://codereview.chromium.org/13243003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191566 0039d316-1c4b-4281-b951-d872f2087c98
If a command line flag --memory-metrics is passed, the browser measures the
memory consumption after processing each task and puts the data to a histogram.
The histograms will be used in the memory_benchmark of Telemetry.
BUG=160979
Review URL: https://chromiumcodereview.appspot.com/11975048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179909 0039d316-1c4b-4281-b951-d872f2087c98
1. Added new AudioMirroringManager to dynamically match/route "divertable" audio streams with mirroring destinations.
2. Modified AudioOutputController to provide "divert audio data" functionality.
3. Modified AudioRendererHost to notify AudioMirroringManager of all audio streams.
The intention is, in a later change, to introduce a "WebContentsAudioInputStream" which will implement the AudioMirroringManager::MirroringDestination interface introduced in this change. WCAIS will represent the lifetime of a tab audio mirroring session, calling AudioMirroringManager::Start/StopMirroring() as appropriate.
Testing:
1. Rewrote most of unit testing for AudioOutputController, addressing bug 112500. Also added testing for the new Divert functionality.
2. Added extensive unit testing for the new Start/StopMirroring functionality in AudioMirroringManager.
3. Minor testing clean-ups/additions elsewhere.
BUG=153392,112500
TEST=Run media_unittests and content_unittests.
Review URL: https://chromiumcodereview.appspot.com/11413078
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176295 0039d316-1c4b-4281-b951-d872f2087c98
Fixed most of the files found with the following command line:
$ git grep --files-without-match --name-only "namespace content {" -- content/browser/{*.cc,*.h.*.mm}
R=jam@chromium.org
Review URL: https://codereview.chromium.org/11274038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164120 0039d316-1c4b-4281-b951-d872f2087c98
BUG=none
TEST=Running Win debug Chrome does not produce console output about duplicate COM initializations
Review URL: https://codereview.chromium.org/11000010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159527 0039d316-1c4b-4281-b951-d872f2087c98
DeviceMonitorMac detects device changing and forwards the notifications to the system monitor.
BUG=137799
Review URL: https://chromiumcodereview.appspot.com/10824162
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151689 0039d316-1c4b-4281-b951-d872f2087c98
This patch moves the device thread from VideoCaptureManager to MediaStreamManager, so that audio and video can share one device thread, and also allow running audio device API on this shared device thread.
BUG=132701,130113
TEST=content_unittests
Review URL: https://chromiumcodereview.appspot.com/10662049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145584 0039d316-1c4b-4281-b951-d872f2087c98
Compared to the Singleton solution, this allows the SpeechRecognitionManager to instantiate and cleanup the delegate at the right time.
Also, cleaned-up speech_recognition_browsertest.cc so that the FakeSpeechRecognitionManager extends only the SRM interface, and not the Impl class.
BUG=116954
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10399025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137424 0039d316-1c4b-4281-b951-d872f2087c98