0
Commit Graph

37 Commits

Author SHA1 Message Date
Reilly Grant
d4e6613342 Convert dbus to base::Bind and base::Callback to Once/Repeating
Bug: 1007778
Change-Id: I080ef6ed77020f262deeb2cf972b8b32518a0bf5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1928210
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718180}
2019-11-22 17:14:50 +00:00
Gabriel Charette
1858a23ce0 Backport some tests in /dbus to SingleThreadTaskEnvironment
These tests were previously migrated from single-threaded MessageLoop to
a multi-threaded TaskEnvironment (then named ScopedTaskEnvironment) as
part of crbug.com/891670.

//base OWNERS decided in retrospect that it was better to keep a
single-threaded option for TaskEnvironment and introduced
SingleThreadTaskEnvironment. This CL retrofits that decision for
/dbus.

This CL is a no-op if it passes CQ.

This CL was uploaded by git cl split.

R=hashimoto@chromium.org

Bug: 891670
Change-Id: I05ed8a9c81b692d2deda1ebb32abfce3011f15cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786754
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694664}
2019-09-09 07:50:49 +00:00
Gabriel Charette
c710874894 Reland "[TaskEnvironment] Complete migration with header rename"
This is a reland of 18947083c7

The move_source_file.py script's formatting rules incorrectly
formatted services/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
after all. But we also can't rely 100% on git cl format (crbug.com/997063)
so I ended up performing a git cl format && git add -up
(+interactive addition of missing blank line after foo.h when included
from top of foo.cc)

Also added
$ tools/git/move_source_file.py net/test/test_with_scoped_task_environment.h net/test/test_with_task_environment.h

Original change's description:
> [TaskEnvironment] Complete migration with header rename
>
> This is merely:
>
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
>
> and a few manual renames in DEPS files missed by the script
>
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
>
> TBR=dcheng@chromium.org
>
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: I6179dd1329a4d30bf5c65450ea893537f31e6f85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767658
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689794}
2019-08-23 03:31:40 +00:00
Gabriel Charette
b69fcd4f6e Revert "[TaskEnvironment] Complete migration with header rename"
This reverts commit 18947083c7.

Reason for revert: broke Win

Original change's description:
> [TaskEnvironment] Complete migration with header rename
> 
> This is merely:
> 
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
> 
> and a few manual renames in DEPS files missed by the script
> 
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
> 
> TBR=dcheng@chromium.org
> 
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}

TBR=dcheng@chromium.org,gab@chromium.org

Change-Id: I9aa8ff558d1ff78cebe0c25e559c017578ad4f53
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 992483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767657
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689780}
2019-08-23 02:13:29 +00:00
Gabriel Charette
18947083c7 [TaskEnvironment] Complete migration with header rename
This is merely:

$ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
$ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
$ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
$ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
$ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc

and a few manual renames in DEPS files missed by the script

This CL uses --bypass-hooks to avoid having to git cl format because
many headers are being reordered by git cl format and it's too many to
figure out in a no-op CL which ones are okay with it.
windows.h for one should typically be first and another one of the
reorderings in PS3 even caused a compile failure:
https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689778}
2019-08-23 02:05:33 +00:00
Gabriel Charette
694c3c33ca [TaskEnvironment] Mass-migrate away from ScopedTaskEnvironment (1/2)
(well half of them because git cl upload wouldn't let me do
 them all at once...)

This is step  of the mass migration. Some of these will be
backported to SingleThreadTaskEnvironment in a later phase.

scoped_task_environment.h will also only move in a follow-up CL.

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: I44bc376deee9b6c95bafac8d54165174d86a5001
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1756247
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688086}
2019-08-19 14:53:05 +00:00
Carlos Caballero
dd8bf7b04a Deprecate MessageLoop::Type
It is currently just an alias to MessagePump::Type. This patch changes
a bunch of references to use MessagePump::Type as MessageLoop will eventually
disappear.

Also rename base::Thread::Options::message_loop_type to message_pump_type
It is weird to see things like

message_loop_type = MessagePump::Type::UI

Also change some other instances that I happened to see in the form
loop_type = MessagePump::Type::UI
to
pump_type = MessagePump::Type::UI

This is a mechanical change that will be reviewed according to
https://chromium.googlesource.com/chromium/src/+/master/docs/code_reviews.md#mechanical-changes

BUG=891670
TBR=gab@chromium.org

Change-Id: Ib41ccc6547b8c9fa0bdba5d23c4767ae03f2a97d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1718331
Commit-Queue: Carlos Caballero <carlscab@google.com>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682254}
2019-07-30 14:14:15 +00:00
Carlos Caballero
479d287641 Use ScopedTaskEnvironment instead of MessageLoop in /dbus
MessageLoop will go away, eventually.

ScopedTaskEnvironment will per default start a ThreadPool, which should
be fine in most of the cases. If you belive your test needs to make sure
that no ThreadPool runs let me know and I will update the patch.

BUG=891670
This CL was uploaded by git cl split.

R=satorux@chromium.org

Change-Id: Ib321e97988821f68055452ecc950a680bfa821fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1649774
Commit-Queue: Carlos Caballero <carlscab@google.com>
Auto-Submit: Carlos Caballero <carlscab@google.com>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667547}
2019-06-10 10:04:43 +00:00
kylechar
39c3928a41 Use base::BindOnce for PostTask callbacks.
TaskRunner::PostTask() takes a OnceCallback. Replace usage of
base::Bind(), which produces a RepeatingCallback, with base::BindOnce()
when the callback is created as a temporary inside of PostTask(). The
following regex was used to find instances that could be replaced:

(Post(?:Delayed)?Task)\((?:\n\s*)?FROM_HERE,(?:\n)?\s*base::Bind\(

Also replace any usage of base::Passed(&var) with std::move(var) for
variables passed to base::BindOnce(). base::Passed() isn't needed for
move-only types with OnceCallbacks.

This CL was uploaded by git cl split.

R=stevenjb@chromium.org

Bug: 714018
Change-Id: I70dce39d3975123cf0709f1787cc68f49ba9a57d
Reviewed-on: https://chromium-review.googlesource.com/c/1475733
Auto-Submit: kylechar <kylechar@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633334}
2019-02-19 19:04:04 +00:00
Alexander Timin
4f9c35c363 [message_loop] Remove message_loop_forward.h
As a final step, replace all includes back:
- mv message_loop_current.h message_loop.h
- s/message_loop_forward.h/message_loop.h/ in all includes.
- s/message_loop_forward.h/message_loop.h/ in base/BUILD.gn
- Remove message_loop_forward.h from third_party/DEPS.

TBR=gab@chromium.org
R=gab@chromium.org
BUG=891670

Change-Id: I623077025701459ddb7045cbcfdad138aa90a9e4
Reviewed-on: https://chromium-review.googlesource.com/c/1313110
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604690}
2018-11-01 20:15:20 +00:00
Alexander Timin
c643d0e146 [message_loop] Temporary introduce message_loop_forward.h.
To facilitate splitting MessageLoop into MessageLoop and MessageLoopImpl
introduce message_loop_forward.h and use it everywhere.

- s/message_loop.h/message_loop_forward.h/ in all includes.
- Add message_loop_forward.h to base/BUILD.gn.
- Add message_loop_forward.h to third_party/DEPS.

TBR=gab@chromium.org
BUG=891670

Change-Id: Ibac3a24f5bd4291c9d57dd32c627477e4e6ef324
Reviewed-on: https://chromium-review.googlesource.com/c/1313108
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604672}
2018-11-01 19:43:28 +00:00
Ryo Hashimoto
3bbeb5c8e3 dbus: Stop timing out in TestService::WaitUntilServiceIsStarted()
Removing the timeout to have one less sources of flakiness.

BUG=872732
TEST=dbus_unittests

Change-Id: I7ca390a19a77686df268332850e3951e6d13d3d1
Reviewed-on: https://chromium-review.googlesource.com/1170719
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Satoru Takabayashi <satorux@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582506}
2018-08-13 04:58:39 +00:00
Lei Zhang
5398653e9c Disable some SignalSenderVerificationTests.
They are flaky.

BUG=785555
TBR=satorux@chromium.org
NOTRY=true

Change-Id: I9e2fbaf9bb1efacc50da6e1b8cd855d379e34568
Reviewed-on: https://chromium-review.googlesource.com/1026560
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553266}
2018-04-24 20:51:22 +00:00
François Degros
13e8d06f68 Removed StatisticsRecorder::Initialize and StatisticsRecorder::IsActive.
This is a simple code cleanup. These methods were already deprecated and empty.

TBR=bartfab@chromium.org,rockot@chromium.org,avi@chromium.org,dpranke@chromium.org,groby@chromium.org,pwnall@chromium.org,oshima@chromium.org,agrieve@chromium.org,stevenjb@chromium.org,halliwell@chromium.org,juliatuttle@chromium.org,treib@chromium.org,yfriedman@chromium.org,asvitkine@chromium.org,sdefresne@chromium.org,wolenetz@chromium.org,pauljensen@chromium.org,gene@chromium.org,csharrison@chromium.org,pfeldman@chromium.org,blundell@chromium.org,borisv@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I658a4a8370fc423f1afd60ca5e943a4c8b511417
Bug: 
Reviewed-on: https://chromium-review.googlesource.com/846651
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: Julia Tuttle <juliatuttle@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Bartosz Fabianowski <bartfab@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527562}
2018-01-08 03:44:32 +00:00
hashimoto
72254d5183 dbus: Stop collecting DBus.RejectedSignalCount histogram
Also, use shorter timeout for SignalSenderVerificationTest.TestSignalRejected
which was disabled because of its slowness.

BUG=407063,643537
TEST=dbus_unittests

Review-Url: https://codereview.chromium.org/2837943004
Cr-Commit-Position: refs/heads/master@{#466912}
2017-04-25 07:13:31 +00:00
asvitkine
12d9cdafee Migrate desktop Linux to histogram_macros.h include.
Updates ifdefs in histogram.h to prevent this from regressing
for Linux desktop. The ifdef will be updated incrementally as
each platform becomes fully migrated.

BUG=416479
TBR=gbillock@chromium.org,tommi@chromium.org,stevenjb@chromium.org,rockot@chromium.org,sadrul@chromium.org

Review-Url: https://codereview.chromium.org/2639313002
Cr-Commit-Position: refs/heads/master@{#444736}
2017-01-19 15:17:38 +00:00
fdoray
6ef45cf474 Remove calls to deprecated MessageLoop methods on Windows and Linux.
This Cl removes most calls to these methods on Windows and Linux:
- MessageLoop::PostTask
- MessageLoop::PostDelayedTask
- MessageLoop::ReleaseSoon
- MessageLoop::DeleteSoon
- MessageLoop::Run
- MessageLoop::RunUntilIdle

Also note that calls to thread->message_loop()->task_runner() have
been replaced with thread->task_runner() (|thread| is a base::Thread).

This CL was generated by running the clang-tidy checks available here
https://crbug.com/616447#c153 on Windows and Mac and by applying a few
manual fixes (e.g. to remove a call made from a macro in
audio_low_latency_input_win_unittest.cc).

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

Review-Url: https://codereview.chromium.org/2211473003
Cr-Commit-Position: refs/heads/master@{#414442}
2016-08-25 15:38:22 +00:00
dcheng
2a193281aa Convert //dbus from scoped_ptr to std::unique_ptr
BUG=554298
R=hashimoto@chromium.org
TBR=scheib@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#386236}
2016-04-08 22:56:55 +00:00
hashimoto
067d84f52f dbus: Use randomly generated string as a TestService's service name
To run tests parallelly.

BUG=571274
TEST=dbus_unittests

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

Cr-Commit-Position: refs/heads/master@{#367499}
2016-01-05 08:48:48 +00:00
skyostil
8a033aaf2d Migrate callers of message_loop_proxy() to task_runner()
Migrate callers of {MessageLoop,Thread}::message_loop_proxy() to
{MessageLoop,Thread}::task_runner(). Since the types at the call sites
have already been updated, this is just a bulk rename.

BUG=465354
TBR=armansito@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#334840}
2015-06-17 15:46:47 +00:00
dcheng
3bb7119cdc Standardize usage of virtual/override/final specifiers in dbus/.
The Google C++ style guide states:

  Explicitly annotate overrides of virtual functions or virtual
  destructors with an override or (less frequently) final specifier.
  Older (pre-C++11) code will use the virtual keyword as an inferior
  alternative annotation. For clarity, use exactly one of override,
  final, or virtual when declaring an override.

To better conform to these guidelines, the following constructs have
been rewritten:

- if a base class has a virtual destructor, then:
    virtual ~Foo();                   ->  ~Foo() override;
- virtual void Foo() override;        ->  void Foo() override;
- virtual void Foo() override final;  ->  void Foo() final;

This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.

Several formatting edits by clang-format were manually reverted, due to
mangling of some of the more complicate IPC macros.

BUG=417463

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

Cr-Commit-Position: refs/heads/master@{#309710}
2014-12-29 18:31:06 +00:00
earthdok
9562caf1ec Plug some of the leaks in dbus_unittests.
Also, remove the deprecated base::MessageLoop::Run() calls
everywhere in dbus unittests.

BUG=365669
R=armansito@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#293113}
2014-09-03 10:43:13 +00:00
Paweł Hajdan, Jr
fdf83ea6b0 Disable slow SignalSenderVerificationTest.TestSignalRejected
TBR=haruki

BUG=407063

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

Cr-Commit-Position: refs/heads/master@{#291664}
2014-08-25 11:20:20 +00:00
hashimoto@chromium.org
db817802ed dbus: Stop accessing ObjectProxy::name_owner_changed_callback_ on the D-Bus thread
Accessing the callback on the D-Bus thread while changing its value may result in a race condition.
Change the type of SetNameOwnerChangedCallback's argument from Signal to strings to stop worrying about on which thread the Signal gets released.

BUG=298747
TEST=dbus_unittests
R=satorux@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225675 0039d316-1c4b-4281-b951-d872f2087c98
2013-09-27 07:12:03 +00:00
cmasone@chromium.org
e282490e35 Allow Chromium's DBus service ownership to be stealable
We've seen some cases in tests where a Chromium process winds up in a
temporarily unkillable state, causing the dbus-daemon to believe that
it still actively owns org.chromium.LibCrosService.  This makes
attempts to restart the UI fail, as the browser dies when it cannot
take ownership of this service name. The reason it can't is because
Chromium currently doesn't allow other processes to steal ownership --
and the unkillable process is holding onto the token.

This can be remedied by providing certain options when ownership of
the service name is taken, options that allow other processes to seize
ownership if they so choose. The ramifications of this are discussed
further in the bug.

BUG=chromium:261381
TEST=new unit test in dbus_unittest
TEST=run the following as chronos on a device: "gdbus call --system --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.RequestName org.chromium.LibCrosService 7"
TEST=This should return (uint32 1,)

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214589 0039d316-1c4b-4281-b951-d872f2087c98
2013-07-31 06:34:59 +00:00
avi@chromium.org
2a9ec0ea24 Use a direct include of the message_loop header in dbus/, device/, extensions/, google_apis/, gpu/, ipc/, jingle/.
BUG=260807
TEST=none
TBR=ben@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212157 0039d316-1c4b-4281-b951-d872f2087c98
2013-07-17 23:00:30 +00:00
thestig@chromium.org
2a57ca6404 Cleanup: Put DBus unit tests in the dbus namespace, so one does not need to write dbus:: everywhere. Remove some other dbus:: usages in the dbus namespace.
Review URL: https://chromiumcodereview.appspot.com/16012018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206010 0039d316-1c4b-4281-b951-d872f2087c98
2013-06-13 06:37:19 +00:00
xhwang@chromium.org
ff33b18e23 dbus: Use base::MessageLoop.
BUG=236029
R=keybuk@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197629 0039d316-1c4b-4281-b951-d872f2087c98
2013-05-01 16:10:30 +00:00
kaiwang@chromium.org
cc7dec210c Connect SparseHistogram with the rest of stats system
With this CL, SparseHistogram is usable with SparseHistogram::FactoryGet.
Next step is to implement a Histogram like macro and implement WriteHTMLGraph
and WriteAscii to have a nice output.

BUG=139612


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185451 0039d316-1c4b-4281-b951-d872f2087c98
2013-03-01 03:53:25 +00:00
thestig@chromium.org
200328ab0d DBus: Use TaskRunners instead of MessageLoopProxies.
Review URL: https://chromiumcodereview.appspot.com/12255043

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183362 0039d316-1c4b-4281-b951-d872f2087c98
2013-02-20 01:36:53 +00:00
keybuk@chromium.org
b27cb74f6f Disable SignalSenderVerificationTest.TestMultipleObjects
TBR=gauravsh@chromium.org
BUG=chromium-os:36486
Review URL: https://codereview.chromium.org/11421086

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169546 0039d316-1c4b-4281-b951-d872f2087c98
2012-11-27 01:01:28 +00:00
keybuk@chromium.org
d7134d4051 Allow multiple object proxies to handle NameOwnerChanged
Multiple object proxies may be registered for any single D-Bus service, one per interface. Returning "handled" means only the first interface object proxy gets to handle the signal, others never see it.

Change to always return "not yet handled", while this means D-Bus never knows we actually handled the NameOwnerChanged signal, that's quite ok and is actually what all other bindings do for all signals.

Submitted as -r169164 but reverted in -r169170; resubmitted with change to run message loop three times if necessary.

BUG=chromium-os:36486
TEST=dbus_unittests

TBR=gauravsh@chromium.org
Review URL: https://codereview.chromium.org/11280073

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169538 0039d316-1c4b-4281-b951-d872f2087c98
2012-11-27 00:23:25 +00:00
lambroslambrou@google.com
1c312401aa Revert 169164 - Allow multiple object proxies to handle NameOwnerChanged
Failed on Linux ChromiumOS Tests:

SignalSenderVerificationTest.TestMultipleObjects: 
[4218:4244:1121/160846:447516037:ERROR:object_proxy.cc(624)] Failed to get name owner. Got org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.chromium.TestService': no such name
[4218:4244:1121/160846:447531010:ERROR:bus.cc(444)] Failed to get the ownership of org.chromium.TestService:
[4218:4248:1121/160846:447531228:ERROR:test_service.cc(134)] Failed to own: org.chromium.TestService
dbus/signal_sender_verification_unittest.cc:302: Failure
Value of: on_name_owner_changed_called_
Actual: false
Expected: true
[4218:4244:1121/160846:447535382:ERROR:bus.cc(604)] Requested to remove an unknown match rule: type='signal',interface='org.freedesktop.DBus',member='NameOwnerChanged',path='/org/freedesktop/DBus',sender='org.freedesktop.DBus',arg0='org.chromium.TestService'

http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/12886/steps/dbus_unittests/logs/TestMultipleObjects

Multiple object proxies may be registered for any single D-Bus service, one per interface. Returning "handled" means only the first interface object proxy gets to handle the signal, others never see it.

Change to always return "not yet handled", while this means D-Bus never knows we actually handled the NameOwnerChanged signal, that's quite ok and is actually what all other bindings do for all signals.

BUG=chromium-os:36486
TEST=dbus_unittests

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

TBR=keybuk@chromium.org
Review URL: https://codereview.chromium.org/11299149

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169170 0039d316-1c4b-4281-b951-d872f2087c98
2012-11-22 00:30:16 +00:00
keybuk@chromium.org
66505bf8df Allow multiple object proxies to handle NameOwnerChanged
Multiple object proxies may be registered for any single D-Bus service, one per interface. Returning "handled" means only the first interface object proxy gets to handle the signal, others never see it.

Change to always return "not yet handled", while this means D-Bus never knows we actually handled the NameOwnerChanged signal, that's quite ok and is actually what all other bindings do for all signals.

BUG=chromium-os:36486
TEST=dbus_unittests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169164 0039d316-1c4b-4281-b951-d872f2087c98
2012-11-21 23:44:42 +00:00
haruki@chromium.org
6d36c0cadf Make SignalSenderVerificationTest more robust
Add more assertions and a callback to check the result of RequestOwnership.

Original test can hang when test_service2_ tries to acquire the ownership before D-Bus recognizes test_service_'s disconnection.
In that situation, test_service2_ cannot own the name and cannot send a message.

BUG=158689
TEST=unittests


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167649 0039d316-1c4b-4281-b951-d872f2087c98
2012-11-14 11:02:59 +00:00
scottmg@chromium.org
ff9f6e5841 disable flaky dbus_unittests SignalSenderVerificationTest.TestOwnerChange
TBR=haruki@chromium.org
BUG=159639
NOTRY=true

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166234 0039d316-1c4b-4281-b951-d872f2087c98
2012-11-06 18:40:49 +00:00
haruki@chromium.org
8bbe31e8ce Add sender verification of D-Bus signals.
The CL does the following:
- Add a match rule for NameOwnerChanged signal from org.freedesktop.DBus.
- Update the owner of the well-known bus name when a NameOwnerChanged comes.
- Call GetNameOwner method to update the latest if ObjectProxy instance does not know the owner.
- Verify the sender of the signal and reject the unknown senders.
- Add UMA_HISTOGRAM_COUNTS "DBus.RejectedSignalCount" for rejected signals.

and a unittest.

BUG=140938
TEST=manual, unittests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164597 0039d316-1c4b-4281-b951-d872f2087c98
2012-10-29 06:27:33 +00:00