0
Commit Graph

1943 Commits

Author SHA1 Message Date
875dd0da93 [bfcache] Update IPC hash setting functionality in mojo and add unit tests + browser test for IPC tracking to frames in cache
Currently, IPC hash isn't set for tasks posted on the IO thread; adding IPC to SimpleWatcher when tasks are posted allows for the task posted on the IO thread to be annotated with an IPC hash, so that it can then be tracked in the histograms. ScopedSetIpcHash changes are to allow for tracking of IPCs posted from remote mojo objects. However, calculating the MD5 hash of a char* on every posted task is expensive, so we have also introduced storage of the IPC interface name. The IPC interface name can be used to calculate IPC hash on an as-needed basis (i.e. only in cases where IPC is posted to cached frames/documents).

Also includes histogram testing to ensure metrics are recorded. and how ScopedSetIpcHash is set.

Bug: 1110344
Change-Id: I26da160b65145f06639c33679ff03872f686e4af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2345673
Commit-Queue: Harkiran Bolaria <hbolaria@google.com>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807106}
2020-09-15 18:10:46 +00:00
7d89ef09a7 Remove set_sources_assignment_filter from //ipc
set_sources_assignment_filter() is considered as a mis-feature
of gn (as it makes it difficult to reason about the BUILD.gn
files individually).

Bug: 1018739
Change-Id: I78aa860978a9d6426974b4f057fbc166b892a436
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2409904
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806978}
2020-09-15 11:26:44 +00:00
f2c0525bea Clarify null IPC listener support for ChannelProxy
Bug: N/A
Change-Id: I5bb8e59f3a4cf8229bb389636f24243e6b98b64d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2393558
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805035}
2020-09-08 19:59:25 +00:00
408a56a8d8 Change how oversized IPCs are handled
Rather than CHECK-failing before transmitting a message, this adds a
DumpWithoutCrashing at serialization time. This will preserve useful
crash stacks to identify offending messages but will no longer result
in the poor user experience of crashing processes, including the
browser.

Fixed: 1098442
Change-Id: I638410f4787e833e9cb92573f26e9e7167d1bec7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2365852
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800622}
2020-08-21 17:24:01 +00:00
82700410f1 Refactor OS_LINUX preprocessor directive for LaCrOS effort.
Currently, ChromeOS defines the OS_LINUX directive as well as
OS_CHROMEOS.  We're working to separate these two, so we're
making the fact that OS_LINUX == OS_LINUX || OS_CHROMEOS
explicit.

Bug: 1110266
Change-Id: Ibf45218c1ba6a609714ba80ee2d7bae28e929f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352689
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Jonathan Backer <backer@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Sean McAllister <smcallis@google.com>
Cr-Commit-Position: refs/heads/master@{#799767}
2020-08-19 20:10:35 +00:00
4b7b326560 Convert SyncHandleRegistry to use a CallbackList.
This changes the API to look like CallbackList's: instead of calling
UnregisterEvent(), callers destroy a subscription object they get from
registering.  This is a bit easier for callers to deal with.  However,
the necessity of also synchronously clearing the event from the WaitSet
makes the implementation a bit irritating, since while CallbackList does
provide a hook to be called back on callback removal, that happens after
notification is finished, rather than right at subscription destruction.
Instead of using the hook, wrap the CallbackList::Subscriptions in an
object that will also remove the WaitSet item if need be.

Bug: none
Change-Id: Ideb74b1435bfaad1647324e5ba5f90976c268e2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343956
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#796728}
2020-08-11 07:18:24 +00:00
2b97d03ae6 Migrate to OS_MAC and OS_APPLE in ipc
Bug: 1105907
Change-Id: I0ace11a629d0347041f7233476a8e4d9a12174d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2325093
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793006}
2020-07-30 03:02:26 +00:00
679a2a2d59 Remove unnecessary foo_interface_[ptr|request].h uses
This CL cleans up unnecessary uses of below header files,

  - interface_ptr.h
  - interface_request.h
  - threadsafe_interface_ptr.h
  - associated_interface_ptr.h

Bug: 955171, 1035484
Change-Id: I8a157f618b6bb100f212fe35cf437f3864aa6dda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2280870
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#786184}
2020-07-08 06:26:09 +00:00
5e23e59858 [mojo] Fix sync calls on SharedRemote
This fixes some edge cases which can cause SharedRemote to either block
unnecessarily on its bound sequence or fail to block as intended on its
bound sequence, depending on how it's constructed and called into.

We want to repurpose the underlying Remote's sync waiting behavior when
the SharedRemote makes a sync call from the bound sequence, but when a
call is made from any other sequence, the SharedRemote must implement
its own waiting mechanism.

This change ensures that SharedRemote configures its underlying Remote
to disable sync waiting by default, and it's selectively re-enabled only
around any (potentially nested) sync calls made from the bound sequence.

Fixed: 1102921
Change-Id: I603e48e38d859c43d7b732a91445314714ea0591
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2286051
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786180}
2020-07-08 06:06:34 +00:00
a4bc40df56 [mac] Mojofy TextInputClientMsg_StringForRange
This CL replaces TextInputClientMsg_StringForRange and
TextInputClientReplyMsg_StringForRange IPC messages with
GetStringForRange Mojo method in the LocalFrame interface.
GetStringForRange gets a range and returns the word in the range.

It cleans up text_input_client_observer.{cc,h} and
text_input_client_message_filter.{cc,h} and replaces
TestTextInputClientMessageFilter with TextInputTestLocalFrame
to support testing GetStringForRange.

Bug: 1007365
Change-Id: I7ef37d71e1642cc4c05e1f942d97acc1ea1e4cd9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2269628
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#785645}
2020-07-07 10:13:15 +00:00
36155b58a6 [prerender] Convert PrerenderHostMsg_PrefetchFinished to mojo
This CL converts PrerenderHostMsg_PrefetchFinished to FrameHost
Mojo message and removes the unused PrerenderMessageFilter.

Bug: 798712
Change-Id: I72721a011ebfb9951f4e7c01a96e09139f3c5e48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2256116
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Darin Fisher <darin@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#783862}
2020-06-30 08:10:14 +00:00
e3603209aa Reland "Remove/replace unnecessary includes of logging.h (ipc/)"
This reverts commit 6cd7338983.

Reason for revert: re-landing as this was a wrong suspect.

Original change's description:
> Revert "Remove/replace unnecessary includes of logging.h (ipc/)"
> 
> This reverts commit 26d8327229.
> 
> Reason for revert: suspected cause of build failure on linux (https://ci.chromium.org/p/chromium/builders/ci/linux-ozone-rel/124191)
> 
> Original change's description:
> > Remove/replace unnecessary includes of logging.h (ipc/)
> > 
> > If the file just needs the CHECK/CHECK_OP/NOTREACHED
> > macros, use the appropriate header for that instead.
> > Or if logging.h is not needed at all, remove it.
> > 
> > This is both a nice cleanup (logging.h is a big header,
> > and including it unnecessarily has compile-time costs),
> > and part of the final step towards making logging.h no
> > longer include check.h and the others.
> > 
> > Bug: 1031540
> > Change-Id: Ic0d59407e28200355332852d290f18441d6f678e
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2253980
> > Auto-Submit: Hans Wennborg <hans@chromium.org>
> > Commit-Queue: Tom Sepez <tsepez@chromium.org>
> > Reviewed-by: Tom Sepez <tsepez@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#780828}
> 
> TBR=hans@chromium.org,tsepez@chromium.org
> 
> Change-Id: I780f92bca95aabcc845393ed4635e837e47aeb50
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1031540
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2257738
> Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
> Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#780846}

TBR=hans@chromium.org,caseq@chromium.org,tsepez@chromium.org

# Not skipping CQ checks because this is a reland.

Bug: 1031540
Change-Id: Ifd1f23d43442644071f610e9a1432d97714779e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2257565
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780914}
2020-06-22 19:41:45 +00:00
6cd7338983 Revert "Remove/replace unnecessary includes of logging.h (ipc/)"
This reverts commit 26d8327229.

Reason for revert: suspected cause of build failure on linux (https://ci.chromium.org/p/chromium/builders/ci/linux-ozone-rel/124191)

Original change's description:
> Remove/replace unnecessary includes of logging.h (ipc/)
> 
> If the file just needs the CHECK/CHECK_OP/NOTREACHED
> macros, use the appropriate header for that instead.
> Or if logging.h is not needed at all, remove it.
> 
> This is both a nice cleanup (logging.h is a big header,
> and including it unnecessarily has compile-time costs),
> and part of the final step towards making logging.h no
> longer include check.h and the others.
> 
> Bug: 1031540
> Change-Id: Ic0d59407e28200355332852d290f18441d6f678e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2253980
> Auto-Submit: Hans Wennborg <hans@chromium.org>
> Commit-Queue: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#780828}

TBR=hans@chromium.org,tsepez@chromium.org

Change-Id: I780f92bca95aabcc845393ed4635e837e47aeb50
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1031540
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2257738
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780846}
2020-06-22 17:15:18 +00:00
26d8327229 Remove/replace unnecessary includes of logging.h (ipc/)
If the file just needs the CHECK/CHECK_OP/NOTREACHED
macros, use the appropriate header for that instead.
Or if logging.h is not needed at all, remove it.

This is both a nice cleanup (logging.h is a big header,
and including it unnecessarily has compile-time costs),
and part of the final step towards making logging.h no
longer include check.h and the others.

Bug: 1031540
Change-Id: Ic0d59407e28200355332852d290f18441d6f678e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2253980
Auto-Submit: Hans Wennborg <hans@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780828}
2020-06-22 16:54:58 +00:00
cd23f75e19 Clean up non-inclusive language in //mojo and //ipc
Replaces use of the term "master" with "primary" in the context of
associated interfaces, referring to the primary interface which owns and
operates on a pipe.

Also replaces the only other use (a reference to relative importance of
a process within a hierarchy) with "root", which is both more inclusive
and more appropriate in context.

Bug: 1097211
Change-Id: I0bd43e093b20e61bc4f15c34d2bcb82867705975
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2255206
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780538}
2020-06-20 01:22:31 +00:00
2439759cde Include-what-you-use related to logging.h (ipc)
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.

TBR=kinuko

Bug: 1031540
Change-Id: I11f6bd375b17f0d62f50c960756c07dd20d102e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247895
Commit-Queue: Hans Wennborg <hans@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#779370}
2020-06-17 16:58:50 +00:00
2d8d780297 Modernize base::Value usage in IPC message utils.
Prefer using value-based instead of unique_ptr-based APIs where it is
not too intrusive. Use the new representation to more efficiently
translate list and dictionary values (per the documented
recommendations). Replace CreateWithCopiedBuffer with construction from
a span.

base::PickleIterator was augmented with a span-of-bytes ReadData API, to
make this a little cleaner, since this is now preferred over a pair of a
const char* and length.

Bug: 646113
Change-Id: I6361bfffe65e2d84aa8d50390648bb7ac194f205
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2241936
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#777516}
2020-06-11 22:08:20 +00:00
85a081bc9b Cleanup usages of old mojo types and remove unused code
In the context of the migration started last year to migrate all the
uses of old mojo types to the new ones, today I've found that there
were a few bits that we could remove and either migrate easily or
outright remove them, now that nearly all the instances of those old
types have been migrated.

Therefore, this CL does a "sweep" and does the following cleanups in
different places, so that we get closer to the point where no old types
are present:

* Migrate uses of old types to the new ones in a couple of places where
  they were not migrated (i.e. MockChromePrompt, TestService).
* Remove unused templated methods from //ipc still using old types.
* Remove unused Interface{Ptr,Request} variants of helper methods
  Connector::BindInterface(), InterfaceProvider::GetInterface() and
  LocalInterfaceProvider::GetInterface().
* Remove unused includes for header files related to old mojo types.
* Delete strong_associated_binding_set.h (not even being compiled).

TBR=blundell@chromium.org,halliwell@chromium.org,achuith@chromium.org,achuith@chromium.org,kinuko@chromium.org

Bug: 955171
Change-Id: Ia4ca6f3f68bc1d6d4fd4016ed16c07ff132ea19f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2235699
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#777288}
2020-06-11 08:20:43 +00:00
df0fc8a1ed Convert NULL to nullptr or shorten to bool-like expression
https://google.github.io/styleguide/cppguide.html#0_and_nullptr/NULL
says:
"For pointers (address values), use nullptr, as this provides
type-safety."
Furthermore, NULL/0 won't compile if we change |SomeClass*| to
|CheckedPtr<SomeClass>|. See go/miracleptr for more details.

!! is used in situations where the pointer is assigned to or returned
as bool, otherwise CheckedPtr's more costly implicit T* cast operator
would kick in. !! isn't needed in boolean expressions. Examples here:
https://chromium-review.googlesource.com/c/chromium/src/+/2226003

Bug: 1080832
Change-Id: I8b1fb6962ea9211ae0d29ab2c8dfba3749d0193b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2237526
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#777204}
2020-06-11 01:01:31 +00:00
c695e53d88 Replace s/NULL/nullptr/ in field initializers used in constructors.
This change has been generated by a clang tool developed for the
go/miracleptr project.

Bug: 1080832
Change-Id: Ie7f428c8ad300db1df95d873668163d0ac719a22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2231843
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776343}
2020-06-09 02:09:45 +00:00
942af10437 Migrate ProcessErrorCallback usage to public API
Several bits (mostly tests, but also Network Service in production) use
mojo::core::SetDefaultProcessErrorCallback. This API was recently also
made available through the Mojo public API where it can be safely used
by clients consuming Mojo as a shared library.

This CL migrates all the old API calls over to the new API and removes
the old API from mojo/core.

The APIs are functionally equivalent, so this is not a behvioral change.

Bug: 1082473
Tbr: dmurph@chromium.org
Tbr: miu@chromium.org
Change-Id: Iee7eebb008cc3ea916832637f3654f22c429bbc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2229579
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774986}
2020-06-04 05:48:46 +00:00
3253b67cc7 Replace NULL and 0 with nullptr
https://google.github.io/styleguide/cppguide.html#0_and_nullptr/NULL says:
For pointers (address values), use nullptr, as this provides type-safety.

Additionally, NULL won't compile if we change |SomeClass*| to |CheckedPtr<SomeClass>|. See go/miracleptr for more details.

Bug: 1080832
Change-Id: I70f899fe45a31d55f98063585180686d2a256141
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2217946
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Peng Huang <penghuang@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773810}
2020-06-01 20:37:12 +00:00
2432c73179 [tracing] Rename disabled-by-default-toplevel.flow to toplevel.flow
toplevel.flow trace events ended up being quite useful. Move them out of
disabled-by-default for better visibility.

R=gab@chromium.org
TBR=rockot@google.com
BUG=932167

Change-Id: I90076f2e776b591ed7a485ed42bf8b64daedc1cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2111310
Commit-Queue: Alexander Timin <altimin@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770566}
2020-05-20 13:28:03 +00:00
4ed044ff34 Reland "Remove/replace unnecessary logging.h includes in .cc files (ipc)"
This is a reland of ba6e417c4d
The revert (crrev.com/c/2165458) was unrelated to this change.

Original change's description:
> Remove/replace unnecessary logging.h includes in .cc files (ipc)
>
> CHECK, CHECK_EQ etc., and NOTREACHED/NOTIMPLEMENTED have moved
> to the much smaller headers check.h, check_op.h, and notreached.h,
> respectively.
>
> This CL updates .cc files to use those headers instead when
> possible, with the purpose of saving compile time.
>
> (Split out from https://crrev.com/c/2164525 which also has
> notes on how the change was generated.)
>
> Bug: 1031540
> Change-Id: I9b41171cc43f427005f9a9d78e5cd61341ebeb40
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2164512
> Commit-Queue: Tom Sepez <tsepez@chromium.org>
> Auto-Submit: Hans Wennborg <hans@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#762412}

TBR=tsepez

Bug: 1031540
Change-Id: If1f75bd7c8ede51d08b660b3688bf392eceeab7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2167437
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762771}
2020-04-27 09:43:38 +00:00
62978b2246 Android builders on perf waterfall started failing since this commit. Reverting this change to mitigate.
https://ci.chromium.org/p/chrome/g/chrome.perf/console?limit=200

Revert "Remove/replace unnecessary logging.h includes in .cc files (ipc)"

This reverts commit ba6e417c4d.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Remove/replace unnecessary logging.h includes in .cc files (ipc)
> 
> CHECK, CHECK_EQ etc., and NOTREACHED/NOTIMPLEMENTED have moved
> to the much smaller headers check.h, check_op.h, and notreached.h,
> respectively.
> 
> This CL updates .cc files to use those headers instead when
> possible, with the purpose of saving compile time.
> 
> (Split out from https://crrev.com/c/2164525 which also has
> notes on how the change was generated.)
> 
> Bug: 1031540
> Change-Id: I9b41171cc43f427005f9a9d78e5cd61341ebeb40
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2164512
> Commit-Queue: Tom Sepez <tsepez@chromium.org>
> Auto-Submit: Hans Wennborg <hans@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#762412}

TBR=hans@chromium.org,tsepez@chromium.org

Change-Id: I21ebe546731e74bec8178d6bca889c1aeb4239c0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1031540
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165458
Reviewed-by: Wenbin Zhang <wenbinzhang@google.com>
Commit-Queue: Wenbin Zhang <wenbinzhang@google.com>
Cr-Commit-Position: refs/heads/master@{#762523}
2020-04-24 21:47:20 +00:00
ba6e417c4d Remove/replace unnecessary logging.h includes in .cc files (ipc)
CHECK, CHECK_EQ etc., and NOTREACHED/NOTIMPLEMENTED have moved
to the much smaller headers check.h, check_op.h, and notreached.h,
respectively.

This CL updates .cc files to use those headers instead when
possible, with the purpose of saving compile time.

(Split out from https://crrev.com/c/2164525 which also has
notes on how the change was generated.)

Bug: 1031540
Change-Id: I9b41171cc43f427005f9a9d78e5cd61341ebeb40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2164512
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762412}
2020-04-24 17:39:09 +00:00
0825fc3e14 [base] Apply BindOnceRewriter in //ipc
This change applies the BindOnceRewriter in //ipc.
This rewriter replaces calls to base::Bind and base::BindRepeating with
calls to base::BindOnce, in case the result is immediately assigned to a
base::OnceCallback. Given that base::RepeatingCallback is implicitly
convertible to base::OnceCallback, there is no change in functionality.

Steps:
  1. run_tool.py --tool base_bind_rewriters \
                 --tool-arg='--rewriter=bind_to_bind_once'
  2. git cl format

This CL was uploaded by git cl split.

R=jam@chromium.org

Bug: 714018
Change-Id: I323ecd822f7dbf4eefdf4cabf29a39d21d2e0ffa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132260
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#761106}
2020-04-21 20:24:34 +00:00
a40d4847e3 Check for NULL before dereferencing connector_
There are, apparently, edge-cases that can cause the Shutdown method in
ChannelAssociatedGroupController to be called when connector_ is NULL.
This is seen in crash reports. Therefore NULL checks are needed to
prevent browser crashes.

Bug: 1040835
Change-Id: I218bcbe05fc8bbed15dbc2c5418877d76dfbf542
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2154496
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#760680}
2020-04-20 20:57:24 +00:00
1494205bf9 [base] Apply PassedToMoveRewriter from BaseBindRewriters
This change applies changes generated by running the PassedToMoveRewriter
rewriter across a Linux build of the codebase. It changes no functionality,
and only removes base::Passed invocations that can either be completely
omitted, or rewritten in terms of std::move.

TBR=dcheng

Bug: 714018
Change-Id: Ie8af65a571271c2eb77f8f88c2678e8e8abbbb9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2120479
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753559}
2020-03-26 09:32:53 +00:00
6ddaf0e7df Inline new typemap configs within mojom targets
This removes the recently introduced `mojom_cpp_typemap` GN template in
favor of simply inlining typemap configs directly within the `mojom`
target they affect.

A few motivations here:

- The separate target approach required traits sources to always belong
  to a different target than the mojom variant's own sources. This has
  insurmountable dependency issues in some corner cases like
  //content/common.
- A typemap can only realistically affect a single mojom target in the
  build under most circumstances.
- A significant portion of the variables within a typemap target were
  only used by forwarding them to the affected mojom target. Inlining
  everything makes the direct impact on the mojom target more clear.
- This approach is exactly as powerful (from the perspective of build
  expressiveness) as typemap files, but without the typemap files.

Bug: 1059389
Change-Id: I8218312374e86a0c02dcaea630b05f61c7aa6d61
Tbr: changwan@chromium.org
Tbr: haraken@chromium.org
Tbr: dcheng@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106887
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751449}
2020-03-18 19:49:19 +00:00
5b465a8bfb Migrate AccessibilityHostMsg_ChildFrameHitTestResult to mojo
This CL converts the message that notifies the message that the
renderer will send to the browser as a response to PerformAction()
with kHitTest when the object being hit in the renderer happens to
have a child frame, in order to instruct the browser to request a
new hit test focused on such child frame as the reference point.

Bug: 1010831
Change-Id: I0911124db853f12e4e4e35acd580e48191b47cc3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2096578
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Cr-Commit-Position: refs/heads/master@{#750496}
2020-03-16 09:24:30 +00:00
31755f407c Convert BlinkTestHostMsg_PrintMessage to Mojo
This CL converts BlinkTestHostMsg_PrintMessage to BlinkTestClient
interface. But, BlinkTestRunner::PrintMessage needs to send a message
only when it's on the mainframe in order to sync with the existing
behavior. Like BlinkTestHostMsg_ResetDone conversion, this message
has been sent to the main frame. So, this CL moves |is_secondary_window|
from WebTestRenderFrameObserver to BlinkTestRunner.

Additionally, this CL removes blink_test_messages.h/cc files and related
things(e.g. BlinkTestMsgStart) finally.

Bug: 1039247, 1059322
Change-Id: I91dfc9256cacc63b1397c46ed1d6c582ab01b6ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089435
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749596}
2020-03-12 10:27:02 +00:00
81b38e95a8 Move //ipc typemap into GN rule
This also serves as a simple example of
converting a typemap with inlined sources
on a mojom_component target.

Bug: 1059389
Change-Id: If80faa47cdfcebf7c36c80d1ef6a611cb31bd69e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2094336
Auto-Submit: Ken Rockot <rockot@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#748791}
2020-03-10 18:18:02 +00:00
0291066b2c Make GpuMemoryBufferHandle::dxgi_handle a base::win::ScopedHandle
In the process, convert the buffer_types.mojom to handle<platform>. This
also adds a legacy IPC::ParamTraits<ScopedHandle> to support sending
GpuMemoryBufferHandle over legacy IPC.

Tbr: flackr@chromium.org
Bug: 863011, 710376
Change-Id: I087d9d83edc729b512dbb79806a0b4b2db2b31bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2064609
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745586}
2020-02-28 20:15:51 +00:00
768272463b Remove more MSVC compat hacks
Including PGO / WPO flags on Windows, which as far as I know aren't
used by anyone.

Bug: 1053958
Change-Id: I9479a10f921ca066ec2b702867ba687cdcb862ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062880
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742850}
2020-02-19 23:15:11 +00:00
2002cb3c16 Move InputMsg_SetFocus to mojo
This CL changes InputMsg_SetFocus so that it is implemented in the
RemoteFrame interface since it is only got through RenderFrameProxy.

It also introduces FakeRemoteFrame to use RemoteFrame on
render_frame_host_manager_unittest.cc.

Bug: 1039256
Change-Id: If7d1d2971fabf3c64777281b1bf5eedfa9fcf5c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1989714
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#732808}
2020-01-17 11:37:29 +00:00
9540ec9bfd Reformat all gn files in /ipc.
`gn format` recently changed its formatting behavior
for deps, source, and a few other elements when they
are assigned (with =) single-element lists to be consistent
with the formatting of updates (with +=) with single-element.

Now that we've rolled in a GN binary with the change,
reformat all files so that people don't get presubmit
warnings due to this.

This CL was uploaded by git cl split.

R=tsepez@chromium.org

Bug: 1041419
Change-Id: I0b313bdca77daa75e41535abfe706c7e6652aaa3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1995853
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732084}
2020-01-15 19:02:45 +00:00
eb2366a5de [mojo] Introduce an async flush API
This introduces a new kind of asynchronous flushing API for Mojo
endpoints, allowing independent pipes to synchronize against each
others' message queue.

Remote and Receiver both introduce |FlushAsync()| methods for
initiating a flush of their peer's message queue. Such operations
are tied to a corresponding PendingFlush object which can be used
to remotely observe completion of the async flush.

Remote also introduces |PauseReceiverUntilFlushCompletes()| to pause
its receiver's message queue until a given PendingFlush observes
completion. Receiver introduces an analogous
|PauseRemoteCallbacksUntilFlushCompletes()| method for essentially
the same purpose, in the reverse direction.

Combined, these APIs allow arbitrary pipes to synchronize
against each other even across a process boundary. This
synchronization mechanism can be used in cases where associated
interfaces are impossible to use and may eventually serve as a
complete replacement for associated interfaces.

Bug: 1040226
Change-Id: I3f8aaa39dc0e25b2c2d460cd7be1dbc4a2c0b11d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1968240
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Darin Fisher <darin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730829}
2020-01-13 21:13:46 +00:00
f45b3b2c0e [tracing] Fold ipc.flow into toplevel.flow.
Mojo messages are already covered by toplevel.flow.
Move legacy IPC there as well to centralise tracing for all async
work in a single place.

R=skyostil@chromium.org,rockot@google.com

Change-Id: Iba3d3a25bbb8bb05a8a7e5617312415e15126371
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1985970
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730222}
2020-01-10 17:47:27 +00:00
502a8b4db8 ipc/tracing: Use typed trace events for IPC message sends
Replaces SyncChannel::Send, RenderProcessHostImpl::Send, and
GpuChannelHost::Send trace events with typed trace events. Also adds a
utility to convert the IPC class ID to a corresponding protobuf enum.

Corresponding proto buffer definitions for these events were added in
aosp/1180211.

Typed trace events will allow inclusion of the event arguments in slow
reports data in the future. The trace format is protocol-buffer based
under the hood already (see docs.perfetto.dev for details), this patch
adds strong typing for the arguments of the respective events only.

TBR: sunnyps@chromium.org
Bug: 644264
Change-Id: I91c71230e62161b08faec889bf9eb70639ae0b5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1950986
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#730120}
2020-01-10 10:51:28 +00:00
cf8bf01191 Remove BrowserPluginMsgStart and NetworkHintsMsgStart from enum IPCMessageStart
They have become unused.

Change-Id: I1090f20a31c9f72dc494fff07b08ff49d206d8ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1989868
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729516}
2020-01-08 22:13:06 +00:00
4832b03bf6 Fix StrongAlias (de)serialization in IPC messages.
It currently uses
param_type::StrongAlias(..) to construct the type, which seems wrong
as param_type = util::StrongAlias<TagType, UnderlyingType>.
Which causes following compile error:

In file included from ../../ipc/ipc_message_utils_unittest.cc:5:
../../ipc/ipc_message_utils.h:1075:10: error: missing 'typename' prior to dependent type name 'param_type::StrongAlias'
    *r = param_type::StrongAlias(value);
         ^~~~~~~~~~~~~~~~~~~~~~~
Call StrongAlias constructor directly to fix this.
Add a regression unit test to fix the regression.

Bug: None
Change-Id: If172c83abd22498117c47a8721b7d9057c18a1d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1983570
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728702}
2020-01-06 23:58:18 +00:00
f8599f0128 Remove MessageLoop references in ipc_test_base.*
MessageLoop is going away soon.

Bug: 891670
Change-Id: I98905417dc914afd4fcc0640ace29b88fc591f8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1964497
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#724573}
2019-12-13 10:38:01 +00:00
a6c8e67fc1 Update ChannelProxy and SyncMessageFilter with PendingAssociatedReceiver
This is a part of the effort to convert to new Mojo types.
This CL updates ChannelProxy and SyncMessageFilter with
PendingAssociatedReceiver instead of AssociatedInterfaceRequest.

Bug: 955171
Change-Id: I6db2902ddc0cf42be819241ebf020a2b39a616bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1950733
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#722730}
2019-12-07 03:27:05 +00:00
69604f6ff8 Convert ipc::mojom::GenericInterface to new Mojo types
This CL converts ipc::mojom::GenericInterface to new Mojo types
with PendingAssociatedReceiver instead of
GenericInterfaceAssociatedRequest.

It also updates GetAssociatedInterface() with
pending_associated_receiver from ipc/ipc.mojom.

Bug: 955171
Change-Id: I92ebbb25e51b1bbf5fba0417413d66455d277744
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948385
Reviewed-by: Sam McNally <sammc@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#721310}
2019-12-04 01:59:52 +00:00
2063eaaed7 Convert ipc to Once/Repeating variants of Bind/Callback. (pt 3)
Bug: 1007797
Change-Id: Ic18cf3733c107d3f24f9089095bc27276395ee60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1928387
Auto-Submit: Matt Falkenhagen <falken@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#718250}
2019-11-22 20:03:30 +00:00
f2a4adeb14 Add prefix to empty param tests.
googletest will no longer support empty prefix
for parameterized INSTANTIATE_TEST_SUITE_P.
Adding "All" prefix to existing empty prefix test suites.

This CL was uploaded by git cl split.

R=jam@chromium.org

Bug: 1023677
Change-Id: I6da37df6fc717f2cdb120e7bd3f37275e7155fb5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1925186
Auto-Submit: Ilia Samsonov <isamsonov@google.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Ilia Samsonov <isamsonov@google.com>
Cr-Commit-Position: refs/heads/master@{#717855}
2019-11-21 22:51:38 +00:00
fb888f037d Convert ipc to Once/Repeating variants of Bind/Callback. (pt 2)
Bug: 1007797
Change-Id: I7ccb2694f2087e4af502d343b20347bcc56ade61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1925829
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717370}
2019-11-21 00:30:02 +00:00
f2c7fa23f7 [ipc] Remove support for base::SharedMemoryHandle
base::SharedMemoryHandle is deprecated and being removed.

Bug: 795291
Change-Id: Iccd722469c5d946aaff16b3b12a983d4632486c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1920119
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716993}
2019-11-20 14:09:58 +00:00
ac82819f74 Convert IPC::mojom::IndirectTestDriver to new Mojo types
This CL converts IPC::mojom::IndirectTestDriver to new Mojo types using
AssociatedReceiver instead of AssociatedBinding.

Bug: 955171
Change-Id: I3f4149b9cc52744d55c20e0c61c4dfb2ab2296e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1923772
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#716818}
2019-11-20 00:01:27 +00:00