diff options
author | danakj <danakj@chromium.org> | 2014-09-26 19:39:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-27 02:39:41 +0000 |
commit | 7bb3dbede19d87f0338797756ffd738adc6bca08 (patch) | |
tree | ecd66a8fe850e5c57833a673fb39c41dbe27ffeb /cc/trees/single_thread_proxy.cc | |
parent | a60566701028a7344d17826076780eeb84b63052 (diff) | |
download | chromium_src-7bb3dbede19d87f0338797756ffd738adc6bca08.zip chromium_src-7bb3dbede19d87f0338797756ffd738adc6bca08.tar.gz chromium_src-7bb3dbede19d87f0338797756ffd738adc6bca08.tar.bz2 |
cc: Remove use of PassAs() and constructor-casting with scoped_ptr.
Say you have class A and subclass B.
Previously it was required to PassAs() a scoped_ptr<B> into a
scoped_ptr<A>. This is no longer needed, so just use Pass(). For newly
created scoped_ptrs, you can just use make_scoped_ptr always now.
And when you want to return or assign an empty scoped_ptr(), you can
now use nullptr directly.
Also adds PRESUBMIT checks for:
- return scoped<T>(foo). This should be return make_scoped_ptr(foo).
- bar = scoped<T>(foo). This should be return bar = make_scoped_ptr(foo).
- return scoped<T>(). This should be return nullptr.
- bar = scoped<T>(). This should be return bar = nullptr.
This also replaces p.reset() with p = nullptr; But it does not add a
PRESUBMIT check for that because there are things other than scoped_ptr
with a reset() function.
R=enne@chromium.org
Review URL: https://codereview.chromium.org/609663003
Cr-Commit-Position: refs/heads/master@{#297096}
Diffstat (limited to 'cc/trees/single_thread_proxy.cc')
-rw-r--r-- | cc/trees/single_thread_proxy.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index 97b06bc..b3712b6 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc @@ -26,8 +26,7 @@ scoped_ptr<Proxy> SingleThreadProxy::Create( LayerTreeHostSingleThreadClient* client, scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) { return make_scoped_ptr( - new SingleThreadProxy(layer_tree_host, client, main_task_runner)) - .PassAs<Proxy>(); + new SingleThreadProxy(layer_tree_host, client, main_task_runner)); } SingleThreadProxy::SingleThreadProxy( @@ -314,8 +313,8 @@ void SingleThreadProxy::Stop() { blocking_main_thread_task_runner()); layer_tree_host_->DeleteContentsTexturesOnImplThread( layer_tree_host_impl_->resource_provider()); - scheduler_on_impl_thread_.reset(); - layer_tree_host_impl_.reset(); + scheduler_on_impl_thread_ = nullptr; + layer_tree_host_impl_ = nullptr; } layer_tree_host_ = NULL; } |