Fix compilation errors on OS X

This commit is contained in:
Cheng Zhao 2016-03-08 23:28:53 +09:00
parent 4503aafe64
commit 5fae63a2f5
93 changed files with 242 additions and 317 deletions

View file

@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_H_
#define CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_LIST_H_
#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "base/time/time.h"
#include "content/public/browser/desktop_media_id.h"

View file

@ -34,7 +34,7 @@ const int kDefaultUpdatePeriod = 1000;
// Returns a hash of a DesktopFrame content to detect when image for a desktop
// media source has changed.
uint32 GetFrameHash(webrtc::DesktopFrame* frame) {
uint32_t GetFrameHash(webrtc::DesktopFrame* frame) {
int data_size = frame->stride() * frame->size().height();
return base::SuperFastHash(reinterpret_cast<char*>(frame->data()), data_size);
}
@ -117,8 +117,8 @@ NativeDesktopMediaList::Worker::Worker(
scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
scoped_ptr<webrtc::WindowCapturer> window_capturer)
: media_list_(media_list),
screen_capturer_(screen_capturer.Pass()),
window_capturer_(window_capturer.Pass()) {
screen_capturer_(std::move(screen_capturer)),
window_capturer_(std::move(window_capturer)) {
if (screen_capturer_)
screen_capturer_->Start(this);
if (window_capturer_)
@ -195,14 +195,14 @@ void NativeDesktopMediaList::Worker::Refresh(
// |current_frame_| may be NULL if capture failed (e.g. because window has
// been closed).
if (current_frame_) {
uint32 frame_hash = GetFrameHash(current_frame_.get());
uint32_t frame_hash = GetFrameHash(current_frame_.get());
new_image_hashes[source.id] = frame_hash;
// Scale the image only if it has changed.
ImageHashesMap::iterator it = image_hashes_.find(source.id);
if (it == image_hashes_.end() || it->second != frame_hash) {
gfx::ImageSkia thumbnail =
ScaleDesktopFrame(current_frame_.Pass(), thumbnail_size);
ScaleDesktopFrame(std::move(current_frame_), thumbnail_size);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&NativeDesktopMediaList::OnSourceThumbnail,
@ -231,8 +231,8 @@ void NativeDesktopMediaList::Worker::OnCaptureCompleted(
NativeDesktopMediaList::NativeDesktopMediaList(
scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
scoped_ptr<webrtc::WindowCapturer> window_capturer)
: screen_capturer_(screen_capturer.Pass()),
window_capturer_(window_capturer.Pass()),
: screen_capturer_(std::move(screen_capturer)),
window_capturer_(std::move(window_capturer)),
update_period_(base::TimeDelta::FromMilliseconds(kDefaultUpdatePeriod)),
thumbnail_size_(100, 100),
view_dialog_id_(-1),
@ -269,7 +269,8 @@ void NativeDesktopMediaList::StartUpdating(DesktopMediaListObserver* observer) {
observer_ = observer;
worker_.reset(new Worker(weak_factory_.GetWeakPtr(),
screen_capturer_.Pass(), window_capturer_.Pass()));
std::move(screen_capturer_),
std::move(window_capturer_)));
Refresh();
}

View file

@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_MEDIA_NATIVE_DESKTOP_MEDIA_LIST_H_
#define CHROME_BROWSER_MEDIA_NATIVE_DESKTOP_MEDIA_LIST_H_
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner.h"