diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 17:58:12 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 17:58:12 +0000 |
commit | d7dacc349fced8c112f38a44bad0df7cde349be2 (patch) | |
tree | b6fe3724567c0a842dae5a2d0e1255ad59a2e13d /cc/thread_proxy.cc | |
parent | 4cecda3758549aacdfceb234e70c8b0d334c2d37 (diff) | |
download | chromium_src-d7dacc349fced8c112f38a44bad0df7cde349be2.zip chromium_src-d7dacc349fced8c112f38a44bad0df7cde349be2.tar.gz chromium_src-d7dacc349fced8c112f38a44bad0df7cde349be2.tar.bz2 |
cc: Use base::Passed in ThreadProxy
R=jamesr@chromium.org
BUG=none
Review URL: https://codereview.chromium.org/11358026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/thread_proxy.cc')
-rw-r--r-- | cc/thread_proxy.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc index 688d1e3..64152f6 100644 --- a/cc/thread_proxy.cc +++ b/cc/thread_proxy.cc @@ -155,7 +155,7 @@ bool ThreadProxy::initializeContext() if (!context.get()) return false; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::initializeContextOnImplThread, base::Unretained(this), context.release())); + Proxy::implThread()->postTask(base::Bind(&ThreadProxy::initializeContextOnImplThread, base::Unretained(this), base::Passed(context.Pass()))); return true; } @@ -234,7 +234,7 @@ bool ThreadProxy::recreateContext() Proxy::implThread()->postTask(base::Bind(&ThreadProxy::recreateContextOnImplThread, base::Unretained(this), &completion, - context.release(), + base::Passed(context.Pass()), &recreateSucceeded, &capabilities)); completion.wait(); @@ -346,7 +346,7 @@ void ThreadProxy::postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animati { DCHECK(isImplThread()); TRACE_EVENT0("cc", "ThreadProxy::postAnimationEventsToMainThreadOnImplThread"); - m_mainThreadProxy->postTask(FROM_HERE, base::Bind(&ThreadProxy::setAnimationEvents, base::Unretained(this), events.release(), wallClockTime)); + m_mainThreadProxy->postTask(FROM_HERE, base::Bind(&ThreadProxy::setAnimationEvents, base::Unretained(this), base::Passed(events.Pass()), wallClockTime)); } bool ThreadProxy::reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) @@ -861,10 +861,8 @@ void ThreadProxy::didCompleteSwapBuffers() m_layerTreeHost->didCompleteSwapBuffers(); } -void ThreadProxy::setAnimationEvents(AnimationEventsVector* passed_events, base::Time wallClockTime) +void ThreadProxy::setAnimationEvents(scoped_ptr<AnimationEventsVector> events, base::Time wallClockTime) { - scoped_ptr<AnimationEventsVector> events(make_scoped_ptr(passed_events)); - TRACE_EVENT0("cc", "ThreadProxy::setAnimationEvents"); DCHECK(isMainThread()); if (!m_layerTreeHost) @@ -913,11 +911,11 @@ void ThreadProxy::initializeImplOnImplThread(CompletionEvent* completion, InputH completion->signal(); } -void ThreadProxy::initializeContextOnImplThread(GraphicsContext* context) +void ThreadProxy::initializeContextOnImplThread(scoped_ptr<GraphicsContext> context) { TRACE_EVENT0("cc", "ThreadProxy::initializeContextOnImplThread"); DCHECK(isImplThread()); - m_contextBeforeInitializationOnImplThread = scoped_ptr<GraphicsContext>(context).Pass(); + m_contextBeforeInitializationOnImplThread = context.Pass(); } void ThreadProxy::initializeRendererOnImplThread(CompletionEvent* completion, bool* initializeSucceeded, RendererCapabilities* capabilities) @@ -959,14 +957,14 @@ size_t ThreadProxy::maxPartialTextureUpdates() const return ResourceUpdateController::maxPartialTextureUpdates(); } -void ThreadProxy::recreateContextOnImplThread(CompletionEvent* completion, GraphicsContext* contextPtr, bool* recreateSucceeded, RendererCapabilities* capabilities) +void ThreadProxy::recreateContextOnImplThread(CompletionEvent* completion, scoped_ptr<GraphicsContext> context, bool* recreateSucceeded, RendererCapabilities* capabilities) { TRACE_EVENT0("cc", "ThreadProxy::recreateContextOnImplThread"); DCHECK(isImplThread()); ResourceProvider::debugNotifyEnterZone(0x7000000); m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider()); ResourceProvider::debugNotifyLeaveZone(); - *recreateSucceeded = m_layerTreeHostImpl->initializeRenderer(scoped_ptr<GraphicsContext>(contextPtr).Pass()); + *recreateSucceeded = m_layerTreeHostImpl->initializeRenderer(context.Pass()); if (*recreateSucceeded) { *capabilities = m_layerTreeHostImpl->rendererCapabilities(); m_schedulerOnImplThread->didRecreateContext(); |