Fix crash in MediaCaptureDevicesDispatcher::ProcessScreenCaptureAccessRequest.

The web contents may be destroyed while awaiting user approval from the modal
message box.

BUG=326690
TEST=trybot, verify crash does not happen on device.
R=fischman@chromium.org, sergeyu@chromium.org

Review URL: https://codereview.chromium.org/98233009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239900 0039d316-1c4b-4281-b951-d872f2087c98
Fixing style issues in ui/android/java/

R=newt@chromium.org
BUG=320711
NOTRY=true

Review URL: https://codereview.chromium.org/102213004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239901 0039d316-1c4b-4281-b951-d872f2087c98
Validate password for "locked" profiles.

A message is displayed if an invalid password is given.  A check is also done when launching non-locked profiles just in case the user was mucking with the javascript (via the Inspector) to make the UI believe it was unlocked when in fact it is.

This CL depends on https://codereview.chromium.org/100153002/ in order to compile.

BUG=324060

Review URL: https://codereview.chromium.org/102223003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239902 0039d316-1c4b-4281-b951-d872f2087c98
Use integer session ID in MediaDrmBridge.

This is part of the effort to move to EME WD implementation. In Chromium, we use
an integer "session ID" to track all EME MediaKeySession calls. This CL updates
MediaDrmBridge to do so. Internally, we uses a ByteBuffer <-> int mapping to
track MediaDrm sessions and EME session IDs.

Also, we use ByteBuffer instead of String to track internal sessions. This
eliminates seveval cases of UnsupportedEncodingException catching since we don't
need to do byte[] <-> String conversion anymore.

R=jrummell@chromium.org,qinmin@chromium.org
BUG=224786
TEST=EME test pages still work on Chrome for Android.

Review URL: https://codereview.chromium.org/107793002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239903 0039d316-1c4b-4281-b951-d872f2087c98
cc: Add PRESUBMIT rule to ban using cc:: inside of namespace cc {...}

This also makes cc/ PRESUBMIT clean for the new check.

The most invasive changes were:

1. Moving the cc/test/paths.h enum into a CCPaths class (named with
CC prefix to clarify this path is for CC since the enum is extending
an enum from base/.
2. Merge ResourcePool::Resource up into ScopedResource which was the
same thing basically.

R=enne
BUG=

Review URL: https://codereview.chromium.org/109263003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239904 0039d316-1c4b-4281-b951-d872f2087c98
sync: Refactor GetUpdates loop

This is a follow-up to r238532.  I had wanted to implement this change
with that CL, but decided it would be easier to split them up into
independent changes.

This refactoring pulls the GetUpdates looping logic out of the
StatusController.  It was implemented that way in a time when the only
way to pass state between different parts of the sync cycle was through
a shared SyncSession and its members.  Now that this is no longer the
case, we can keep the "should continue looping" logic more or less local
to the code that performs  the looping.

The change allows us to remove the updates response message proto member
out of the StatusController.  That could save us a small amount of time,
since copying protos can be somewhat expensive.  More importantly, it
reduces complexity, since we no longer need to worry about the effects
of state stored in the StatusController.  The StatusController is now
used only to collect some counts for debugging.

This has already uncovered a bug.  There was a unit test that failed to
reset its SyncSession in the same manner that it would have been reset
in a non-test scenario.  It depended on the state that was "leaked" from
one sync cycle to the next via the unreset SyncSession in order to meet
its test expectations.

BUG=278484

Review URL: https://codereview.chromium.org/104653003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239905 0039d316-1c4b-4281-b951-d872f2087c98
[chromedriver] Fix a regression: cookie domain getting prefixed with a ".".

BUG=chromedriver:507

Review URL: https://codereview.chromium.org/107273003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239906 0039d316-1c4b-4281-b951-d872f2087c98
Removed unnecessary forward declarations.

Review URL: https://codereview.chromium.org/109483011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239907 0039d316-1c4b-4281-b951-d872f2087c98
Remove temporary fix to avoid an Assert in MediaStreamDispathcerHost::PopRequest when MediaStreamDispatcherHost::DeviceOpened is called.
The way MediaStreamManager::OpenDevice has been refactored so this is hopefully solved in a better way.

BUG= 316396

Review URL: https://codereview.chromium.org/109763004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239908 0039d316-1c4b-4281-b951-d872f2087c98
Linux sandbox: Deprecate compatibility API

Now that all BPF policies are migrated, remove stubs of old API.

BUG=325535
NOTRY=true
R=jorgelo@chromium.org

Review URL: https://codereview.chromium.org/108563007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239909 0039d316-1c4b-4281-b951-d872f2087c98
Do something more interesting than printf when an event is received by sample_app.

R=abarth@chromium.org
http://crbug.com/324639

Review URL: https://codereview.chromium.org/108273008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239910 0039d316-1c4b-4281-b951-d872f2087c98
cc: Remove dead function declaration

R=jamesr@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/110873005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239911 0039d316-1c4b-4281-b951-d872f2087c98
Only move dialogs on BrowserViewLayout::Layout as needed.

BrowserView layout occurs frequently with unchanged bounds.
(ex. when the page title changes Widget::UpdateWindowTitle)

Only update dialog positions on browser layout as needed.
(ie. when the browser's dialog hosting position changes)
(this happens very rarely, since most dialogs are modal)
Make the GetDialogPosition OVERRIDE public, matches decl.

BUG=305480
TEST=Modal dialogs do not flicker while dragging during tab load. Load a site that takes a few seconds to finish loading (cnn.com, youtube.com, etc.), open and drag the edit bookmark dialog or edit search engine dialog while the tab is loading, ensure the dialog does not flicker while dragging and is not automatically moved back to its starting position after dragging.
R=sky@chromium.org
TBR=ben@chromium.org

Review URL: https://codereview.chromium.org/111003004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239912 0039d316-1c4b-4281-b951-d872f2087c98
Fixing Java style issues in chrome/android/

BUG=320711
NOTRY=true

Review URL: https://codereview.chromium.org/111203004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239913 0039d316-1c4b-4281-b951-d872f2087c98
[cr tool] Improving init hooks

Change init fixups to proper init hooks that can detect fixups instead, change version to something with natural order so you can test for earlier versions.
This will enable init hooks to deal with non android clients.

BUG=311092

Review URL: https://codereview.chromium.org/111563004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239914 0039d316-1c4b-4281-b951-d872f2087c98
Revert 239910 "Do something more interesting than printf when an..."

> Do something more interesting than printf when an event is received by sample_app.
> 
> R=abarth@chromium.org
> http://crbug.com/324639
> 
> Review URL: https://codereview.chromium.org/108273008

TBR=ben@chromium.org

Review URL: https://codereview.chromium.org/98303003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239918 0039d316-1c4b-4281-b951-d872f2087c98
Revert 239758 "Enable Audio/Video dev monitoring and Video captu..."

> Enable Audio/Video dev monitoring and Video capture via AVFoundation by default.
> 
> Flipping the command line flag from explicitly enabling AVFoundation to
> disable AVFoundation.
> 
> In the past there was a startup performance regression (http://crbug.com/311325 
> and http://crbug.com/311437), those type of regression should be monitored 
> carefully during the next couple of days.
> 
> BUG=288562
> 
> Review URL: https://codereview.chromium.org/101753003

TBR=mcasas@chromium.org

Review URL: https://codereview.chromium.org/112033003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239920 0039d316-1c4b-4281-b951-d872f2087c98
Revert 239759 "The comment in base64.h implies that base::Base64..."

> The comment in base64.h implies that base::Base64Encode() can return false, but
> this cannot happen in practice. Fix the comment.
> 
> The implementation of Base64Encode() attempts to check for the return value
> MODP_B64_ERROR as a failure, but modp_b64_encode() cannot return this
> value. Remove the check.
> 
> Remove unneeded integer cast.
> 
> Change the return type to void.
> 
> BUG=323357
> TEST=base_unittests, compile all
> TBR=jochen@chromium.org,miket@chromium.org,joi@chromium.org,akalin@chromium.org,sergeyu@chromium.org
> 
> Review URL: https://codereview.chromium.org/86913002

TBR=ricea@chromium.org

Review URL: https://codereview.chromium.org/101113004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239921 0039d316-1c4b-4281-b951-d872f2087c98
Revert 239771 "SyncFS v2: Add re-initialization code for tempora..."

Lightly suspected of causing failures on CrOS:

http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%282%29/builds/9981

> SyncFS v2: Add re-initialization code for temporary service failure case
> 
> Also run SyncEngineInitializer task at high priority.
> 
> BUG=240165
> TEST=manual
> 
> Review URL: https://codereview.chromium.org/110113003

TBR=kinuko@chromium.org

Review URL: https://codereview.chromium.org/111893007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239923 0039d316-1c4b-4281-b951-d872f2087c98
Retain tray bubble's rounded corners when the bubble animates out
by transferring ownership of a layer mask to the associated layer.

BUG=235563
TEST=Manual: when closing an Ash tray menu or tray notification, watch corners
     to make sure they remain rounded.
R=piman@chromium.org, msw@chromium.org, mukai@chromium.org, skuhne@chromium.org

Review URL: https://codereview.chromium.org/25961002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239930 0039d316-1c4b-4281-b951-d872f2087c98