0
Commit Graph

22 Commits

Author SHA1 Message Date
Lei Zhang
637c755447 Delete unused notification includes
Remove notification includes for files that do no use //content
notification code.

Bug: 268984
Change-Id: I8a037b4d12c6b1cb28ae2fa09e560f427d94aba9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4923372
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1209140}
2023-10-12 22:54:15 +00:00
Ho Cheung
9722cbb523 [content] [browser] More base::Contains() usage in //content/browser
1. Use base::Contains() instead of std::find or <container>::find()
where appropriate in //content/browser.

2. Refactor some code to enhance performance when executing the code.

3. The remaining code that needs to be modified in the //content/browser
directory will be modified in subsequent patches.

AX-Relnotes: n/a
Bug: 561800
Change-Id: Ibf6b4f7919256484826dfeb73859e23185579061
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4845751
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Ho Cheung <uioptt24@gmail.com>
Cr-Commit-Position: refs/heads/main@{#1193668}
2023-09-07 17:36:51 +00:00
Peter Kasting
e428e569a3 Use thread_local: content/browser/
Bug: 1416710
Change-Id: Icc8cfb6fa73ff722e85a1c95bb08fdbf5d6be3b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4317406
Reviewed-by: Charlie Reis <creis@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1114560}
2023-03-08 16:12:59 +00:00
Kevin McNee
cdc7e9f089 Remove NotificationService's NOTIFICATION_ALL signal value
NOTIFICATION_ALL notifies the observers using this type whenever a
notification of any type occurs. There is only one test usage of this
type which is essentially implementing a busy-wait.

We update the test to use a meaningful observer and remove
NOTIFICATION_ALL and its supporting code.

Bug: 170921
Change-Id: I7c6628089a9df874b7e139239d95602744383a7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3975873
Reviewed-by: Daniel Rubery <drubery@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1063347}
2022-10-25 16:24:19 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
David Sanders
d4bf5ebdc1 Add missing includes of //base/observer_list.h
Bug: 1290552
Change-Id: Ie1fa4ea6029177254548535fe09a1aefbe66e13e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3529861
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#982061}
2022-03-17 07:12:05 +00:00
Mitsuru Oshima
69031e66f0 Migrate might_have_observers to empty in content/
Bug: 1155308

Change-Id: I05d8df24fabbd9c62b1228052aadf69d92f34699
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2598757
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845212}
2021-01-20 18:01:58 +00:00
Hans Wennborg
8c90236df2 Include-what-you-use related to logging.h (content)
Add direct includes for things provided transitively by logging.h
(or by other headers including logging.h).

This is in preparation for cleaning up unnecessary includes of
logging.h in header files (so if something depends on logging.h,
it needs include it explicitly), and for when logging.h no longer
includes check.h, check_op.h, and notreached.h.

Bug: 1031540
Change-Id: I0c69dcf8d27d25b30d4e211bce41f80de70d110b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2248575
Auto-Submit: Hans Wennborg <hans@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779560}
2020-06-18 00:06:21 +00:00
jdoerrie
55ec69dc51 [clang-tidy] Apply modernize-use-auto in /content/browser
This change applies clang-tidy's modernize-use-auto [1] in /content/browser.
This change does not rewrite new and cast expressions.

Reproduction steps:
- run clang-tidy's modernize-use-auto
- run git cl format
- manually remove unused typedefs due to -Wunused-local-typedef error

[1] https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html

This CL was uploaded by git cl split.

R=boliu@chromium.org, mkwst@chromium.org

Bug: 890902
Change-Id: I06146497aa7a8cba7516eb17497ca33454141b2a
Reviewed-on: https://chromium-review.googlesource.com/c/1257909
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597544}
2018-10-08 13:34:46 +00:00
John Abd-El-Malek
63ff5f3abd Make URLLoaderInterceptor work before profiles are created.
This also makes it intercept all profiles' frame requests, which is more consistent with how
it sniffs all profiles' subresources.

Bug: 776589
Change-Id: I7b53f3f370b4d70e0335801a5b19f5b59be715a3
Reviewed-on: https://chromium-review.googlesource.com/831246
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Doug Turner <dougt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524829}
2017-12-18 22:14:58 +00:00
John Abd-El-Malek
a796fa5605 Fix session restore with network service.
This involved:
-persisting cookies with network service
-converting the browser tests to work with the network service

Bug: 789644, 769401, 776589
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I70320d5550e433049a910c64f055c1809aecbff1
Reviewed-on: https://chromium-review.googlesource.com/818486
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523462}
2017-12-12 17:12:32 +00:00
Ivan Kotenkov
2c0d2bb3fe Convert 0 to nullptr in content using clang-tidy.
Bug: 778942
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Iee6be84c23149c745b3afd6e6158764f92ccd17f
Reviewed-on: https://chromium-review.googlesource.com/732305
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Ivan Kotenkov <kotenkov@yandex-team.ru>
Cr-Commit-Position: refs/heads/master@{#513138}
2017-11-01 15:41:28 +00:00
scottmg
5e65e3a4fb Require explicit selection of traits for LazyInstance
This change requires the user of LazyInstance to explicitly select
either ::DestructorAtExit or ::Leaky. It seems clear that many users of
LazyInstance have just gone with default and are either unaware or
didn't consider that the default requires running an AtExit at process
shutdown.

As a first step, make this choice explicit, and update current users
to be ::DestructorAtExit to maintain current behaviour. Follow ups can
then attempt to consider individual switches from DestructorAtExit to
Leaky including reviewers with domain-specific knowledge.

i.e. No intended behaviour change from this CL.

R=thakis@chromium.org

Lots of TBRs for mechanical changes:
boliu: android_webview/
danakj: cc/
dmurph: storage/
jam: content/ ipc/, mojo/
jbauman: gpu/
jochen: gin/
oshima: chromeos/
raymes: ppapi/
rdevlin.cronin: extensions/
rockot: device/, services/
rogerta: google_apis/
rsleevi: net/, crypto/
sdefresne: components/, ios/
sergeyu: jingle/
slan: chromecast/
thakis: base/, chrome/, third_party/, tools/, ui/
vitalybuka: printing/
wez: remoting/

TBR=above
BUG=698982
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_site_isolation;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2733283002
Cr-Commit-Position: refs/heads/master@{#455405}
2017-03-08 08:48:46 +00:00
ericwilligers
254597bee9 Reduce usage of FOR_EACH_OBSERVER macro in content/browser
Observer lists now support range-based for loops.

BUG=655021
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2422923002
Cr-Commit-Position: refs/heads/master@{#425648}
2016-10-17 10:35:20 +00:00
caitkp@chromium.org
5e362e4700 Switch ObserverList::size() to ObserverList::might_have_observers() Pt.1
This is in preparation for making ObserverList::size() protected (see bug for details).

BUG=278526
TEST=no change
TBR=darin@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23190045

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219580 0039d316-1c4b-4281-b951-d872f2087c98
2013-08-26 19:15:33 +00:00
tfarina@chromium.org
1a81639364 content/browser: Move notification_service_impl into content namespace.
R=jam@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164793 0039d316-1c4b-4281-b951-d872f2087c98
2012-10-30 00:30:09 +00:00
sail@chromium.org
d9c2e51c51 Revert 164120 - content/browser: Move more files into the content namespace.
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

TBR=tfarina@chromium.org
Review URL: https://codereview.chromium.org/11273049

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164122 0039d316-1c4b-4281-b951-d872f2087c98
2012-10-25 18:54:36 +00:00
tfarina@chromium.org
7a91c555f3 content/browser: Move more files into the content namespace.
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
2012-10-25 18:44:52 +00:00
leng@google.com
1fa6de0736 Delete empty NotificationObserverLists. Fixes leak.
BUG=None
TEST=None


Review URL: https://chromiumcodereview.appspot.com/10546025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141010 0039d316-1c4b-4281-b951-d872f2087c98
2012-06-07 15:31:40 +00:00
tfarina@chromium.org
60dc931194 Hide the process of instantiating NotificationServiceImpl from embedders.
Make NotificationService handle the process of instantiating NotificationServiceImpl instead.

BUG=98716
R=jam@chromium.org
TBR=akalin@chromium.org

Review URL: http://codereview.chromium.org/8913009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114454 0039d316-1c4b-4281-b951-d872f2087c98
2011-12-14 18:17:22 +00:00
joth@chromium.org
6de0fd1d93 Allow linker initialization of lazy instance
Using the initializer list construct = {0} allows the object to be linker initialized.
Modify the LazyInstance class design to make it a pod aggregate type that can be linker initialized this way. Also combines the instance and state members, in line with the Singleton<> class design.
Introduces a new LAZY_INSTANCE_INITIALIZER macro specifically for using to init all lazy instances + modify all existing callsites to use it. (Old code would no longer compile)

BUG=94925
TEST=existing tests pass. http://build.chromium.org/f/chromium/perf/linux-release/sizes/report.html?history=150&header=chrome-si&graph=chrome-si&rev=-1 should step downward.
TBR=jam@chromium.org,rvargas@chromium.org,darin@chromium.org,ben@chromium.org,apatrick@chromium.org,akalin@chromium.org

Review URL: http://codereview.chromium.org/8491043

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110076 0039d316-1c4b-4281-b951-d872f2087c98
2011-11-15 13:31:49 +00:00
jam@chromium.org
ad50def5e1 Make NotificationService an interface in the content namespace, and switch callers to use it. Move the implementation to content/browser. Stop creating it in all child processes since it's only used in the browser.
BUG=98716
Review URL: http://codereview.chromium.org/8342048

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106403 0039d316-1c4b-4281-b951-d872f2087c98
2011-10-19 23:17:07 +00:00