This reverts commit 269aa9d493.
Reason for revert: including fix for test
Original change's description:
> Revert "Add code supporting new field-trial-internals page"
>
> This reverts commit b8e462bc4b.
>
> Reason for revert: This CL is likely the cause of test failure CfmBrowserServiceTest.GetVariationsData on https://ci.chromium.org/ui/p/chromium/builders/ci/linux-cfm-rel starting from https://ci.chromium.org/ui/b/8763776059209925809. Error message: Expected equality of these values:
> field_trial_states
> Which is: "*Baz/Qux/Foo/Bar/"
> states
> Which is: "*Baz/Qux/Foo/Bar"
>
> Original change's description:
> > Add code supporting new field-trial-internals page
> >
> > This CL lays the groundwork for a future
> > field-trial-internals page, with the following changes:
> >
> > * Update base::FieldTrial to include an 'overridden' flag,
> > which is used to change variation group hashes so
> > overridden trial hashes are distinct.
> > * I pulled out code to build field trial strings
> > into AppendFieldTrialGroupToString, to be reused. In some places, we
> > were adding a trailing '/', and other places we weren't. Now we omit
> > the trailing slash everywhere. We can still parse the string
> > with or without the trailing slash.
> >
> > See go/field-trial-internals-dd for more information.
> >
> > Bug: b:284986126
> > Change-Id: I58b86c558cd7973bb6a493322353b52ebf9f619f
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4620752
> > Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
> > Reviewed-by: Matt Menke <mmenke@chromium.org>
> > Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
> > Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
> > Commit-Queue: Dan H <harringtond@chromium.org>
> > Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
> > Reviewed-by: Erik Chen <erikchen@chromium.org>
> > Reviewed-by: Luc Nguyen <lucnguyen@google.com>
> > Cr-Commit-Position: refs/heads/main@{#1227624}
>
> Bug: b:284986126
> Change-Id: I18f84ccf307f6265da24b3603b82344e1bf42c20
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5052200
> Owners-Override: Maggie Cai <mxcai@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Maggie Cai <mxcai@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1227726}
Bug: b:284986126
Change-Id: Id00f514233c08aa439caaa7f4d6bdaa6c5fc38d5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5055166
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Commit-Queue: Dan H <harringtond@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
Reviewed-by: Paul Moy <pmoy@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1229416}
This reverts commit b8e462bc4b.
Reason for revert: This CL is likely the cause of test failure CfmBrowserServiceTest.GetVariationsData on https://ci.chromium.org/ui/p/chromium/builders/ci/linux-cfm-rel starting from https://ci.chromium.org/ui/b/8763776059209925809. Error message: Expected equality of these values:
field_trial_states
Which is: "*Baz/Qux/Foo/Bar/"
states
Which is: "*Baz/Qux/Foo/Bar"
Original change's description:
> Add code supporting new field-trial-internals page
>
> This CL lays the groundwork for a future
> field-trial-internals page, with the following changes:
>
> * Update base::FieldTrial to include an 'overridden' flag,
> which is used to change variation group hashes so
> overridden trial hashes are distinct.
> * I pulled out code to build field trial strings
> into AppendFieldTrialGroupToString, to be reused. In some places, we
> were adding a trailing '/', and other places we weren't. Now we omit
> the trailing slash everywhere. We can still parse the string
> with or without the trailing slash.
>
> See go/field-trial-internals-dd for more information.
>
> Bug: b:284986126
> Change-Id: I58b86c558cd7973bb6a493322353b52ebf9f619f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4620752
> Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
> Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
> Commit-Queue: Dan H <harringtond@chromium.org>
> Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
> Reviewed-by: Erik Chen <erikchen@chromium.org>
> Reviewed-by: Luc Nguyen <lucnguyen@google.com>
> Cr-Commit-Position: refs/heads/main@{#1227624}
Bug: b:284986126
Change-Id: I18f84ccf307f6265da24b3603b82344e1bf42c20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5052200
Owners-Override: Maggie Cai <mxcai@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1227726}
This CL lays the groundwork for a future
field-trial-internals page, with the following changes:
* Update base::FieldTrial to include an 'overridden' flag,
which is used to change variation group hashes so
overridden trial hashes are distinct.
* I pulled out code to build field trial strings
into AppendFieldTrialGroupToString, to be reused. In some places, we
were adding a trailing '/', and other places we weren't. Now we omit
the trailing slash everywhere. We can still parse the string
with or without the trailing slash.
See go/field-trial-internals-dd for more information.
Bug: b:284986126
Change-Id: I58b86c558cd7973bb6a493322353b52ebf9f619f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4620752
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Commit-Queue: Dan H <harringtond@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Cr-Commit-Position: refs/heads/main@{#1227624}
This inlines all remaining DISALLOW_* macros in content/. This is done
manually (vim regex + manually finding insertion position).
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: I8b5ea6dd9f8a3f584cf3eef82634017a38b15be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193883
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#936160}
== Changes since original CL ==
This CL registers ChildProcessFieldTrialSyncer as a FieldTrialList
observer instead of ChildThreadImpl and it makes
ChildProcessFieldTrialSyncer a leaky singleton. This eliminates
lifetime issues.
An alternative would have been to remove ChildThreadImpl from the list
of FieldTrialList observers upon destruction. We decided not to do that
because it would have required extra synchronization.
Diff: https://crrev.com/c/2867567/1..16
== Original description ==
This CL removes usage of ObserverListThreadSafe::NotifySynchronously
in FieldTrialList, to support the removal of this method in a
separate CL.
Currently, FieldTrialList uses
ObserverListThreadSafe::NotifySynchronously to notify observers when a
group is selected for a field trial. This method dispatches synchronous
notifications to observers which were registered on the current
sequence, and uses PostTask to notify other observers asynchronously.
Through code inspection, we found that all implementations of
FieldTrialList::Observer::OnFieldTrialGroupFinalized are
thread-safe. Therefore, they can always be notified synchronously,
no matter which sequence they were registered from.
This CL makes these changes:
- Observers are stored in a lock-protected std::vector instead of
in an ObserverListThreadSafe.
- To notify observers, the list of observers is copied to a local
variable while holding the lock. Then, after releasing the
lock, all observers in the local list are notified.
- In the scope where observers are notified, an atomic variable is
incremented. The RemoveObserver method checks that the variable is
equal to zero. This ensures that no observer is removed while
dispatching notifications (which could cause a use-after-free).
For reference, the implementations of
FieldTrialList::Observer::OnFieldTrialGroupFinalized are:
base/android/field_trial_list.cc:
LOG(INFO) is thread-safe
base/metrics/field_trial_unittest.cc:
The test is single-threaded.
components/variations/child_process_field_trial_syncer_unittest.cc:
The test is single-threaded.
components/variations/variations_crash_keys.cc:
The observer checks whether it runs on the UI thread and
forwards the notification to the UI thread if it's not the case.
components/variations/variations_ids_provider.cc:
The observer uses a lock.
content/browser/field_trial_synchronizer.cc:
The observer checks whether it runs on the UI thread and
forwards the notification to the UI thread if it's not the case.
content/browser/net/network_field_trial_browsertest.cc
RunLoop::Quit() is thread-safe.
content/child/child_thread_impl.cc
A mojo::SharedRemote is thread-safe.
Bug: 1193750
Change-Id: I8351a2cbbce4d5deaafbe2aa75f902e6da822d53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2867567
Commit-Queue: François Doray <fdoray@chromium.org>
Auto-Submit: François Doray <fdoray@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880105}
This CL removes usage of ObserverListThreadSafe::NotifySynchronously
in FieldTrialList, to support the removal of this method in a
separate CL.
Currently, FieldTrialList uses
ObserverListThreadSafe::NotifySynchronously to notify observers when a
group is selected for a field trial. This method dispatches synchronous
notifications to observers which were registered on the current
sequence, and uses PostTask to notify other observers asynchronously.
Through code inspection, we found that all implementations of
FieldTrialList::Observer::OnFieldTrialGroupFinalized are
thread-safe. Therefore, they can always be notified synchronously,
no matter which sequence they were registered from.
This CL makes these changes:
- Observers are stored in a lock-protected std::vector instead of
in an ObserverListThreadSafe.
- To notify observers, the list of observers is copied to a local
variable while holding the lock. Then, after releasing the
lock, all observers in the local list are notified.
- In the scope where observers are notified, an atomic variable is
incremented. The RemoveObserver method checks that the variable is
equal to zero. This ensures that no observer is removed while
dispatching notifications (which could cause a use-after-free).
For reference, the implementations of
FieldTrialList::Observer::OnFieldTrialGroupFinalized are:
base/android/field_trial_list.cc:
LOG(INFO) is thread-safe
base/metrics/field_trial_unittest.cc:
The test is single-threaded.
components/variations/child_process_field_trial_syncer_unittest.cc:
The test is single-threaded.
components/variations/variations_crash_keys.cc:
The observer checks whether it runs on the UI thread and
forwards the notification to the UI thread if it's not the case.
components/variations/variations_ids_provider.cc:
The observer uses a lock.
content/browser/field_trial_synchronizer.cc:
The observer checks whether it runs on the UI thread and
forwards the notification to the UI thread if it's not the case.
content/browser/net/network_field_trial_browsertest.cc
RunLoop::Quit() is thread-safe.
content/child/child_thread_impl.cc
A mojo::SharedRemote is thread-safe.
Bug: 1193750
Change-Id: I0144d3262fca360fbd2a48580e322428510f91d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2785140
Auto-Submit: François Doray <fdoray@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#870762}
This allows it to be shared by Chrome, WebLayer and WebView. For Chrome
this functionality is tested by VariationsHttpHeadersBrowserTest.
To support this a VariationsClient has been added, with an accessor on
BrowserContext, which allows the variations code to tell if the user is
signed in (some of the variations header logic needs to know this).
Bug: 1025612
Change-Id: Ibb5a0dd54e23a3536de4c0fb84624173a6974262
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1967245
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745404}