Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: chrome/browser/icon_loader.cc

Issue 233001: Coverity: Initialize target_message_loop_ in the constructor.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/icon_loader.h" 5 #include "chrome/browser/icon_loader.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/mime_util.h" 8 #include "base/mime_util.h"
9 #include "base/thread.h" 9 #include "base/thread.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "third_party/skia/include/core/SkBitmap.h" 11 #include "third_party/skia/include/core/SkBitmap.h"
12 12
13 IconLoader::IconLoader(const IconGroupID& group, IconSize size, 13 IconLoader::IconLoader(const IconGroupID& group, IconSize size,
14 Delegate* delegate) 14 Delegate* delegate)
15 : group_(group), 15 : target_message_loop_(NULL),
16 group_(group),
16 icon_size_(size), 17 icon_size_(size),
17 bitmap_(NULL), 18 bitmap_(NULL),
18 delegate_(delegate) { 19 delegate_(delegate) {
19 } 20 }
20 21
21 IconLoader::~IconLoader() { 22 IconLoader::~IconLoader() {
22 delete bitmap_; 23 delete bitmap_;
23 } 24 }
24 25
25 void IconLoader::Start() { 26 void IconLoader::Start() {
26 target_message_loop_ = MessageLoop::current(); 27 target_message_loop_ = MessageLoop::current();
27 28
28 #if defined(OS_LINUX) 29 #if defined(OS_LINUX)
29 // This call must happen on the UI thread before we can start loading icons. 30 // This call must happen on the UI thread before we can start loading icons.
30 mime_util::DetectGtkTheme(); 31 mime_util::DetectGtkTheme();
31 #endif 32 #endif
32 33
33 g_browser_process->file_thread()->message_loop()->PostTask(FROM_HERE, 34 g_browser_process->file_thread()->message_loop()->PostTask(FROM_HERE,
34 NewRunnableMethod(this, &IconLoader::ReadIcon)); 35 NewRunnableMethod(this, &IconLoader::ReadIcon));
35 } 36 }
36 37
37 void IconLoader::NotifyDelegate() { 38 void IconLoader::NotifyDelegate() {
38 if (delegate_->OnBitmapLoaded(this, bitmap_)) 39 if (delegate_->OnBitmapLoaded(this, bitmap_))
39 bitmap_ = NULL; 40 bitmap_ = NULL;
40 } 41 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698