mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -31,29 +31,6 @@ class CefThreadMessageLoopProxy : public MessageLoopProxy {
|
||||
}
|
||||
|
||||
// MessageLoopProxy implementation.
|
||||
virtual bool PostTask(const tracked_objects::Location& from_here,
|
||||
Task* task) OVERRIDE {
|
||||
return CefThread::PostTask(id_, from_here, task);
|
||||
}
|
||||
|
||||
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
|
||||
Task* task, int64 delay_ms) OVERRIDE {
|
||||
return CefThread::PostDelayedTask(id_, from_here, task, delay_ms);
|
||||
}
|
||||
|
||||
virtual bool PostNonNestableTask(const tracked_objects::Location& from_here,
|
||||
Task* task) OVERRIDE {
|
||||
return CefThread::PostNonNestableTask(id_, from_here, task);
|
||||
}
|
||||
|
||||
virtual bool PostNonNestableDelayedTask(
|
||||
const tracked_objects::Location& from_here,
|
||||
Task* task,
|
||||
int64 delay_ms) OVERRIDE {
|
||||
return CefThread::PostNonNestableDelayedTask(id_, from_here, task,
|
||||
delay_ms);
|
||||
}
|
||||
|
||||
virtual bool PostTask(const tracked_objects::Location& from_here,
|
||||
const base::Closure& task) OVERRIDE {
|
||||
return CefThread::PostTask(id_, from_here, task);
|
||||
@@ -168,38 +145,6 @@ bool CefThread::CurrentlyOn(ID identifier) {
|
||||
cef_threads_[identifier]->message_loop() == MessageLoop::current();
|
||||
}
|
||||
|
||||
// static
|
||||
bool CefThread::PostTask(ID identifier,
|
||||
const tracked_objects::Location& from_here,
|
||||
Task* task) {
|
||||
return PostTaskHelper(identifier, from_here, task, 0, true);
|
||||
}
|
||||
|
||||
// static
|
||||
bool CefThread::PostDelayedTask(ID identifier,
|
||||
const tracked_objects::Location& from_here,
|
||||
Task* task,
|
||||
int64 delay_ms) {
|
||||
return PostTaskHelper(identifier, from_here, task, delay_ms, true);
|
||||
}
|
||||
|
||||
// static
|
||||
bool CefThread::PostNonNestableTask(
|
||||
ID identifier,
|
||||
const tracked_objects::Location& from_here,
|
||||
Task* task) {
|
||||
return PostTaskHelper(identifier, from_here, task, 0, false);
|
||||
}
|
||||
|
||||
// static
|
||||
bool CefThread::PostNonNestableDelayedTask(
|
||||
ID identifier,
|
||||
const tracked_objects::Location& from_here,
|
||||
Task* task,
|
||||
int64 delay_ms) {
|
||||
return PostTaskHelper(identifier, from_here, task, delay_ms, false);
|
||||
}
|
||||
|
||||
// static
|
||||
bool CefThread::PostTask(ID identifier,
|
||||
const tracked_objects::Location& from_here,
|
||||
@@ -254,47 +199,6 @@ scoped_refptr<MessageLoopProxy> CefThread::GetMessageLoopProxyForThread(
|
||||
return proxy;
|
||||
}
|
||||
|
||||
// static
|
||||
bool CefThread::PostTaskHelper(
|
||||
ID identifier,
|
||||
const tracked_objects::Location& from_here,
|
||||
Task* task,
|
||||
int64 delay_ms,
|
||||
bool nestable) {
|
||||
DCHECK(identifier >= 0 && identifier < ID_COUNT);
|
||||
// Optimization: to avoid unnecessary locks, we listed the ID enumeration in
|
||||
// order of lifetime. So no need to lock if we know that the other thread
|
||||
// outlives this one.
|
||||
// Note: since the array is so small, ok to loop instead of creating a map,
|
||||
// which would require a lock because std::map isn't thread safe, defeating
|
||||
// the whole purpose of this optimization.
|
||||
ID current_thread;
|
||||
bool guaranteed_to_outlive_target_thread =
|
||||
GetCurrentThreadIdentifier(¤t_thread) &&
|
||||
current_thread >= identifier;
|
||||
|
||||
if (!guaranteed_to_outlive_target_thread)
|
||||
lock_.Acquire();
|
||||
|
||||
MessageLoop* message_loop = cef_threads_[identifier] ?
|
||||
cef_threads_[identifier]->message_loop() : NULL;
|
||||
if (message_loop) {
|
||||
if (nestable) {
|
||||
message_loop->PostDelayedTask(from_here, task, delay_ms);
|
||||
} else {
|
||||
message_loop->PostNonNestableDelayedTask(from_here, task, delay_ms);
|
||||
}
|
||||
} else {
|
||||
delete task;
|
||||
}
|
||||
|
||||
if (!guaranteed_to_outlive_target_thread)
|
||||
lock_.Release();
|
||||
|
||||
return !!message_loop;
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
bool CefThread::PostTaskHelper(
|
||||
ID identifier,
|
||||
|
Reference in New Issue
Block a user