Update to Chromium revision 119867.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@504 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-02-17 14:51:20 +00:00
parent c04103744c
commit a3e0935ce3
34 changed files with 284 additions and 431 deletions

View File

@@ -9,7 +9,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "base/task.h"
#include "base/threading/thread.h"
#if defined(OS_MACOSX)
@@ -71,37 +70,11 @@ class CefThread : public base::Thread {
virtual ~CefThread();
// These methods are the same as in message_loop.h, but are guaranteed to
// either post the Task to the MessageLoop (if it's still alive), or to
// delete the Task otherwise.
// They return true if the thread existed and the task was posted. Note that
// even if the task is posted, there's no guarantee that it will run; for
// example the target loop may already be quitting, or in the case of a
// delayed task a Quit message may preempt it in the message loop queue.
// Conversely, a return value of false is a guarantee the task will not run.
static bool PostTask(ID identifier,
const tracked_objects::Location& from_here,
Task* task);
static bool PostDelayedTask(ID identifier,
const tracked_objects::Location& from_here,
Task* task,
int64 delay_ms);
static bool PostNonNestableTask(ID identifier,
const tracked_objects::Location& from_here,
Task* task);
static bool PostNonNestableDelayedTask(
ID identifier,
const tracked_objects::Location& from_here,
Task* task,
int64 delay_ms);
// TODO(ajwong): Remove the functions above once the Task -> Closure migration
// is complete.
//
// There are 2 sets of Post*Task functions, one which takes the older Task*
// function object representation, and one that takes the newer base::Closure.
// We have this overload to allow a staged transition between the two systems.
// Once the transition is done, the functions above should be deleted.
// These are the same methods in message_loop.h, but are guaranteed to either
// get posted to the MessageLoop if it's still alive, or be deleted otherwise.
// They return true iff the thread existed and the task was posted. Note that
// even if the task is posted, there's no guarantee that it will run, since
// the target thread may already have a Quit message in its queue.
static bool PostTask(ID identifier,
const tracked_objects::Location& from_here,
const base::Closure& task);
@@ -121,17 +94,17 @@ class CefThread : public base::Thread {
template <class T>
static bool DeleteSoon(ID identifier,
const tracked_objects::Location& from_here,
T* object) {
return PostNonNestableTask(
identifier, from_here, new DeleteTask<T>(object));
const T* object) {
return GetMessageLoopProxyForThread(identifier)->DeleteSoon(
from_here, object);
}
template <class T>
static bool ReleaseSoon(ID identifier,
const tracked_objects::Location& from_here,
T* object) {
return PostNonNestableTask(
identifier, from_here, new ReleaseTask<T>(object));
const T* object) {
return GetMessageLoopProxyForThread(identifier)->ReleaseSoon(
from_here, object);
}
// Callable on any thread. Returns whether the given ID corresponds to a well
@@ -193,13 +166,6 @@ class CefThread : public base::Thread {
// Common initialization code for the constructors.
void Initialize();
static bool PostTaskHelper(
ID identifier,
const tracked_objects::Location& from_here,
Task* task,
int64 delay_ms,
bool nestable);
static bool PostTaskHelper(
ID identifier,
const tracked_objects::Location& from_here,