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

Side by Side Diff: chrome/browser/media/media_stream_capture_indicator.h

Issue 10825313: MediaStreamCaptureIndicator: fix crash due to destruction on wrong thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | chrome/browser/media/media_stream_capture_indicator.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_MEDIA_MEDIA_STREAM_CAPTURE_INDICATOR_H_ 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_STREAM_CAPTURE_INDICATOR_H_
6 #define CHROME_BROWSER_MEDIA_MEDIA_STREAM_CAPTURE_INDICATOR_H_ 6 #define CHROME_BROWSER_MEDIA_MEDIA_STREAM_CAPTURE_INDICATOR_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/extensions/image_loading_tracker.h" 13 #include "chrome/browser/extensions/image_loading_tracker.h"
13 #include "content/public/common/media_stream_request.h" 14 #include "content/public/common/media_stream_request.h"
14 #include "ui/base/models/simple_menu_model.h" 15 #include "ui/base/models/simple_menu_model.h"
15 #include "ui/gfx/image/image_skia.h" 16 #include "ui/gfx/image/image_skia.h"
16 17
17 class StatusIcon; 18 class StatusIcon;
18 class StatusTray; 19 class StatusTray;
19 20
20 // This indicator is owned by MediaInternals and deleted when MediaInternals 21 // This indicator is owned by MediaInternals and deleted when MediaInternals
21 // is deleted. 22 // is deleted.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 121
121 // Updates the status tray menu with the new device list. This call will be 122 // Updates the status tray menu with the new device list. This call will be
122 // triggered by both AddCaptureDeviceTab() and RemoveCaptureDeviceTab(). 123 // triggered by both AddCaptureDeviceTab() and RemoveCaptureDeviceTab().
123 void UpdateStatusTrayIconContextMenu(); 124 void UpdateStatusTrayIconContextMenu();
124 125
125 // Updates the status tray tooltip and image according to which kind of 126 // Updates the status tray tooltip and image according to which kind of
126 // devices are being used. This function is called by 127 // devices are being used. This function is called by
127 // UpdateStatusTrayIconContextMenu(). 128 // UpdateStatusTrayIconContextMenu().
128 void UpdateStatusTrayIconDisplay(bool audio, bool video); 129 void UpdateStatusTrayIconDisplay(bool audio, bool video);
129 130
131 // Initializes image loading state.
132 void EnsureImageLoadingTracker();
133
130 // Reference to our status icon - owned by the StatusTray. If null, 134 // Reference to our status icon - owned by the StatusTray. If null,
131 // the platform doesn't support status icons. 135 // the platform doesn't support status icons.
132 StatusIcon* status_icon_; 136 StatusIcon* status_icon_;
133 137
134 // These images are owned by ResourceBundle and need not be destroyed. 138 // These images are owned by ResourceBundle and need not be destroyed.
135 gfx::ImageSkia* mic_image_; 139 gfx::ImageSkia* mic_image_;
136 gfx::ImageSkia* camera_image_; 140 gfx::ImageSkia* camera_image_;
137 gfx::ImageSkia* balloon_image_; 141 gfx::ImageSkia* balloon_image_;
138 142
139 // A list that contains the usage information of the opened capture devices. 143 // A list that contains the usage information of the opened capture devices.
140 typedef std::vector<CaptureDeviceTab> CaptureDeviceTabs; 144 typedef std::vector<CaptureDeviceTab> CaptureDeviceTabs;
141 CaptureDeviceTabs tabs_; 145 CaptureDeviceTabs tabs_;
142 146
143 // Tracks the load of extension icons. 147 // Tracks the load of extension icons.
144 ImageLoadingTracker tracker_; 148 scoped_ptr<ImageLoadingTracker> tracker_;
145 // The messages to display when extension images are loaded. The index 149 // The messages to display when extension images are loaded. The index
146 // corresponds to the index of the associated LoadImage request. 150 // corresponds to the index of the associated LoadImage request.
147 std::map<int, string16> pending_messages_; 151 std::map<int, string16> pending_messages_;
148 // Tracks the number of requests to |tracker_|. 152 // Tracks the number of requests to |tracker_|.
149 int request_index_; 153 int request_index_;
150 }; 154 };
151 155
152 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_CAPTURE_INDICATOR_H_ 156 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_CAPTURE_INDICATOR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/media_stream_capture_indicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698