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

Side by Side Diff: chrome/browser/media/webrtc/desktop_media_list_base.cc

Issue 2823003002: SkBitmap and SkPixelRef no longer need lock/unlock (Closed)
Patch Set: win fix after rebase Created 3 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/media/webrtc/desktop_media_list_base.h" 5 #include "chrome/browser/media/webrtc/desktop_media_list_base.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "chrome/browser/media/webrtc/desktop_media_list_observer.h" 9 #include "chrome/browser/media/webrtc/desktop_media_list_observer.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 void DesktopMediaListBase::ScheduleNextRefresh() { 130 void DesktopMediaListBase::ScheduleNextRefresh() {
131 BrowserThread::PostDelayedTask( 131 BrowserThread::PostDelayedTask(
132 BrowserThread::UI, FROM_HERE, 132 BrowserThread::UI, FROM_HERE,
133 base::Bind(&DesktopMediaListBase::Refresh, weak_factory_.GetWeakPtr()), 133 base::Bind(&DesktopMediaListBase::Refresh, weak_factory_.GetWeakPtr()),
134 update_period_); 134 update_period_);
135 } 135 }
136 136
137 // static 137 // static
138 uint32_t DesktopMediaListBase::GetImageHash(const gfx::Image& image) { 138 uint32_t DesktopMediaListBase::GetImageHash(const gfx::Image& image) {
139 SkBitmap bitmap = image.AsBitmap(); 139 SkBitmap bitmap = image.AsBitmap();
140 bitmap.lockPixels();
141 uint32_t value = 140 uint32_t value =
142 base::Hash(reinterpret_cast<char*>(bitmap.getPixels()), bitmap.getSize()); 141 base::Hash(reinterpret_cast<char*>(bitmap.getPixels()), bitmap.getSize());
143 bitmap.unlockPixels();
144
145 return value; 142 return value;
146 } 143 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698