// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/profiles/avatar_menu.h"

#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"

// static
void AvatarMenu::GetImageForMenuButton(Profile* profile,
                                       gfx::Image* image,
                                       bool* is_rectangle) {
  ProfileInfoCache& cache =
      g_browser_process->profile_manager()->GetProfileInfoCache();
  size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
  if (index == std::string::npos) {
    NOTREACHED();
    return;
  }

  *image = cache.GetAvatarIconOfProfileAtIndex(index);
  *is_rectangle =
      cache.IsUsingGAIAPictureOfProfileAtIndex(index) &&
      cache.GetGAIAPictureOfProfileAtIndex(index);
}

// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/profiles/avatar_menu.h"

#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "ui/base/resource/resource_bundle.h"

// static
void AvatarMenu::GetImageForMenuButton(Profile* profile,
                                       gfx::Image* image,
                                       bool* is_rectangle) {
  ProfileInfoCache& cache =
      g_browser_process->profile_manager()->GetProfileInfoCache();
  size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
  if (index == std::string::npos) {
    NOTREACHED();
    return;
  }

  // Ensure we are using the default resource, not the downloaded high-res one.
  const size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(index);
  const int resource_id =
      profiles::GetDefaultAvatarIconResourceIDAtIndex(icon_index);
  *image = ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
  *is_rectangle =
      cache.IsUsingGAIAPictureOfProfileAtIndex(index) &&
      cache.GetGAIAPictureOfProfileAtIndex(index);
}

[Win] Use the default, non-high-res avatar when badging the taskbar.

BUG=374173
TEST=Start Chrome with --new-profile-management. Open and 'Incognito' window.
The taksbar icon should now have a grey background.

Review URL: https://codereview.chromium.org/286933008

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@271862 0039d316-1c4b-4281-b951-d872f2087c98


// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/ui_test_utils.h"
#include "net/base/mock_host_resolver.h"

IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebSocket) {
  FilePath websocket_root_dir;
  PathService::Get(chrome::DIR_TEST_DATA, &websocket_root_dir);
  websocket_root_dir = websocket_root_dir.AppendASCII("layout_tests")
      .AppendASCII("LayoutTests");
  ui_test_utils::TestWebSocketServer server(websocket_root_dir);
  ASSERT_TRUE(RunExtensionTest("websocket")) << message_;
}

// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/ui_test_utils.h"
#include "net/base/mock_host_resolver.h"

// Disable this test on Linux, because it fails
// http://crbug.com/40976
#if defined(OS_LINUX)
#define WebSocket DISABLED_WebSocket
#endif

IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebSocket) {
  FilePath websocket_root_dir;
  PathService::Get(chrome::DIR_TEST_DATA, &websocket_root_dir);
  websocket_root_dir = websocket_root_dir.AppendASCII("layout_tests")
      .AppendASCII("LayoutTests");
  ui_test_utils::TestWebSocketServer server(websocket_root_dir);
  ASSERT_TRUE(RunExtensionTest("websocket")) << message_;
}

Disable this test on Linux, because it will fail as soon as WebKit's
version is rolled forward.

TEST=none
BUG=40976

Review URL: http://codereview.chromium.org/1610016

git-svn-id: http://src.chromium.org/svn/trunk/src@44127 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 020af06a5bccc3a77f9167c0c727a4e147d02212


// Copyright (c) 2014 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "xwalk/experimental/native_file_system/virtual_root_provider.h"

#include <tzplatform_config.h>

#include <map>
#include <string>

VirtualRootProvider::VirtualRootProvider() {
  const char* names[] = {
      "CAMERA",
      "DOCUMENTS",
      "IMAGES",
      "SOUNDS",
      "VIDEOS",
  };

  tzplatform_variable dirs[] = {
      TZ_USER_CAMERA,
      TZ_USER_DOCUMENTS,
      TZ_USER_IMAGES,
      TZ_USER_SOUNDS,
      TZ_USER_VIDEOS
  };

  for (unsigned int i = 0; i < sizeof(names) / sizeof(names[0]); ++i) {
    virtual_root_map_[names[i]] =
        base::FilePath::FromUTF8Unsafe(
            std::string(tzplatform_getenv(dirs[i])));
  }

  virtual_root_map_["RINGTONES"] =
      base::FilePath::FromUTF8Unsafe(
          std::string(tzplatform_mkpath(TZ_USER_SHARE, "settings/Ringtones")));
}

// Copyright (c) 2014 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "xwalk/experimental/native_file_system/virtual_root_provider.h"

#include <tzplatform_config.h>

#include <map>
#include <string>

VirtualRootProvider::VirtualRootProvider() {
  const char* names[] = {
      "CAMERA",
      "DOCUMENTS",
      "IMAGES",
      "SOUNDS",
      "VIDEOS",
  };

  tzplatform_variable dirs[] = {
      TZ_USER_CAMERA,
      TZ_USER_DOCUMENTS,
      TZ_USER_IMAGES,
      TZ_USER_SOUNDS,
      TZ_USER_VIDEOS
  };

  for (unsigned int i = 0; i < sizeof(names) / sizeof(names[0]); ++i) {
    virtual_root_map_[names[i]] =
        base::FilePath::FromUTF8Unsafe(
            std::string(tzplatform_getenv(dirs[i])));
  }
}

Remove Ringtone from virtual root

[Tizen] Remove Ringtone from virtual root

IVI doesn't need "Ringtone" path. So, remove it.


// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2011 Daniel Marth <danielmarth@gmx.at>

// A QML-interface of Marble for the Meego operating system.

#include <QtGui/QApplication>
#include <QtDeclarative/QtDeclarative>

int main( int argc, char *argv[] )
{
    QApplication app( argc, argv );
    app.setProperty( "NoMStyle", true );

    QDir::setCurrent( app.applicationDirPath() );

    // Create main window based on QML.
    QDeclarativeView view;
    view.setSource( QUrl( "qrc:/main.qml" ) );

#ifdef __arm__
    // Window takes up full screen on arm (mobile) devices.
    view.showFullScreen();
#else
    view.resize( view.initialSize().width(), view.initialSize().height() );
    view.show();
#endif

    return app.exec();
}

// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2011 Daniel Marth <danielmarth@gmx.at>

// A QML-interface of Marble for the Meego operating system.

#include <QtGui/QApplication>
#include <QtDeclarative/QtDeclarative>

int main( int argc, char *argv[] )
{
    QApplication app( argc, argv );
    app.setProperty( "NoMStyle", true );

    QDir::setCurrent( app.applicationDirPath() );

    // Create main window based on QML.
    QDeclarativeView view;
    view.setSource( QUrl( "qrc:/main.qml" ) );

#ifdef __arm__
    // Window takes up full screen on arm (mobile) devices.
    view.showFullScreen();
#else
    if ( app.arguments().contains( "--portrait" ) ) {
        view.resize( view.initialSize().height(), view.initialSize().width() );
        view.setTransform( QTransform().rotate( 90 ) );
    } else {
        view.resize( view.initialSize().width(), view.initialSize().height() );
    }
    view.show();
#endif

    return app.exec();
}

Add the argument --portrait to marble-touch to start in portrait mode.


// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/ui_test_utils.h"
#include "net/base/mock_host_resolver.h"

IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FLAKY_WebSocket) {
  FilePath websocket_root_dir;
  PathService::Get(chrome::DIR_TEST_DATA, &websocket_root_dir);
  websocket_root_dir = websocket_root_dir.AppendASCII("layout_tests")
      .AppendASCII("LayoutTests");
  ui_test_utils::TestWebSocketServer server(websocket_root_dir);
  ASSERT_TRUE(RunExtensionTest("websocket")) << message_;
}

// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/ui_test_utils.h"
#include "net/base/mock_host_resolver.h"

// Disabled, http://crbug.com/38225
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WebSocket) {
  FilePath websocket_root_dir;
  PathService::Get(chrome::DIR_TEST_DATA, &websocket_root_dir);
  websocket_root_dir = websocket_root_dir.AppendASCII("layout_tests")
      .AppendASCII("LayoutTests");
  ui_test_utils::TestWebSocketServer server(websocket_root_dir);
  ASSERT_TRUE(RunExtensionTest("websocket")) << message_;
}

Disable ExtensionApiTest.WebSocket due to a timeout.

TBR=ukai
TEST=disabled
BUG=38225

Review URL: http://codereview.chromium.org/1002003

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@41704 0039d316-1c4b-4281-b951-d872f2087c98


#include "package_manager/packagemanagerconfig.h"

#include <boost/log/trivial.hpp>

void PackageConfig::updateFromPropertyTree(const boost::property_tree::ptree& pt) {
  CopyFromConfig(type, "type", pt);
  CopyFromConfig(os, "os", pt);
  CopyFromConfig(sysroot, "sysroot", pt);
  CopyFromConfig(ostree_server, "ostree_server", pt);
  CopyFromConfig(packages_file, "packages_file", pt);
  CopyFromConfig(fake_need_reboot, "fake_need_reboot", pt);
}

void PackageConfig::writeToStream(std::ostream& out_stream) const {
  writeOption(out_stream, type, "type");
  writeOption(out_stream, os, "os");
  writeOption(out_stream, sysroot, "sysroot");
  writeOption(out_stream, ostree_server, "ostree_server");
  writeOption(out_stream, fake_need_reboot, "fake_need_reboot");
}

std::ostream& operator<<(std::ostream& os, PackageManager pm) {
  std::string pm_str;
  switch (pm) {
    case PackageManager::kOstree:
      pm_str = "ostree";
      break;
    case PackageManager::kDebian:
      pm_str = "debian";
      break;
    case PackageManager::kNone:
    default:
      pm_str = "none";
      break;
  }
  os << '"' << pm_str << '"';
  return os;
}

#include "package_manager/packagemanagerconfig.h"

#include <boost/log/trivial.hpp>

void PackageConfig::updateFromPropertyTree(const boost::property_tree::ptree& pt) {
  CopyFromConfig(type, "type", pt);
  CopyFromConfig(os, "os", pt);
  CopyFromConfig(sysroot, "sysroot", pt);
  CopyFromConfig(ostree_server, "ostree_server", pt);
  CopyFromConfig(packages_file, "packages_file", pt);
  CopyFromConfig(fake_need_reboot, "fake_need_reboot", pt);
}

void PackageConfig::writeToStream(std::ostream& out_stream) const {
  writeOption(out_stream, type, "type");
  writeOption(out_stream, os, "os");
  writeOption(out_stream, sysroot, "sysroot");
  writeOption(out_stream, ostree_server, "ostree_server");
  writeOption(out_stream, packages_file, "packages_file");
  writeOption(out_stream, fake_need_reboot, "fake_need_reboot");
}

std::ostream& operator<<(std::ostream& os, PackageManager pm) {
  std::string pm_str;
  switch (pm) {
    case PackageManager::kOstree:
      pm_str = "ostree";
      break;
    case PackageManager::kDebian:
      pm_str = "debian";
      break;
    case PackageManager::kNone:
    default:
      pm_str = "none";
      break;
  }
  os << '"' << pm_str << '"';
  return os;
}

Add a missing writeOption in pacman config

Signed-off-by: Laurent Bonnans <0909bc0a3d1b0c91d8e00372b9633e8e9ea958de@here.com>


// Regression test for a crash in getpwnam_r and similar interceptors.
// RUN: %clangxx -O0 -g %s -o %t && %run %t

#include <assert.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int main(void) {
  struct passwd pwd;
  struct passwd *pwdres;
  char buf[10000];
  int res = getpwnam_r("no-such-user", &pwd, buf, sizeof(buf), &pwdres);
  assert(res == 0);
  assert(pwdres == 0);
  return 0;
}

// Regression test for a crash in getpwnam_r and similar interceptors.
// RUN: %clangxx -O0 -g %s -o %t && %run %t

#include <assert.h>
#include <errno.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int main(void) {
  struct passwd pwd;
  struct passwd *pwdres;
  char buf[10000];
  int res = getpwnam_r("no-such-user", &pwd, buf, sizeof(buf), &pwdres);
  assert(res == 0 || res == ENOENT);
  assert(pwdres == 0);
  return 0;
}

Fix getpwnam test on ppc64le Fedora 21.

[Sanitizer] Fix getpwnam test on ppc64le Fedora 21.

Summary:
On ppc64le Fedora 21, getpwnam_r("no-such-user", ...) returns ENOENT
instead of 0. Tolerate this in the test case.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9233

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@235654 91177308-0d34-0410-b5e6-96231b3b80d8


// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "executor_metrics.h"

namespace proton {

void
ExecutorMetrics::update(const vespalib::ThreadStackExecutorBase::Stats &stats)
{
    maxPending.set(stats.queueSize.max());
    accepted.inc(stats.acceptedTasks);
    rejected.inc(stats.rejectedTasks);
    const vespalib::ThreadStackExecutorBase::Stats::QueueSizeT & qSize = stats.queueSize;
    queueSize.addValueBatch(qSize.average(), qSize.count(), qSize.min(), qSize.max());
}

ExecutorMetrics::ExecutorMetrics(const std::string &name, metrics::MetricSet *parent)
    : metrics::MetricSet(name, {}, "Instance specific thread executor metrics", parent),
      maxPending("maxpending", {}, "Maximum number of pending (active + queued) tasks", this),
      accepted("accepted", {}, "Number of accepted tasks", this),
      rejected("rejected", {}, "Number of rejected tasks", this),
      queueSize("queuesize", {}, "size of task queue", this)
{
}

ExecutorMetrics::~ExecutorMetrics() = default;

} // namespace proton

// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "executor_metrics.h"

namespace proton {

void
ExecutorMetrics::update(const vespalib::ThreadStackExecutorBase::Stats &stats)
{
    maxPending.set(stats.queueSize.max());
    accepted.inc(stats.acceptedTasks);
    rejected.inc(stats.rejectedTasks);
    const auto & qSize = stats.queueSize;
    queueSize.addValueBatch(qSize.average(), qSize.count(), qSize.min(), qSize.max());
}

ExecutorMetrics::ExecutorMetrics(const std::string &name, metrics::MetricSet *parent)
    : metrics::MetricSet(name, {}, "Instance specific thread executor metrics", parent),
      maxPending("maxpending", {}, "Maximum number of pending (active + queued) tasks", this),
      accepted("accepted", {}, "Number of accepted tasks", this),
      rejected("rejected", {}, "Number of rejected tasks", this),
      queueSize("queuesize", {}, "Size of task queue", this)
{
}

ExecutorMetrics::~ExecutorMetrics() = default;

} // namespace proton

Use auto and captitalize first word in sentence.


// Copyright 2015-2020 Elviss Strazdins. All rights reserved.

#include <cstdlib>
#include <shellapi.h>
#include "SystemWin.hpp"
#include "EngineWin.hpp"
#include "../../utils/Log.hpp"

int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int)
{
    try
    {
        int argc;
        LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc);

        auto engine = std::make_unique<ouzel::core::windows::Engine>(argc, argv);

        if (argv) LocalFree(argv);

        engine->run();
        engine.reset(); // must release engine instance before exit on Windows
        return EXIT_SUCCESS;
    }
    catch (const std::exception& e)
    {
        ouzel::logger.log(ouzel::Log::Level::error) << e.what();
        return EXIT_FAILURE;
    }
}

namespace ouzel::core::windows
{
}

// Copyright 2015-2020 Elviss Strazdins. All rights reserved.

#include <cstdlib>
#include <shellapi.h>
#include "SystemWin.hpp"
#include "EngineWin.hpp"
#include "../../utils/Log.hpp"

int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int)
{
    try
    {
        int argc;
        std::unique_ptr<LPWSTR, decltype(&LocalFree)> argv(CommandLineToArgvW(GetCommandLineW(), &argc), LocalFree);

        ouzel::core::windows::Engine engine(argc, argv.get());
        engine.run();
        return EXIT_SUCCESS;
    }
    catch (const std::exception& e)
    {
        ouzel::logger.log(ouzel::Log::Level::error) << e.what();
        return EXIT_FAILURE;
    }
}

namespace ouzel::core::windows
{
    System::System(int argc, LPWSTR* argv)
    {
    }
}

Store Engine by value on Windows and keep argv in unique_ptr


#include "aquila/global.h"
#include "aquila/source/generator/SineGenerator.h"
#include "aquila/transform/FftFactory.h"
#include "aquila/tools/TextPlot.h"

int main()
{
    // input signal parameters
    const std::size_t SIZE = 64;
    const Aquila::FrequencyType sampleFreq = 2000;
    const Aquila::FrequencyType f1 = 125, f2 = 700;

    Aquila::SineGenerator sineGenerator1(sampleFreq);
    sineGenerator1.setAmplitude(32).setFrequency(f1).generate(SIZE);
    Aquila::SineGenerator sineGenerator2(sampleFreq);
    sineGenerator2.setAmplitude(8).setFrequency(f2).setPhase(0.75).generate(SIZE);
    auto sum = sineGenerator1 + sineGenerator2;

    Aquila::TextPlot plt("Input signal");
    plt.plot(sum);

    // calculate the FFT
    auto fft = Aquila::FftFactory::getFft(SIZE);
    Aquila::SpectrumType spectrum = fft->fft(sum.toArray());

    plt.setTitle("Spectrum");
    plt.plotSpectrum(spectrum);

    return 0;
}

#include "aquila/global.h"
#include "aquila/source/generator/SineGenerator.h"
#include "aquila/transform/FftFactory.h"
#include "aquila/tools/TextPlot.h"

int main()
{
    // input signal parameters
    const std::size_t SIZE = 64;
    const Aquila::FrequencyType sampleFreq = 2000, f1 = 125, f2 = 700;

    Aquila::SineGenerator sineGenerator1(sampleFreq);
    sineGenerator1.setAmplitude(32).setFrequency(f1).generate(SIZE);
    Aquila::SineGenerator sineGenerator2(sampleFreq);
    sineGenerator2.setAmplitude(8).setFrequency(f2).setPhase(0.75).generate(SIZE);
    auto sum = sineGenerator1 + sineGenerator2;

    Aquila::TextPlot plt("Input signal");
    plt.plot(sum);

    // calculate the FFT
    auto fft = Aquila::FftFactory::getFft(SIZE);
    Aquila::SpectrumType spectrum = fft->fft(sum.toArray());

    plt.setTitle("Spectrum");
    plt.plotSpectrum(spectrum);

    return 0;
}

Put all frequencies in one definition.

Put all frequencies in one definition.


// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chromecast/media/cma/backend/media_pipeline_device.h"

#include "chromecast/media/cma/backend/audio_pipeline_device_default.h"
#include "chromecast/media/cma/backend/media_clock_device_default.h"
#include "chromecast/media/cma/backend/media_pipeline_device_factory.h"
#include "chromecast/media/cma/backend/video_pipeline_device_default.h"

namespace chromecast {
namespace media {

MediaPipelineDevice::MediaPipelineDevice(
    scoped_ptr<MediaPipelineDeviceFactory> factory)
    : MediaPipelineDevice(factory->CreateMediaClockDevice(),
                          factory->CreateAudioPipelineDevice(),
                          factory->CreateVideoPipelineDevice()) {
}

MediaPipelineDevice::MediaPipelineDevice(
    scoped_ptr<MediaClockDevice> media_clock_device,
    scoped_ptr<AudioPipelineDevice> audio_pipeline_device,
    scoped_ptr<VideoPipelineDevice> video_pipeline_device)
    : media_clock_device_(media_clock_device.Pass()),
      audio_pipeline_device_(audio_pipeline_device.Pass()),
      video_pipeline_device_(video_pipeline_device.Pass()) {
}

MediaPipelineDevice::~MediaPipelineDevice() {
}

}  // namespace media
}  // namespace chromecast

// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chromecast/media/cma/backend/media_pipeline_device.h"

#include "chromecast/media/cma/backend/audio_pipeline_device_default.h"
#include "chromecast/media/cma/backend/media_clock_device_default.h"
#include "chromecast/media/cma/backend/media_pipeline_device_factory.h"
#include "chromecast/media/cma/backend/video_pipeline_device_default.h"

namespace chromecast {
namespace media {

MediaPipelineDevice::MediaPipelineDevice(
    scoped_ptr<MediaPipelineDeviceFactory> factory)
    : media_clock_device_(factory->CreateMediaClockDevice()),
      audio_pipeline_device_(factory->CreateAudioPipelineDevice()),
      video_pipeline_device_(factory->CreateVideoPipelineDevice()) {
}

MediaPipelineDevice::MediaPipelineDevice(
    scoped_ptr<MediaClockDevice> media_clock_device,
    scoped_ptr<AudioPipelineDevice> audio_pipeline_device,
    scoped_ptr<VideoPipelineDevice> video_pipeline_device)
    : media_clock_device_(media_clock_device.Pass()),
      audio_pipeline_device_(audio_pipeline_device.Pass()),
      video_pipeline_device_(video_pipeline_device.Pass()) {
}

MediaPipelineDevice::~MediaPipelineDevice() {
}

}  // namespace media
}  // namespace chromecast

Initialize MediaPipelineDevice elements in correct order

Using a delegated constructor had us depending on undefined
behaviour - we require the clock to be created first, but the calls
can be made in any order.

BUG=

Review URL: https://codereview.chromium.org/1203763002

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#335756}