0
Commit Graph

23 Commits

Author SHA1 Message Date
dcheng
c2282aa891 Standardize usage of virtual/override/final in content/browser/
This patch was automatically generated by applying clang fixit hints
generated by the plugin to the source tree.

BUG=417463
TBR=sky@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#300469}
2014-10-21 12:08:25 +00:00
mohan.reddy
7fc3ac7d5a Replace FINAL and OVERRIDE with their C++11 counterparts in content
This step is a giant search and replace for OVERRIDE and FINAL to
replace them with their lowercase versions.

BUG=417463

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

Cr-Commit-Position: refs/heads/master@{#298804}
2014-10-09 05:24:24 +00:00
jkarlin
80e53817d6 Flush SimpleCache worker pool between all tests.
This will prevent tests that utilize a SimpleCache from running into teardown leaks.

BUG=413688

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

Cr-Commit-Position: refs/heads/master@{#296936}
2014-09-26 14:33:02 +00:00
earthdok@chromium.org
b5217d5338 Flush the blocking pool in TestBrowserThreadBundle.
While we already flush the blocking pool in a OnTestEnd() hook (installed in
ContentTestSuiteBase), that is too late for tests that create their own threads.
The test (and the TestBrowserThreadBundle that it contains) will have been
destroyed by the time the hook runs, and any tasks posted to the blocking pool
via PostTaskAndReply will not be able to reply back to the originating thread.
This causes the task and reply Closures to be leaked. Flushing the blocking pool
before TestBrowserThreadBundle is destroyed should fix those leaks.

BUG=168415, 270673, 270658
TBR=ajwong@chromium.org, jochen@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217268 0039d316-1c4b-4281-b951-d872f2087c98
2013-08-13 16:06:21 +00:00
jamesr@chromium.org
08dda5ce86 Remove unused WEBKIT_DEPRECATED thread
BUG=237267, 234283
R=jam@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212661 0039d316-1c4b-4281-b951-d872f2087c98
2013-07-19 21:55:53 +00:00
ajwong@chromium.org
ec04d3f550 Add TestBrowserThreadBundle into RenderViewHostTestHarness. Kill some unnecessary real threads.
This CL creates a new class, TestBrowserThreadBundle, that creates a TestBrowserThread for the most commonly needed BrowserThreads. It also adds this thread bundle into RenderViewHostTestHarness because most tests that use this harness need these threads in order to run.  To support TestBrowserThreadBundle, BrowserThreadImpl's test construction was also modified to understand a NULL message_loop.

Aside from introducing the new class, this CL also removes:
  (1) unnecessary constructors in test
  (2) DISALLOW_COPY_AND_ASSIGNS in test fixtures*
  (3) now redundant TestBrowserThreads from tests
  (4) bad access-level changes for SetUp() and TearDown()
  (5) using declarations that root off the global scope
  (6) uses of MessageLoop's RunUntilIdle() and Quit()
  (7) as many real threads as possible

There are also a changes to MediaCaptureDevicesDispatcher and OneClickSigninHelper that allow unittests to cut dependencies on IO thread activity.  DesktopNotificationServiceTest (and a couple of others) were also made single threaded because the synchronization logic required for a non-flaky test meant the parallelism only really exercised the extra code in the test that forced the serialization.

* DISALLOW_COPY_AND_ASSIGN does not serve much purpose in GTest fixture types. However, using it removes the compile-provided default constructor which forces the fixture writer to provide an empty default constructor. Since GTest recommends the default constructor as the preferred method to do setup for a test (as opposed to the SetUp() method), it's confusing to have bunch of classes with both SetUp() and a default constructor. It's simpler and uses less code to just remove the DISALLOW_COPY_AND_ASSIGN. An alternative would be to use the default constructor for initialization, but this is not possible because of our test harnesses are inheritance based which means it is impossible for a derived fixture to perform initialization before the harness if we use the GTest preferred default constructor initialization pattern.

TBR=avi,battre,ben,benwells,brettw,dbeam,dimich,joi,joth,mad,marja,markusheintz,noelallen,phajdan,rdsmith,satorux,scherkus,sky,stevenjb,stuartmorgan,timsteele
BUG=159193

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204603 0039d316-1c4b-4281-b951-d872f2087c98
2013-06-06 21:31:39 +00:00
xhwang@chromium.org
dd32b127ce content: Use base::MessageLoop.
BUG=236029
R=avi@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198316 0039d316-1c4b-4281-b951-d872f2087c98
2013-05-04 14:17:11 +00:00
michaeln@google.com
13ecb5e99e Flush SequenceWorkerPool tasks after each test. Applies to unit_test, interactive_ui test, browser_tests... pretty much all gtest based content library test harnesses are affected.
The CL changes semantics and implementation of the existing FlushForTesting method (which wasn't suitable for this usage).

* The old method would wait for delayed tasks prior to continuing, the new method
will not run them but will delete them prior to continuing.

* The old method would deadlock if called after Shutdown had been called, the new method returns immediately in that case.

A few SWP unittests relied on the waiting for delayed task completion behavior. Those have been modified to explicitly wait thru other means.

BUG=168415,166470
Review URL: https://codereview.chromium.org/11649032

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186578 0039d316-1c4b-4281-b951-d872f2087c98
2013-03-07 01:35:37 +00:00
tfarina@chromium.org
0f591eee6f content: Remove deprecated method from TestBrowserThread.
TEST=content_unittests
R=jam@chromium.org


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177327 0039d316-1c4b-4281-b951-d872f2087c98
2013-01-17 03:02:40 +00:00
rtenneti@google.com
e0b87aa21c Added unique function names (IOThreadRun, DBThreadRun, etc)
which make it possible to tell the thread name in crash dumps
from the call stack. Added a volatile automatic variable to
avoid global optimizers optimizing the function.

This change would help us to triage ThreadWatcher crashes
for IO thread. It would also help in debugging crashes.

R=sky, jar
Review URL: https://chromiumcodereview.appspot.com/10796079

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147949 0039d316-1c4b-4281-b951-d872f2087c98
2012-07-23 21:21:23 +00:00
ajwong@chromium.org
f78671752a Remove #pragma once from content
Review URL: https://chromiumcodereview.appspot.com/10696166

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146071 0039d316-1c4b-4281-b951-d872f2087c98
2012-07-11 07:04:07 +00:00
thestig@chromium.org
9226938bf4 Cleanup: IWYU for BrowserThread.
BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124852 0039d316-1c4b-4281-b951-d872f2087c98
2012-03-03 09:00:08 +00:00
tedvessenes@gmail.com
17dc674a9c Add functions to expand PostDelayedTask interface.
These functions add TimeDelta interfaces in addition to the int ms interfaces,
which will be removed at a later date.

BUG=108171


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123683 0039d316-1c4b-4281-b951-d872f2087c98
2012-02-26 08:17:37 +00:00
brettw@chromium.org
3189013eeb Hook up the SequencedWorkerPool to the browser thread.
[re-land of 116816 http://codereview.chromium.org/9065009]

This does some refactoring of the static data in the browser thread so we only have one global object instead of a bunch fo separate arrays.

It also hooks up the visited link master's I/O to use this new system as a proof of concept.
Review URL: https://chromiumcodereview.appspot.com/9124033

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118236 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-19 04:11:57 +00:00
msw@chromium.org
d93ad24560 Revert 116816 - Hook up the SequencedWorkerPool to the browser thread.
This does some refactoring of the static data in the browser thread so we only have one global object instead of a bunch fo separate arrays.

It also hooks up the visited link master's I/O to use this new system as a proof of concept.
Review URL: http://codereview.chromium.org/9065009

TBR=brettw@chromium.org
Review URL: http://codereview.chromium.org/9122022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116817 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-07 05:39:31 +00:00
brettw@chromium.org
cef3ea5640 Hook up the SequencedWorkerPool to the browser thread.
This does some refactoring of the static data in the browser thread so we only have one global object instead of a bunch fo separate arrays.

It also hooks up the visited link master's I/O to use this new system as a proof of concept.
Review URL: http://codereview.chromium.org/9065009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116816 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-07 04:55:35 +00:00
jhawkins@chromium.org
e7b3a61984 base::Bind: Remove Task.
BUG=none
TEST=none
R=awong

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116439 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-05 02:18:18 +00:00
joi@chromium.org
2e5b60a280 Have content/ create and destroy its own threads. (Re-land)
Change embedding API and embedders to allow for this.

Push inheritance of base::Thread down to content::BrowserThreadImpl so
that content::BrowserThread is just a namespace for API functions.

This change temporarily disables chrome_frame_net_tests as agreed by the CF lead, see bug 105435.

TBR=ben@chromium.org (IWYU change only)
BUG=98716,104578,105435

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=111695
Reverted (problems on official bot): r111698

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111705 0039d316-1c4b-4281-b951-d872f2087c98
2011-11-28 15:56:41 +00:00
joi@chromium.org
14f79fec5f Revert 111695 - Have content/ create and destroy its own threads.
Reason: Problems on official builders.

Change embedding API and embedders to allow for this.

Push inheritance of base::Thread down to content::BrowserThreadImpl so
that content::BrowserThread is just a namespace for API functions.

This change temporarily disables chrome_frame_net_tests as agreed by the CF lead, see bug 105435.

TBR=ben@chromium.org (IWYU change only)
BUG=98716,104578,105435

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

TBR=joi@chromium.org
Review URL: http://codereview.chromium.org/8718012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111698 0039d316-1c4b-4281-b951-d872f2087c98
2011-11-28 14:00:36 +00:00
joi@chromium.org
042666f262 Have content/ create and destroy its own threads.
Change embedding API and embedders to allow for this.

Push inheritance of base::Thread down to content::BrowserThreadImpl so
that content::BrowserThread is just a namespace for API functions.

This change temporarily disables chrome_frame_net_tests as agreed by the CF lead, see bug 105435.

TBR=ben@chromium.org (IWYU change only)
BUG=98716,104578,105435

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111695 0039d316-1c4b-4281-b951-d872f2087c98
2011-11-28 12:51:39 +00:00
thakis@chromium.org
c08596702d content: Remove 16 exit time destructors and 15 static initializers.
BUG=101600,94925
TEST=none
TBR=ben

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108982 0039d316-1c4b-4281-b951-d872f2087c98
2011-11-08 07:48:23 +00:00
dpranke@chromium.org
f425d464e1 browser-thread related exports
R=jam@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107998 0039d316-1c4b-4281-b951-d872f2087c98
2011-10-31 20:01:59 +00:00
joi@chromium.org
c38831a108 Split BrowserThread into public API and private implementation, step 1.
Only content/ now has the ability to create BrowserThread objects,
with the exception that tests can create the
content::TestBrowserThread subclass, and (temporarily) code in chrome/
can create the DeprecatedBrowserThread subclass.

A follow-up change will make content/ take care of its own thread
creation, remove DeprecatedBrowserThread, and move all state and
non-trivial constructors from BrowserThread down to BrowserThreadImpl.

Also moved BrowserProcessSubThread into content/ namespace.  As part
of follow-up cleanup, chrome/ will stop using this class.

BUG=98716
TEST=existing

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107718 0039d316-1c4b-4281-b951-d872f2087c98
2011-10-28 12:44:49 +00:00