0
Commit Graph

35 Commits

Author SHA1 Message Date
jam@chromium.org
30ca5b27dd Fix regression in BrowserThread's optimization of when it skips a lock. The variable name was misnamed before, which contributed to this. I've updated the variable name to make it clearer.
Credit to liujundota@gmail.com who noticed this.
Review URL: https://chromiumcodereview.appspot.com/10900020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153977 0039d316-1c4b-4281-b951-d872f2087c98
2012-08-29 21:18:15 +00:00
rtenneti@chromium.org
baec95263e Use NOINLINE for thread watcher and browser thread identifier
functions.

R=eroman, jar, sky

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148487 0039d316-1c4b-4281-b951-d872f2087c98
2012-07-26 02:26:51 +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
tedvessenes@gmail.com
beea992443 Remove old Sleep and PostDelayedTask interfaces that use int ms instead of TimeDelta.
The previous version of this patch was reverted due to crashing cros_x86 and cros_tegra2 builds.  See: http://codereview.chromium.org/9703053/

BUG=108171

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143401 0039d316-1c4b-4281-b951-d872f2087c98
2012-06-21 17:31:56 +00:00
asanka@chromium.org
ad5fb16613 Revert 140102 - Remove old PostDelayedTask interfaces that use int ms instead of TimeDelta.
Compile failed on ChromiumOS x86 and Tegra.

BUG=108171


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

TBR=tedvessenes@gmail.com
Review URL: https://chromiumcodereview.appspot.com/10496002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140109 0039d316-1c4b-4281-b951-d872f2087c98
2012-06-01 22:05:10 +00:00
tedvessenes@gmail.com
bb8074e992 Remove old PostDelayedTask interfaces that use int ms instead of TimeDelta.
BUG=108171


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140102 0039d316-1c4b-4281-b951-d872f2087c98
2012-06-01 21:33:00 +00:00
willchan@chromium.org
48d4ea54bb Add BrowserThread::PostBlockingTaskAndReply.
BUG=none
TEST=none


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131352 0039d316-1c4b-4281-b951-d872f2087c98
2012-04-09 13:26:40 +00:00
rsleevi@chromium.org
4691586429 Objects that derive from RefCounted should not have public dtors
BUG=none
TEST=none


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131026 0039d316-1c4b-4281-b951-d872f2087c98
2012-04-05 22:22:05 +00:00
joth@chromium.org
f6415212bb Avoid creating BrowserThreadGlobals when we don't need to.
In tessts, it is possible for BrowserThread static methods like
IsWellKnownThread to get called when no message loops exists. We can
infer the answer for many methods from the fact the globals are
NULL without having to construct them. (constructing them can have the
undesireable side effect in these cases of hitting DCHECK for
MessageLoop::current() in the SequencedWorkerPool constructor)

BUG=117940
TEST=out/Debug/unit_tests --gtest_filter=TemplateURLPrepopulateDataTest.ProvidersFromPrefs


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126626 0039d316-1c4b-4281-b951-d872f2087c98
2012-03-14 11:57:50 +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
akalin@chromium.org
e3f7624b8c Fix up SequencedWorkerPool in preparation for making it a TaskRunner
Make SequencedWorkerPool ref-counted, merge it with ::Inner, and
make its destructor private.  Make users hold a scoped_refptr.

Fix bug where SequencedWorkerPool::Worker wasn't taking a reference
to the worker pool.

Rename SequencedWorkerPool::PostTask to PostTaskHelper.

Clean up includes and use forward declarations when possible.

Make SequencedWorkerPool::Shutdown completely thread-safe by merging
the terminating_ and shutdown_called_ flag. (Now that it's ref-counted,
it can be passed around multiple threads.)

Clean up includes and params in webkit/dom_storage a bit.

BUG=114329,114330
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123823 0039d316-1c4b-4281-b951-d872f2087c98
2012-02-27 23:09:57 +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
akalin@chromium.org
6b28d9469f Make new TaskRunner, SequencedTaskRunner, and SingleThreadTaskRunner interfaces
TaskRunner just has Post{,Delayed}Task(), SequencedTaskRunner
extends Executor to have ordering guarantees and PostNonNestable{,Delayed}Task(), and SingleThreadTaskRunner extends SequencedTaskRunner and guarantees execution on a single thread.

Move a bunch of methods from MessageLoopProxy into the TaskRunner classes and make it inherit from SingleThreadTaskRunner.

BUG=110973
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121999 0039d316-1c4b-4281-b951-d872f2087c98
2012-02-15 01:43:19 +00:00
tedvessenes@gmail.com
02798a98ff Convert use of int ms to TimeDelta in files owned by brettw.
BUG=108171
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119321 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-27 00:45:33 +00:00
fischman@chromium.org
67f92bc3e4 Convert all remaining explicit LeakyLazyInstanceTraits users to ::Leaky
and hide LeakyLazyInstanceTraits in base::internal to discourage cargo-culting
new users.

BUG=none
TEST=none


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119173 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-26 01:56:19 +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
hbono@chromium.org
4f67d17c87 Revert 117824 - Convert use of int ms to TimeDelta in files owned by brettw.
This change broke Linux and Mac bots. I would recommend to ask committers to run your next change on trybots.

(*1) http://chromegw.corp.google.com/i/chromium/builders/Mac/builds/10788/steps/compile/logs/stdio
(*2) http://chromegw.corp.google.com/i/chromium/builders/Linux/builds/19313/steps/compile/logs/stdio
(*3) http://chromegw.corp.google.com/i/chromium/builders/Linux%20x64/builds/21385/steps/compile/logs/stdio

R=brettw@chromium.org
BUG=108171
TEST=


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

TBR=tedvessenes@gmail.com
Review URL: http://codereview.chromium.org/9215005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117825 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-16 02:38:51 +00:00
tedvessenes@gmail.com
14b95f1e35 Convert use of int ms to TimeDelta in files owned by brettw.
R=brettw@chromium.org
BUG=108171
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117824 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-16 01:46:26 +00:00
jam@chromium.org
26f76a49e6 Get rid of BrowserThread::WEB_SOCKET_PROXY. BrowserThread is only for threads that are used in many places. In cases where a specific feature/class needs a thread, it should just create it directly. Add a comment about this in BrowserThread.
Review URL: http://codereview.chromium.org/9146007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117061 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-10 18:49:09 +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
joth@chromium.org
e1dd56245e Deprecate WEBKIT thread
BUG=106839
TEST=try servers pass


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115116 0039d316-1c4b-4281-b951-d872f2087c98
2011-12-20 12:28:58 +00:00
joi@chromium.org
ed10dd138c Remove BrowserThread::UnsafeGetBrowserThread, add UnsafeGetMessageLoopForThread.
This also removes several accessors on BrowserProcess that are no longer used.

I wanted to remove all retrieval of MessageLoop objects via BrowserThread, but this proved harder than it looked, because several net:: classes use MessageLoop and have fairly deep assumptions that it is a real MessageLoop, e.g. they use MessageLoopForIO with its IO observers and so forth.  Therefore, we now have UnsafeGetMessageLoopForThread but UnsafeGetBrowserThread is gone.

TBR=abodenha@chromium.org
BUG=98716


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113377 0039d316-1c4b-4281-b951-d872f2087c98
2011-12-07 12:03:42 +00:00
michaeln@google.com
31dbf9db05 Create a secondary file thread, FILE_USER_BLOCKING, for tasks requiring file IO which have user waiting for the results. Process appcache background tasks on that thread.
BUG=68894,78359
Review URL: http://codereview.chromium.org/8366020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113317 0039d316-1c4b-4281-b951-d872f2087c98
2011-12-07 01:25:30 +00:00
joi@chromium.org
dd483706e5 Remove IOThread::message_loop().
Instead introduce BrowserThread::UnsafeGetMessageLoop which is used in
a couple of places.  This will be removed in a follow-up change.  I
could have used UnsafeGetBrowserThread(id)->message_loop() but this is
even easier to search for.

Also, remove a couple of BrowserProcess accessors that aren't used by anybody, and that were using UnsafeGetBrowserThread.

TBR=battre@chromium.org
BUG=98716


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

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

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

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110076 0039d316-1c4b-4281-b951-d872f2087c98
2011-11-15 13:31:49 +00:00
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
joi@chromium.org
d583c3a30d Thread::Stop() must be called before any subclass's destructor completes.
Update base::Thread documentation, fix all subclasses I could find
that had a problem, and remove no-longer-necessary suppressions.

BUG=102134

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108296 0039d316-1c4b-4281-b951-d872f2087c98
2011-11-02 15:31:56 +00:00
joi@chromium.org
631bb742a2 Move BrowserThread to content namespace.
TBR=owners
BUG=98716

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108270 0039d316-1c4b-4281-b951-d872f2087c98
2011-11-02 11:29:39 +00:00
joi@chromium.org
b535b3943f Quick fix for memory race inherent to all subclasses of base::Thread.
This is a local fix because TSAN is complaining only about this
particular case.  A follow-up change (which will likely take more
time) will make sure this is OK across the code-base.

BUG=98716,102134


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107755 0039d316-1c4b-4281-b951-d872f2087c98
2011-10-28 18:20:24 +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