summaryrefslogtreecommitdiffstats
path: root/ui/base/resource
diff options
context:
space:
mode:
authortfarina <tfarina@chromium.org>2014-12-11 07:34:52 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-11 15:35:24 +0000
commit508e2a6fc04fdc19a0d5fadccacd7eee97a3aba0 (patch)
tree347de7bb63d6a60f47629877b18acfd14c348a41 /ui/base/resource
parent37540431fed381e9d0359afd367423a83caafa83 (diff)
downloadchromium_src-508e2a6fc04fdc19a0d5fadccacd7eee97a3aba0.zip
chromium_src-508e2a6fc04fdc19a0d5fadccacd7eee97a3aba0.tar.gz
chromium_src-508e2a6fc04fdc19a0d5fadccacd7eee97a3aba0.tar.bz2
ui/base: Cleanup usage of scoped_ptr.
* Use make_scoped_ptr() when possible (less typing/noise). * Return nullptr whenever possible. The entries were found with the following command line: $ git grep -E '(=|\breturn)\s*scoped_ptr<.*?>([^)]+)' ui/aura BUG=None TEST=ui_base_unittests R=sky@chromium.org Review URL: https://codereview.chromium.org/792503004 Cr-Commit-Position: refs/heads/master@{#307902}
Diffstat (limited to 'ui/base/resource')
-rw-r--r--ui/base/resource/resource_bundle.cc4
-rw-r--r--ui/base/resource/resource_bundle_unittest.cc2
2 files changed, 3 insertions, 3 deletions
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc
index 10fa783..b08a580 100644
--- a/ui/base/resource/resource_bundle.cc
+++ b/ui/base/resource/resource_bundle.cc
@@ -753,8 +753,8 @@ scoped_ptr<gfx::FontList> ResourceBundle::GetFontListFromDelegate(
DCHECK(delegate_);
scoped_ptr<gfx::Font> font = delegate_->GetFont(style);
if (font.get())
- return scoped_ptr<gfx::FontList>(new gfx::FontList(*font));
- return scoped_ptr<gfx::FontList>();
+ return make_scoped_ptr(new gfx::FontList(*font));
+ return nullptr;
}
bool ResourceBundle::LoadBitmap(const ResourceHandle& data_handle,
diff --git a/ui/base/resource/resource_bundle_unittest.cc b/ui/base/resource/resource_bundle_unittest.cc
index 4acf863..c290e49 100644
--- a/ui/base/resource/resource_bundle_unittest.cc
+++ b/ui/base/resource/resource_bundle_unittest.cc
@@ -90,7 +90,7 @@ class MockResourceBundleDelegate : public ui::ResourceBundle::Delegate {
gfx::Font*(ui::ResourceBundle::FontStyle style));
virtual scoped_ptr<gfx::Font> GetFont(
ui::ResourceBundle::FontStyle style) override {
- return scoped_ptr<gfx::Font>(GetFontMock(style));
+ return make_scoped_ptr(GetFontMock(style));
}
};