0
Commit Graph

32 Commits

Author SHA1 Message Date
Eric Roman
1c82b994fe Convert ProxyResolutionServiceProvider to use Network Service.
This also updates the mojo ProxyLookupClient interface to include the network error code on failure, as the D-Bus services expects to have this error information.

Bug: 921814
Change-Id: Ic1a240e72cffc7d8d708d150d139f32cfb7d1816
Reviewed-on: https://chromium-review.googlesource.com/c/1419264
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Robbie McElrath <rmcelrath@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624371}
2019-01-19 00:09:40 +00:00
Matt Menke
fd1dcf691e Fix object lifetime bug in ResolverProxyMsgHelper::OnProxyLookupComplete
It needs to hold onto a reference to itself until the end of the method,
instead of just until its HasOneRef() check has completed.

Bug: 907524
Change-Id: I75fab97b07fe55f30a6a7c6def390f5d0bc28c4f
Reviewed-on: https://chromium-review.googlesource.com/c/1352684
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611920}
2018-11-28 23:06:59 +00:00
tzik
4746202fca Add missing noexcept specifiers to move ctors and assigns
The declarations of move ctors and assigns of
DisjointRangeLockManager::LockRequest, ScopesLockManager::ScopeLock and
ResolveProxyMsgHelper::PendingRequest have `noexcept` specifier, but
their implementations don't. This is OK in C++14, but causes compile
errors in C++17.

This CL adds missing `noexcept` for them.

Bug: 752720
Change-Id: I849f613c63c990afd23c590a9567069b772146d1
Reviewed-on: https://chromium-review.googlesource.com/1175656
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583319}
2018-08-15 18:00:37 +00:00
Matt Menke
5491b00753 Fix double-delete in ResolveProxyMsgHelper.
The class is reference counted, and makes a mojo call, with a callback,
on the UI thread. The callback was passed a raw pointer to the class,
but when it was invoked, it grabbed a reference to the class. When the
class's last reference is released, it posts a delete task to the UI
thread.

So if the class's last reference was released, and then it received a
a Mojo callback, there would be a pending delete task, we'd grab a
new ref (Increasing the refcount from 0 to 1), the delete task would
run, and then a new delete task would be posted when the reference went
to 0 again, resulting in a double-delete.

This CL fixes that by making the class keep a reference to itself
whebever there's a pending mojo callback. MessageFilters are designed
to be able to call Send() after the class they want to send messages
to has been deleted, so the increased lifetime is completely safe.

Bug: 870675
Change-Id: I64f6656e61dc9222a67cd40555d3dd73fb48e208
Reviewed-on: https://chromium-review.googlesource.com/1161967
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580932}
2018-08-06 18:46:01 +00:00
Matt Menke
4dfa217e96 Add proxy look up API to NetworkContexts, convert PPAPI consumers.
The only code outside of net/ / services/network that does direct proxy
resolutions appears to be the two PPAPI consumers. This CL updates them
both to use the new API.

Bug: 810950
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: I643605dfe2d8b67626ea8b84ee793b2c88b66e12
Reviewed-on: https://chromium-review.googlesource.com/1136875
Reviewed-by: Eric Roman <eroman@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580195}
2018-08-02 15:27:47 +00:00
Lily Houghton
0e9a499d1a Reland "Change ProxyResolutionService API to use std::unique_ptr<Request> instead of raw pointers."
This is a reland of 2ae89dce12

Original change's description:
> Change ProxyResolutionService API to use std::unique_ptr<Request> instead of raw pointers.
> 
> Bug: 479898
> Cq-Include-Trybots: luci.chromium.try:linux_mojo
> Change-Id: I3d1b89fc33ebae27f6ab4007eceffb9eb6134ef6
> Reviewed-on: https://chromium-review.googlesource.com/887598
> Commit-Queue: Matt Menke <mmenke@chromium.org>
> Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
> Reviewed-by: Bo <boliu@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#578436}

Bug: 479898
Change-Id: Id5684b743d27a0edf4d436beb113e37e32a70b89
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Reviewed-on: https://chromium-review.googlesource.com/1152567
Commit-Queue: Lily Houghton <lilyhoughton@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579208}
2018-07-30 22:40:37 +00:00
Scott Violet
dd49b6ee6a Revert "Change ProxyResolutionService API to use std::unique_ptr<Request> instead of raw pointers."
This reverts commit 2ae89dce12.

Reason for revert: net_unittests seems to be consistently failing after your patch landed. First failure is here: https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/ios-simulator/35922 . net_unittests hangs when it gets to MultiThreadedProxyResolverTest.CancelCreate

Original change's description:
> Change ProxyResolutionService API to use std::unique_ptr<Request> instead of raw pointers.
> 
> Bug: 479898
> Cq-Include-Trybots: luci.chromium.try:linux_mojo
> Change-Id: I3d1b89fc33ebae27f6ab4007eceffb9eb6134ef6
> Reviewed-on: https://chromium-review.googlesource.com/887598
> Commit-Queue: Matt Menke <mmenke@chromium.org>
> Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
> Reviewed-by: Bo <boliu@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#578436}

TBR=stevenjb@chromium.org,sky@chromium.org,eroman@chromium.org,boliu@chromium.org,mef@chromium.org,mmenke@chromium.org,lilyhoughton@chromium.org

Change-Id: I17026b358225cc01884be96ca5b69dcd9f885e5d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 479898
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Reviewed-on: https://chromium-review.googlesource.com/1152368
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578474}
2018-07-26 23:06:45 +00:00
Lily Houghton
2ae89dce12 Change ProxyResolutionService API to use std::unique_ptr<Request> instead of raw pointers.
Bug: 479898
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: I3d1b89fc33ebae27f6ab4007eceffb9eb6134ef6
Reviewed-on: https://chromium-review.googlesource.com/887598
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578436}
2018-07-26 21:01:54 +00:00
tzik
2ce14ce55c Apply base_bind_rewriters to //content
This CL applies the refactoring tool in //tools/clang/base_bind_rewriters
to //content, that rewrites base::Bind to base::BindOnce where mechanically
doable.

Change-Id: Ibc6e9d7c9e6374c4b9390a20ad4d2333f011f2a7
Reviewed-on: https://chromium-review.googlesource.com/1149773
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kim Paulhamus <kpaulhamus@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578211}
2018-07-26 05:17:18 +00:00
Lily Houghton
8c2f97d546 Rename ProxyService class to ProxyResolutionService
TBR=bolio@chromium.org,mmenke@chromium.org,gene@chromium.org,halliwell@chromium.org,stevenjb@chromium.org,bengr@chromium.org,alexmos@chromium.org,mkwst@chromium.org,sky@chromium.org,reillyg@chromium.org,dimich@chromium.org,skyostil@chromium.org,eugenebut@chromium.org,garykac@chromium.org

Bug: 613637
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.linux:linux_mojo;master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ie296831e1bcb402274e416d85fab43f5f2db5e49
Reviewed-on: https://chromium-review.googlesource.com/857421
Commit-Queue: Lily Houghton <lilyhoughton@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530810}
2018-01-22 05:06:59 +00:00
Lily Houghton
00e124d42c Rename net::Proxy::PacRequest to net::Proxy::Request
TBR=raymes@chromium.org
TBR=dimich@chromium.org
TBR=yhirano@chromium.org
TBR=boliu@chromium.org

Bug: 613640
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I0841e8cd01a1eb970327a8a6247efac20ba734eb
Reviewed-on: https://chromium-review.googlesource.com/847460
Commit-Queue: Lily Houghton <lilyhoughton@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529071}
2018-01-12 21:40:39 +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
mikecirone
f22f981b84 Main benefits of NetLog inner classes extraction:
- Greater code organization.
- Promotion of files being "include-what-you-use" clean. Less files now need
  to include "net_log.h"; these files are no longer susceptible to having their
  includes hidden by the many inner includes of "net_log.h".
- All touched files are also now forward-clean re: NetLog,
  NetLogCaptureMode and the new, extracted classes.

Here is the new structuring:
  - NetLogSource (net_log_source.h/.cc)
  - NetLogEntry, NetLogEntryData (net_log_entry.h/.cc)
  - NetLogWithSource (net_log_with_source.h/.cc)

***Did not extract NetLog::ThreadSafeObserver into its own class since
   NetLog::ThreadSafeObserver and NetLog are interrelated enough to keep
   NetLog::ThreadSafeObserver as an inner class.

Further Notes:
1) On top of scripting, all files were checked manually, ensuring:
     - Forwards/including added only when appropriate. No extras added.
     - "net_log.h" include removals done correctly. No "net_log.h"-hiding
       to occur as a result of new changes.

2) Just as any .cc file will not do the include/forward if the paired .h file
   already has the include/forward, *_unittests.cc, *_browsertest.cc and
   *_test.cc files exhibit the same behavior when they have a paired .h file.

3) Override methods' types do not add to logic for inserting forwards, since it
   is guaranteed that the base class has the forward.
     - Saw this done in codebase several times, so making sure to
       follow the same rule.

4) A big change was the mass adjustment for the include-hiding of
   NetLogCaptureMode by net_log.h includes. Now the NetLogCaptureMode class is
   being properly forwarded/included in all files changed by the original
   NetLog inner classes extraction work.

5) Many NetLog/NetLogWithSource includes/forwards were added across codebase.
   All instances of files seeing their NetLog/NetLogWithSource include/forward
   being hidden by their own includes should now be gone. This is to promote
   greater flexibility in future changes upon the codebase.

BUG=473710
R=eroman@chromium.org,tfarina@chromium.org
TBR=droger@chromium.org, hirono@chromium.org, rdevlin.cronin@chromium.org, skyostil@chromium.org, wez@chromium.org, juliatuttle@chromium.org, sergeyu@chromium.org, dgozman@chromium.org, hubbe@chromium.org, rdsmith@chromium.org, stevenjb@chromium.org, scheib@chromium.org, bengr@chromium.org, alokp@chromium.org, raymes@chromium.org, samuong@chromium.org, creis@chromium.org, scottbyer@chromium.org, zea@chromium.org, mmenke@chromium.org, eranm@chromium.org

Review-Url: https://codereview.chromium.org/2333923004
Cr-Commit-Position: refs/heads/master@{#422691}
2016-10-04 03:43:13 +00:00
tfarina
4283411131 net: rename BoundNetLog to NetLogWithSource
Patch generated by the following command line:

$ g grep -l BoundNetLog | xargs perl -pi -e 's/BoundNetLog/NetLogWithSource/g'

BUG=475260
TEST=net_unittests
R=eroman@chromium.org
TBR=dtrainor,thestig,oshima,sdefresne,avi,rockot,rogerta,sergeyu

Review-Url: https://codereview.chromium.org/2351513002
Cr-Commit-Position: refs/heads/master@{#420320}
2016-09-22 13:40:49 +00:00
ryansturm
7bd591a9c4 Removing load_flags from ProxyService and ProxyDelegate
load_flags used to be used in DataReductionProxyDelegate to resolve the
proxy, but it no longer does. load_flags should not be needed to resolve
a proxy for a request.

load_flags was previously used for the CriticalPathBypassFieldTrial:

db1198c532%5E%21/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc

BUG=

Review-Url: https://codereview.chromium.org/2110973002
Cr-Commit-Position: refs/heads/master@{#406112}
2016-07-18 22:02:57 +00:00
ryansturm
4bab0683f1 Bypass the DataReductionProxy for all POST requests
POST requests are non-dempotent, so clients using the Data Reduction Proxy (DRP) can often end up at an error page due to the fact that if the DRP has any problems connecting to the origin, DRP and the client will not be safely able to determine if the post successfully made it to the server. The impact of this change on data compression should be very limited, and it will improve the client's experience.

BUG=581750

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

Cr-Commit-Position: refs/heads/master@{#379137}
2016-03-03 23:43:53 +00:00
rcs@chromium.org
a702da7952 Add Finch experiment for selectively bypassing proxies.
Add option to bypass the data compression proxy if the request resource
type (as inferred by the renderer process) is not an image.

For background, see this design doc:

https://docs.google.com/a/google.com/document/d/1Kz92Fmw3lv_R-2aNvLp8jW9lkfKOZciTZtni2qQ_Adc/edit

BUG=391836

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281951 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-09 05:23:54 +00:00
jam@chromium.org
e44d13473d Remove IPC_BEGIN_MESSAGE_MAP_EX macro since r270839 made all bad IPCs kill their child processes.
R=avi@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271096 0039d316-1c4b-4281-b951-d872f2087c98
2014-05-16 21:29:33 +00:00
jdduke@chromium.org
b51352abcd Allow MessageFilters to restrict listening to specific message classes
ChannelProxy currently offers messages to all member MessageFilters.  It turns
out that a good portion of the most common message types will never be filtered,
making the O(N) filter walk an unnecessary affair.  To prevent this, allow
MessageFilters to indicate which (if any) subset of message classes they may
filter, allowing the ChannelProxy to refine the list of filters that are offered
a particular message.  This saves ~35us per message received on the browser IO
thread for a typical Android device.

Relanding with a few more guards for MessageFilter removal, access and message
class subscription.

BUG=340881
TBR=asargent@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253361 0039d316-1c4b-4281-b951-d872f2087c98
2014-02-26 05:18:04 +00:00
jdduke@chromium.org
da2c4ffa21 Revert "Allow MessageFilters to restrict listening to specific message classes"
This reverts commit 2955e4e3c7.

Reason for revert: Frequent crashes on Windows.

BUG=345368
TBR=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252428 0039d316-1c4b-4281-b951-d872f2087c98
2014-02-21 00:13:23 +00:00
jdduke@chromium.org
2955e4e3c7 Allow MessageFilters to restrict listening to specific message classes
ChannelProxy currently offers messages to all member MessageFilters.  It turns
out that a good portion of the most common message types will never be filtered,
making the O(N) filter walk an unnecessary affair.  To prevent this, allow
MessageFilters to indicate which (if any) subset of message classes they may
filter, allowing the ChannelProxy to refine the list of filters that are offered
a particular message.  This saves ~35us per message received on the browser IO
thread for a typical Android device.

BUG=340881
TBR=asargent@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251622 0039d316-1c4b-4281-b951-d872f2087c98
2014-02-16 22:11:26 +00:00
rsleevi@chromium.org
fc72bb18b1 Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*"
Linux fixes

BUG=110610
TBR=darin

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203624 0039d316-1c4b-4281-b951-d872f2087c98
2013-06-02 21:13:46 +00:00
erg@chromium.org
59383c78c7 Cleanup: Remove unnecessary ".get()" from scoped_ptrs<>.
In r174057, ajwong@ added support for implicit testing to scoped_ptr<>. Removes
these in content/.

BUG=232084

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194608 0039d316-1c4b-4281-b951-d872f2087c98
2013-04-17 16:43:27 +00:00
jam@chromium.org
464883218e Move remaining files in content\browser to the content namespace.
Review URL: https://codereview.chromium.org/11340029

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164828 0039d316-1c4b-4281-b951-d872f2087c98
2012-10-30 03:22:20 +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
rsleevi@chromium.org
fb90c94fa3 RefCounted types should not have public destructors, content/browser part 1
BUG=123295
TEST=none


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134395 0039d316-1c4b-4281-b951-d872f2087c98
2012-04-27 23:40:50 +00:00
jhawkins@chromium.org
2357868189 base::Bind: Convert net/proxy.
BUG=none
TEST=none
R=csilv

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115068 0039d316-1c4b-4281-b951-d872f2087c98
2011-12-20 02:15:31 +00:00
jam@chromium.org
2dd868ff64 Stop using the default profile's proxy service for plugin proxy requests, and instead use the associated profile's proxy service. I proxy the IPC through the renderer first, as that makes it easy to get to the associated profile.
BUG=92361,64339
Review URL: http://codereview.chromium.org/7791005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98728 0039d316-1c4b-4281-b951-d872f2087c98
2011-08-29 23:03:57 +00:00
avi@chromium.org
b68bf389d1 Removal of Profile from content part 9 of 9.
BUG=76788
TEST=no change visible

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97861 0039d316-1c4b-4281-b951-d872f2087c98
2011-08-23 15:03:58 +00:00
willchan@chromium.org
9abfa1903f Deprecate Profile::GetDefaultRequestContext().
Make it private and establish a friend whitelist for existing users.

BUG=64339
TEST=none


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93200 0039d316-1c4b-4281-b951-d872f2087c98
2011-07-20 15:48:53 +00:00
jam@chromium.org
97e6c4c608 Get rid of chrome dependencies from PluginProcessHost by moving dispatching of chrome specific messages to a chrome IPC filter.
Review URL: http://codereview.chromium.org/7036025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85767 0039d316-1c4b-4281-b951-d872f2087c98
2011-05-18 16:08:51 +00:00