Add ifdef to compile on mac

Add ifdef to compile on mac

--- Dev/Cpp/Viewer/Utils/Logger.cpp
+++ Dev/Cpp/Viewer/Utils/Logger.cpp
@@ -1,7 +1,9 @@
 #include "Logger.h"

 #include <Effekseer.h>
+#if defined(_WIN32)
 #include <filesystem>
+#endif
 #include <spdlog/sinks/basic_file_sink.h>
 #include <spdlog/spdlog.h>

<|original_code|>
#include "Logger.h"

#include <Effekseer.h>
#include <filesystem>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/spdlog.h>

namespace Effekseer::Tool
{

void Logger::SetFileLogger(const char16_t* path)
{
	spdlog::flush_on(spdlog::level::trace);
	spdlog::set_level(spdlog::level::trace);
	spdlog::trace("Begin Native::SetFileLogger");

#if defined(_WIN32)
	auto wpath = std::filesystem::path(reinterpret_cast<const wchar_t*>(path));
	auto fileLogger = spdlog::basic_logger_mt("logger", wpath.generic_string().c_str());
#else
	char cpath[512];
	Effekseer::ConvertUtf16ToUtf8(cpath, 512, path);
	auto fileLogger = spdlog::basic_logger_mt("logger", cpath);
#endif

	spdlog::set_default_logger(fileLogger);

#if defined(_WIN32)
	spdlog::trace("Native::SetFileLogger : {}", wpath.generic_string().c_str());
#else
	spdlog::trace("Native::SetFileLogger : {}", cpath);
#endif

	spdlog::trace("End Native::SetFileLogger");
}

} // namespace Effekseer::Tool
<|edits_diff|>
--- Dev/Cpp/Viewer/Utils/Logger.cpp
+++ Dev/Cpp/Viewer/Utils/Logger.cpp
@@ -1,6 +1,7 @@
 #include "Logger.h"

 #include <Effekseer.h>
+#if defined(_WIN32)
 #include <filesystem>
 #include <spdlog/sinks/basic_file_sink.h>
 #include <spdlog/spdlog.h>
<|current_version|>
#include "Logger.h"

#include <Effekseer.h>
#if defined(_WIN32)
#include <filesystem>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/spdlog.h>

namespace Effekseer::Tool
{

void Logger::SetFileLogger(const char16_t* path)
{
	spdlog::flush_on(spdlog::level::trace);
	spdlog::set_level(spdlog::level::trace);
	spdlog::trace("Begin Native::SetFileLogger");

#if defined(_WIN32)
	auto wpath = std::filesystem::path(reinterpret_cast<const wchar_t*>(path));
	auto fileLogger = spdlog::basic_logger_mt("logger", wpath.generic_string().c_str());
#else
	char cpath[512];
	Effekseer::ConvertUtf16ToUtf8(cpath, 512, path);
	auto fileLogger = spdlog::basic_logger_mt("logger", cpath);
#endif

	spdlog::set_default_logger(fileLogger);

#if defined(_WIN32)
	spdlog::trace("Native::SetFileLogger : {}", wpath.generic_string().c_str());
#else
	spdlog::trace("Native::SetFileLogger : {}", cpath);
#endif

	spdlog::trace("End Native::SetFileLogger");
}

} // namespace Effekseer::Tool
<|next_version|>
#include "Logger.h"

#include <Effekseer.h>
#if defined(_WIN32)
#include <filesystem>
#endif
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/spdlog.h>

namespace Effekseer::Tool
{

void Logger::SetFileLogger(const char16_t* path)
{
	spdlog::flush_on(spdlog::level::trace);
	spdlog::set_level(spdlog::level::trace);
	spdlog::trace("Begin Native::SetFileLogger");

#if defined(_WIN32)
	auto wpath = std::filesystem::path(reinterpret_cast<const wchar_t*>(path));
	auto fileLogger = spdlog::basic_logger_mt("logger", wpath.generic_string().c_str());
#else
	char cpath[512];
	Effekseer::ConvertUtf16ToUtf8(cpath, 512, path);
	auto fileLogger = spdlog::basic_logger_mt("logger", cpath);
#endif

	spdlog::set_default_logger(fileLogger);

#if defined(_WIN32)
	spdlog::trace("Native::SetFileLogger : {}", wpath.generic_string().c_str());
#else
	spdlog::trace("Native::SetFileLogger : {}", cpath);
#endif

	spdlog::trace("End Native::SetFileLogger");
}

} // namespace Effekseer::Tool


[PLAT-3017] Verify JVM libraries found in the filesystem as being 1.7 or higher during tests.

--- projects/OG-Language/ServiceTest/stdafx.cpp
+++ projects/OG-Language/ServiceTest/stdafx.cpp
@@ -5,9 +5,13 @@
  */

 #include "stdafx.h"
+#include "Service/Service.h"

 #ifndef __cplusplus_cli
 int main (int argc, char **argv) {
+	if ((argc == 3) && !strcmp (argv[1], "jvm")) {
+		return ServiceTestJVM (argv[2]) ? 0 : 1;
+	}
 	CAbstractTest::Main (argc, argv);
 	return 0;
 }

<|original_code|>
/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */

#include "stdafx.h"

#ifndef __cplusplus_cli
int main (int argc, char **argv) {
	CAbstractTest::Main (argc, argv);
	return 0;
}
#endif /* ifndef __cplusplus_cli */

<|edits_diff|>
--- projects/OG-Language/ServiceTest/stdafx.cpp
+++ projects/OG-Language/ServiceTest/stdafx.cpp
@@ -5,6 +5,7 @@
  */

 #include "stdafx.h"
+#include "Service/Service.h"

 #ifndef __cplusplus_cli
 int main (int argc, char **argv) {
<|current_version|>
/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */

#include "stdafx.h"
#include "Service/Service.h"

#ifndef __cplusplus_cli
int main (int argc, char **argv) {
	CAbstractTest::Main (argc, argv);
	return 0;
}
#endif /* ifndef __cplusplus_cli */

<|next_version|>
/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */

#include "stdafx.h"
#include "Service/Service.h"

#ifndef __cplusplus_cli
int main (int argc, char **argv) {
	if ((argc == 3) && !strcmp (argv[1], "jvm")) {
		return ServiceTestJVM (argv[2]) ? 0 : 1;
	}
	CAbstractTest::Main (argc, argv);
	return 0;
}
#endif /* ifndef __cplusplus_cli */


Qt: Fix Windows build when Qt Multimedia is disabled

--- src/platform/qt/main.cpp
+++ src/platform/qt/main.cpp
@@ -10,7 +10,9 @@
 #include <QtPlugin>
 #ifdef _WIN32
 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
+#ifdef BUILD_QT_MULTIMEDIA
 Q_IMPORT_PLUGIN(QWindowsAudioPlugin);
+#endif
 #endif
 #endif

<|original_code|>
/* Copyright (c) 2013-2014 Jeffrey Pfau
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GBAApp.h"
#include "Window.h"

#ifdef QT_STATIC
#include <QtPlugin>
#ifdef _WIN32
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
Q_IMPORT_PLUGIN(QWindowsAudioPlugin);
#endif
#endif

int main(int argc, char* argv[]) {
	QGBA::GBAApp application(argc, argv);
	return application.exec();
}

<|edits_diff|>
--- src/platform/qt/main.cpp
+++ src/platform/qt/main.cpp
@@ -10,6 +10,7 @@
 #include <QtPlugin>
 #ifdef _WIN32
 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
+#ifdef BUILD_QT_MULTIMEDIA
 Q_IMPORT_PLUGIN(QWindowsAudioPlugin);
 #endif
 #endif
<|current_version|>
/* Copyright (c) 2013-2014 Jeffrey Pfau
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GBAApp.h"
#include "Window.h"

#ifdef QT_STATIC
#include <QtPlugin>
#ifdef _WIN32
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
#ifdef BUILD_QT_MULTIMEDIA
Q_IMPORT_PLUGIN(QWindowsAudioPlugin);
#endif
#endif

int main(int argc, char* argv[]) {
	QGBA::GBAApp application(argc, argv);
	return application.exec();
}

<|next_version|>
/* Copyright (c) 2013-2014 Jeffrey Pfau
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GBAApp.h"
#include "Window.h"

#ifdef QT_STATIC
#include <QtPlugin>
#ifdef _WIN32
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
#ifdef BUILD_QT_MULTIMEDIA
Q_IMPORT_PLUGIN(QWindowsAudioPlugin);
#endif
#endif
#endif

int main(int argc, char* argv[]) {
	QGBA::GBAApp application(argc, argv);
	return application.exec();
}


Fix for crash trying to deference ash::Shell::message_center()

Because we don't really have a operational ash::shell in
windows 7 or earlier.

So we need to default to the non-rich one

BUG=178429
TEST=see bug
Review URL: https://codereview.chromium.org/12328129

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

--- ui/message_center/message_center_util.cc
+++ ui/message_center/message_center_util.cc
@@ -10,8 +10,12 @@
 namespace message_center {

 bool IsRichNotificationEnabled() {
+#if defined(OS_WIN) && defined(USE_AURA)
+  return false;
+#else
   return CommandLine::ForCurrentProcess()->HasSwitch(
       switches::kEnableRichNotifications);
+#endif
 }

 }  // namespace message_center

<|original_code|>
// Copyright (c) 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 "ui/message_center/message_center_util.h"

#include "base/command_line.h"
#include "ui/message_center/message_center_switches.h"

namespace message_center {

bool IsRichNotificationEnabled() {
  return CommandLine::ForCurrentProcess()->HasSwitch(
      switches::kEnableRichNotifications);
}

}  // namespace message_center

<|edits_diff|>
--- ui/message_center/message_center_util.cc
+++ ui/message_center/message_center_util.cc
@@ -10,6 +10,9 @@
 namespace message_center {

 bool IsRichNotificationEnabled() {
+#if defined(OS_WIN) && defined(USE_AURA)
+  return false;
+#else
   return CommandLine::ForCurrentProcess()->HasSwitch(
       switches::kEnableRichNotifications);
 }
<|current_version|>
// Copyright (c) 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 "ui/message_center/message_center_util.h"

#include "base/command_line.h"
#include "ui/message_center/message_center_switches.h"

namespace message_center {

bool IsRichNotificationEnabled() {
#if defined(OS_WIN) && defined(USE_AURA)
  return false;
#else
  return CommandLine::ForCurrentProcess()->HasSwitch(
      switches::kEnableRichNotifications);
}

}  // namespace message_center

<|next_version|>
// Copyright (c) 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 "ui/message_center/message_center_util.h"

#include "base/command_line.h"
#include "ui/message_center/message_center_switches.h"

namespace message_center {

bool IsRichNotificationEnabled() {
#if defined(OS_WIN) && defined(USE_AURA)
  return false;
#else
  return CommandLine::ForCurrentProcess()->HasSwitch(
      switches::kEnableRichNotifications);
#endif
}

}  // namespace message_center


Fix the linux redux build.

Fix the linux redux build.

Broken at https://codereview.chromium.org/71013002 which modified
crypto_module_password_dialog.h and crypto_module_password_dialog_nss.cc but
not crypto_module_password_dialog_openssl.cc

BUG=None

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

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

--- chrome/browser/ui/crypto_module_password_dialog_openssl.cc
+++ chrome/browser/ui/crypto_module_password_dialog_openssl.cc
@@ -11,6 +11,7 @@
 void UnlockSlotsIfNecessary(const net::CryptoModuleList& modules,
                             CryptoModulePasswordReason reason,
                             const std::string& host,
+                            gfx::NativeWindow parent,
                             const base::Closure& callback) {
   // TODO(bulach): implement me.
   NOTREACHED();
@@ -19,6 +20,7 @@
 void UnlockCertSlotIfNecessary(net::X509Certificate* cert,
                                CryptoModulePasswordReason reason,
                                const std::string& host,
+                               gfx::NativeWindow parent,
                                const base::Closure& callback) {
   // TODO(bulach): implement me.
   NOTREACHED();

<|original_code|>
// Copyright (c) 2011 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/ui/crypto_module_password_dialog.h"

#include "base/logging.h"

namespace chrome {

void UnlockSlotsIfNecessary(const net::CryptoModuleList& modules,
                            CryptoModulePasswordReason reason,
                            const std::string& host,
                            const base::Closure& callback) {
  // TODO(bulach): implement me.
  NOTREACHED();
}

void UnlockCertSlotIfNecessary(net::X509Certificate* cert,
                               CryptoModulePasswordReason reason,
                               const std::string& host,
                               const base::Closure& callback) {
  // TODO(bulach): implement me.
  NOTREACHED();
}

}  // namespace chrome

<|edits_diff|>
--- chrome/browser/ui/crypto_module_password_dialog_openssl.cc
+++ chrome/browser/ui/crypto_module_password_dialog_openssl.cc
@@ -11,6 +11,7 @@
 void UnlockSlotsIfNecessary(const net::CryptoModuleList& modules,
                             CryptoModulePasswordReason reason,
                             const std::string& host,
+                            gfx::NativeWindow parent,
                             const base::Closure& callback) {
   // TODO(bulach): implement me.
   NOTREACHED();
<|current_version|>
// Copyright (c) 2011 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/ui/crypto_module_password_dialog.h"

#include "base/logging.h"

namespace chrome {

void UnlockSlotsIfNecessary(const net::CryptoModuleList& modules,
                            CryptoModulePasswordReason reason,
                            const std::string& host,
                            gfx::NativeWindow parent,
                            const base::Closure& callback) {
  // TODO(bulach): implement me.
  NOTREACHED();
}

void UnlockCertSlotIfNecessary(net::X509Certificate* cert,
                               CryptoModulePasswordReason reason,
                               const std::string& host,
                               const base::Closure& callback) {
  // TODO(bulach): implement me.
  NOTREACHED();
}

}  // namespace chrome

<|next_version|>
// Copyright (c) 2011 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/ui/crypto_module_password_dialog.h"

#include "base/logging.h"

namespace chrome {

void UnlockSlotsIfNecessary(const net::CryptoModuleList& modules,
                            CryptoModulePasswordReason reason,
                            const std::string& host,
                            gfx::NativeWindow parent,
                            const base::Closure& callback) {
  // TODO(bulach): implement me.
  NOTREACHED();
}

void UnlockCertSlotIfNecessary(net::X509Certificate* cert,
                               CryptoModulePasswordReason reason,
                               const std::string& host,
                               gfx::NativeWindow parent,
                               const base::Closure& callback) {
  // TODO(bulach): implement me.
  NOTREACHED();
}

}  // namespace chrome


Use a different User-Agent for Android build.

It is hard to use desktop version website to debug html_viewer on Andoid,
so change the User-Agent to get the mobile version website on Android.

BUG=None
TBR=ben@chromium.org

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

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

--- mojo/common/user_agent.cc
+++ mojo/common/user_agent.cc
@@ -4,13 +4,21 @@

 #include "mojo/common/user_agent.h"

+#include "build/build_config.h"
+
 namespace mojo {
 namespace common {

 std::string GetUserAgent() {
   // TODO(jam): change depending on OS
+#if defined(OS_ANDROID)
+  return "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 7 Build/LMY48G) "
+         "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.68 "
+         "Safari/537.36";
+#else
   return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like "
          "Gecko) Chrome/42.0.2311.68 Safari/537.36";
+#endif
 }

 }  // namespace common

<|original_code|>
// Copyright 2015 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 "mojo/common/user_agent.h"

namespace mojo {
namespace common {

std::string GetUserAgent() {
  // TODO(jam): change depending on OS
  return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like "
         "Gecko) Chrome/42.0.2311.68 Safari/537.36";
}

}  // namespace common
}  // namespace mojo

<|edits_diff|>
--- mojo/common/user_agent.cc
+++ mojo/common/user_agent.cc
@@ -4,11 +4,18 @@

 #include "mojo/common/user_agent.h"

+#include "build/build_config.h"
+
 namespace mojo {
 namespace common {

 std::string GetUserAgent() {
   // TODO(jam): change depending on OS
+#if defined(OS_ANDROID)
+  return "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 7 Build/LMY48G) "
+         "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.68 "
+         "Safari/537.36";
+#else
   return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like "
          "Gecko) Chrome/42.0.2311.68 Safari/537.36";
 }
<|current_version|>
// Copyright 2015 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 "mojo/common/user_agent.h"

#include "build/build_config.h"

namespace mojo {
namespace common {

std::string GetUserAgent() {
  // TODO(jam): change depending on OS
#if defined(OS_ANDROID)
  return "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 7 Build/LMY48G) "
         "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.68 "
         "Safari/537.36";
#else
  return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like "
         "Gecko) Chrome/42.0.2311.68 Safari/537.36";
}

}  // namespace common
}  // namespace mojo

<|next_version|>
// Copyright 2015 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 "mojo/common/user_agent.h"

#include "build/build_config.h"

namespace mojo {
namespace common {

std::string GetUserAgent() {
  // TODO(jam): change depending on OS
#if defined(OS_ANDROID)
  return "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 7 Build/LMY48G) "
         "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.68 "
         "Safari/537.36";
#else
  return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like "
         "Gecko) Chrome/42.0.2311.68 Safari/537.36";
#endif
}

}  // namespace common
}  // namespace mojo


Use test font manager for SVG fuzzer

Use test font manager for SVG fuzzer

Change-Id: Ia4f96278e076d300b432b362db5df6b1a1654f3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301218
Commit-Queue: Zepeng Hu <4bcd4d3e41511d83d8c7cefb39b37c1439b78c03@google.com>
Reviewed-by: Kevin Lubick <7cdab2cfab351f23814786ba39716e90eed69047@google.com>

--- fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp
+++ fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp
@@ -6,10 +6,13 @@
  */

 #include "fuzz/Fuzz.h"
+#include "src/core/SkFontMgrPriv.h"
+#include "tools/fonts/TestFontMgr.h"

 void fuzz_SVGCanvas(Fuzz* f);

 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+    gSkFontMgr_DefaultFactory = &ToolUtils::MakePortableFontMgr;
     auto fuzz = Fuzz(SkData::MakeWithoutCopy(data, size));
     fuzz_SVGCanvas(&fuzz);
     return 0;

<|original_code|>
/*
 * Copyright 2020 Google, LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "fuzz/Fuzz.h"

void fuzz_SVGCanvas(Fuzz* f);

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    auto fuzz = Fuzz(SkData::MakeWithoutCopy(data, size));
    fuzz_SVGCanvas(&fuzz);
    return 0;
}

<|edits_diff|>
--- fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp
+++ fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp
@@ -6,6 +6,8 @@
  */

 #include "fuzz/Fuzz.h"
+#include "src/core/SkFontMgrPriv.h"
+#include "tools/fonts/TestFontMgr.h"

 void fuzz_SVGCanvas(Fuzz* f);

<|current_version|>
/*
 * Copyright 2020 Google, LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "fuzz/Fuzz.h"
#include "src/core/SkFontMgrPriv.h"
#include "tools/fonts/TestFontMgr.h"

void fuzz_SVGCanvas(Fuzz* f);

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    auto fuzz = Fuzz(SkData::MakeWithoutCopy(data, size));
    fuzz_SVGCanvas(&fuzz);
    return 0;
}

<|next_version|>
/*
 * Copyright 2020 Google, LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "fuzz/Fuzz.h"
#include "src/core/SkFontMgrPriv.h"
#include "tools/fonts/TestFontMgr.h"

void fuzz_SVGCanvas(Fuzz* f);

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    gSkFontMgr_DefaultFactory = &ToolUtils::MakePortableFontMgr;
    auto fuzz = Fuzz(SkData::MakeWithoutCopy(data, size));
    fuzz_SVGCanvas(&fuzz);
    return 0;
}


Raise the message size limit.

Mojo: Raise the message size limit.

The default message size limit 4MB is too small for Chrome IPC.

TEST=Layout Tests with a flag on
BUG=377980
R=viettrungluu@chromium.org, jam@chromium.org, nasko@chromium.org

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

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

--- content/app/mojo/mojo_init.cc
+++ content/app/mojo/mojo_init.cc
@@ -5,12 +5,18 @@
 #include "content/app/mojo/mojo_init.h"

 #include "base/memory/scoped_ptr.h"
+#include "mojo/edk/embedder/configuration.h"
 #include "mojo/edk/embedder/embedder.h"
 #include "mojo/edk/embedder/simple_platform_support.h"

 namespace content {

 void InitializeMojo() {
+  // Things like content_shell and DevTools ocassionally send big
+  // message which includes whole rendered screen or all loaded
+  // scripts. The buffer size has to be big enough to allow such use
+  // cases.
+  mojo::embedder::GetConfiguration()->max_message_num_bytes = 64*1024*1024;
   mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>(
       new mojo::embedder::SimplePlatformSupport()));
 }

<|original_code|>
// 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 "content/app/mojo/mojo_init.h"

#include "base/memory/scoped_ptr.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/simple_platform_support.h"

namespace content {

void InitializeMojo() {
  mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>(
      new mojo::embedder::SimplePlatformSupport()));
}

}  // namespace content

<|edits_diff|>
--- content/app/mojo/mojo_init.cc
+++ content/app/mojo/mojo_init.cc
@@ -5,6 +5,7 @@
 #include "content/app/mojo/mojo_init.h"

 #include "base/memory/scoped_ptr.h"
+#include "mojo/edk/embedder/configuration.h"
 #include "mojo/edk/embedder/embedder.h"
 #include "mojo/edk/embedder/simple_platform_support.h"

<|current_version|>
// 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 "content/app/mojo/mojo_init.h"

#include "base/memory/scoped_ptr.h"
#include "mojo/edk/embedder/configuration.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/simple_platform_support.h"

namespace content {

void InitializeMojo() {
  mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>(
      new mojo::embedder::SimplePlatformSupport()));
}

}  // namespace content

<|next_version|>
// 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 "content/app/mojo/mojo_init.h"

#include "base/memory/scoped_ptr.h"
#include "mojo/edk/embedder/configuration.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/simple_platform_support.h"

namespace content {

void InitializeMojo() {
  // Things like content_shell and DevTools ocassionally send big
  // message which includes whole rendered screen or all loaded
  // scripts. The buffer size has to be big enough to allow such use
  // cases.
  mojo::embedder::GetConfiguration()->max_message_num_bytes = 64*1024*1024;
  mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>(
      new mojo::embedder::SimplePlatformSupport()));
}

}  // namespace content


Set window name to activities

Set window name to activities

BUG=None
TBR=skuhne@chromium.org

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

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

--- athena/content/content_activity_factory.cc
+++ athena/content/content_activity_factory.cc
@@ -8,6 +8,7 @@
 #include "athena/content/app_activity.h"
 #include "athena/content/web_activity.h"
 #include "base/logging.h"
+#include "ui/aura/window.h"

 namespace athena {

@@ -22,6 +23,7 @@
     const GURL& url) {
   Activity* activity = new WebActivity(browser_context, title, url);
   ActivityManager::Get()->AddActivity(activity);
+  activity->GetWindow()->SetName("WebActivity");
   return activity;
 }

@@ -37,6 +39,7 @@
     views::WebView* web_view) {
   Activity* activity = new AppActivity(app_id, web_view);
   ActivityManager::Get()->AddActivity(activity);
+  activity->GetWindow()->SetName("AppActivity");
   return activity;
 }

<|original_code|>
// 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 "athena/content/content_activity_factory.h"

#include "athena/activity/public/activity_manager.h"
#include "athena/content/app_activity.h"
#include "athena/content/web_activity.h"
#include "base/logging.h"

namespace athena {

ContentActivityFactory::ContentActivityFactory() {
}

ContentActivityFactory::~ContentActivityFactory() {}

Activity* ContentActivityFactory::CreateWebActivity(
    content::BrowserContext* browser_context,
    const base::string16& title,
    const GURL& url) {
  Activity* activity = new WebActivity(browser_context, title, url);
  ActivityManager::Get()->AddActivity(activity);
  return activity;
}

Activity* ContentActivityFactory::CreateWebActivity(
    content::WebContents* contents) {
  Activity* activity = new WebActivity(contents);
  ActivityManager::Get()->AddActivity(activity);
  return activity;
}

Activity* ContentActivityFactory::CreateAppActivity(
    const std::string& app_id,
    views::WebView* web_view) {
  Activity* activity = new AppActivity(app_id, web_view);
  ActivityManager::Get()->AddActivity(activity);
  return activity;
}

ActivityFactory* CreateContentActivityFactory() {
  return new ContentActivityFactory();
}

}  // namespace athena

<|edits_diff|>
--- athena/content/content_activity_factory.cc
+++ athena/content/content_activity_factory.cc
@@ -8,6 +8,7 @@
 #include "athena/content/app_activity.h"
 #include "athena/content/web_activity.h"
 #include "base/logging.h"
+#include "ui/aura/window.h"

 namespace athena {

@@ -22,6 +23,7 @@
     const GURL& url) {
   Activity* activity = new WebActivity(browser_context, title, url);
   ActivityManager::Get()->AddActivity(activity);
+  activity->GetWindow()->SetName("WebActivity");
   return activity;
 }

<|current_version|>
// 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 "athena/content/content_activity_factory.h"

#include "athena/activity/public/activity_manager.h"
#include "athena/content/app_activity.h"
#include "athena/content/web_activity.h"
#include "base/logging.h"
#include "ui/aura/window.h"

namespace athena {

ContentActivityFactory::ContentActivityFactory() {
}

ContentActivityFactory::~ContentActivityFactory() {}

Activity* ContentActivityFactory::CreateWebActivity(
    content::BrowserContext* browser_context,
    const base::string16& title,
    const GURL& url) {
  Activity* activity = new WebActivity(browser_context, title, url);
  ActivityManager::Get()->AddActivity(activity);
  activity->GetWindow()->SetName("WebActivity");
  return activity;
}

Activity* ContentActivityFactory::CreateWebActivity(
    content::WebContents* contents) {
  Activity* activity = new WebActivity(contents);
  ActivityManager::Get()->AddActivity(activity);
  return activity;
}

Activity* ContentActivityFactory::CreateAppActivity(
    const std::string& app_id,
    views::WebView* web_view) {
  Activity* activity = new AppActivity(app_id, web_view);
  ActivityManager::Get()->AddActivity(activity);
  return activity;
}

ActivityFactory* CreateContentActivityFactory() {
  return new ContentActivityFactory();
}

}  // namespace athena

<|next_version|>
// 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 "athena/content/content_activity_factory.h"

#include "athena/activity/public/activity_manager.h"
#include "athena/content/app_activity.h"
#include "athena/content/web_activity.h"
#include "base/logging.h"
#include "ui/aura/window.h"

namespace athena {

ContentActivityFactory::ContentActivityFactory() {
}

ContentActivityFactory::~ContentActivityFactory() {}

Activity* ContentActivityFactory::CreateWebActivity(
    content::BrowserContext* browser_context,
    const base::string16& title,
    const GURL& url) {
  Activity* activity = new WebActivity(browser_context, title, url);
  ActivityManager::Get()->AddActivity(activity);
  activity->GetWindow()->SetName("WebActivity");
  return activity;
}

Activity* ContentActivityFactory::CreateWebActivity(
    content::WebContents* contents) {
  Activity* activity = new WebActivity(contents);
  ActivityManager::Get()->AddActivity(activity);
  return activity;
}

Activity* ContentActivityFactory::CreateAppActivity(
    const std::string& app_id,
    views::WebView* web_view) {
  Activity* activity = new AppActivity(app_id, web_view);
  ActivityManager::Get()->AddActivity(activity);
  activity->GetWindow()->SetName("AppActivity");
  return activity;
}

ActivityFactory* CreateContentActivityFactory() {
  return new ContentActivityFactory();
}

}  // namespace athena


Clean input to evm2wasm CLI from any whitespace

--- tools/evm2wasm/main.cpp
+++ tools/evm2wasm/main.cpp
@@ -2,6 +2,7 @@
 #include <iostream>
 #include <fstream>
 #include <streambuf>
+#include <algorithm>

 #include <evm2wasm.h>

@@ -33,6 +34,9 @@
         std::istreambuf_iterator<char>()
     );

+    // clean input of any whitespace (including space and new lines)
+    str.erase(remove_if(str.begin(), str.end(), [](unsigned char x){return std::isspace(x);}), str.end());
+
     if (wast) {
         cout << evm2wasm::evmhex2wast(str) << endl;
     } else {

<|original_code|>
#include <string>
#include <iostream>
#include <fstream>
#include <streambuf>

#include <evm2wasm.h>

using namespace std;

int main(int argc, char **argv) {
    if (argc < 2) {
        cerr << "Usage: " << argv[0] << " <EVM file> [--wast]" << endl;
        return 1;
    }

    bool wast = false;
    if (argc == 3) {
        wast = (string(argv[2]) == "--wast");
        if (!wast) {
            cerr << "Usage: " << argv[0] << " <EVM file> [--wast]" << endl;
            return 1;
        }
    }

    ifstream input(argv[1]);
    if (!input.is_open()) {
        cerr << "File not found: " << argv[1] << endl;
        return 1;
    }

    string str(
        (std::istreambuf_iterator<char>(input)),
        std::istreambuf_iterator<char>()
    );

    if (wast) {
        cout << evm2wasm::evmhex2wast(str) << endl;
    } else {
        cout << evm2wasm::evmhex2wasm(str) << endl;
    }

    return 0;
}

<|edits_diff|>
--- tools/evm2wasm/main.cpp
+++ tools/evm2wasm/main.cpp
@@ -2,6 +2,7 @@
 #include <iostream>
 #include <fstream>
 #include <streambuf>
+#include <algorithm>

 #include <evm2wasm.h>

<|current_version|>
#include <string>
#include <iostream>
#include <fstream>
#include <streambuf>
#include <algorithm>

#include <evm2wasm.h>

using namespace std;

int main(int argc, char **argv) {
    if (argc < 2) {
        cerr << "Usage: " << argv[0] << " <EVM file> [--wast]" << endl;
        return 1;
    }

    bool wast = false;
    if (argc == 3) {
        wast = (string(argv[2]) == "--wast");
        if (!wast) {
            cerr << "Usage: " << argv[0] << " <EVM file> [--wast]" << endl;
            return 1;
        }
    }

    ifstream input(argv[1]);
    if (!input.is_open()) {
        cerr << "File not found: " << argv[1] << endl;
        return 1;
    }

    string str(
        (std::istreambuf_iterator<char>(input)),
        std::istreambuf_iterator<char>()
    );

    if (wast) {
        cout << evm2wasm::evmhex2wast(str) << endl;
    } else {
        cout << evm2wasm::evmhex2wasm(str) << endl;
    }

    return 0;
}

<|next_version|>
#include <string>
#include <iostream>
#include <fstream>
#include <streambuf>
#include <algorithm>

#include <evm2wasm.h>

using namespace std;

int main(int argc, char **argv) {
    if (argc < 2) {
        cerr << "Usage: " << argv[0] << " <EVM file> [--wast]" << endl;
        return 1;
    }

    bool wast = false;
    if (argc == 3) {
        wast = (string(argv[2]) == "--wast");
        if (!wast) {
            cerr << "Usage: " << argv[0] << " <EVM file> [--wast]" << endl;
            return 1;
        }
    }

    ifstream input(argv[1]);
    if (!input.is_open()) {
        cerr << "File not found: " << argv[1] << endl;
        return 1;
    }

    string str(
        (std::istreambuf_iterator<char>(input)),
        std::istreambuf_iterator<char>()
    );

    // clean input of any whitespace (including space and new lines)
    str.erase(remove_if(str.begin(), str.end(), [](unsigned char x){return std::isspace(x);}), str.end());

    if (wast) {
        cout << evm2wasm::evmhex2wast(str) << endl;
    } else {
        cout << evm2wasm::evmhex2wasm(str) << endl;
    }

    return 0;
}


Add a dummy for testing Boost dependencies within CMake

--- src/Dummy.cpp
+++ src/Dummy.cpp
@@ -1,5 +1,9 @@
 #include <iostream>
+#include <boost/asio.hpp>

 int main () {
+    boost::asio::io_service io_dummy;
+    boost::asio::deadline_timer t(io_dummy, boost::posix_time::seconds(5));
+    t.wait();
     std::cout << "Hello word!" << std::endl;
 }

<|original_code|>
#include <iostream>

int main () {
    std::cout << "Hello word!" << std::endl;
}
<|edits_diff|>
--- src/Dummy.cpp
+++ src/Dummy.cpp
@@ -1,4 +1,5 @@
 #include <iostream>
+#include <boost/asio.hpp>

 int main () {
     std::cout << "Hello word!" << std::endl;
<|current_version|>
#include <iostream>
#include <boost/asio.hpp>

int main () {
    std::cout << "Hello word!" << std::endl;
}
<|next_version|>
#include <iostream>
#include <boost/asio.hpp>

int main () {
    boost::asio::io_service io_dummy;
    boost::asio::deadline_timer t(io_dummy, boost::posix_time::seconds(5));
    t.wait();
    std::cout << "Hello word!" << std::endl;
}


Add status echo to PPG node for debug

Add status echo to PPG node for debug

--- src/manipulator/pattern_posture_generator/src/pattern_posture_generator_node.cpp
+++ src/manipulator/pattern_posture_generator/src/pattern_posture_generator_node.cpp
@@ -8,6 +8,7 @@

   PatternPostureGenerator ppg(nh);

+  ROS_INFO("Ready. getPostureKey");
   ros::spin();
   return 0;
 }
@@ -16,12 +17,14 @@

 PatternPostureGenerator::PatternPostureGenerator(ros::NodeHandle& nh) {
   if (!nh.getParam("pattern", pattern_names)) return;
+  ROS_INFO("Get map of patterns parent");
   for (std::map<std::string, std::string >::iterator it = pattern_names.begin();
        it != pattern_names.end();
        it++) {
     std::vector<double> posture;
     if (!nh.getParam(std::string("pattern/").append(it->second), posture)) return;
     std::copy(posture.begin(), posture.end(), std::back_inserter(posture_datas[it->second]));
+    ROS_INFO(std::string("Found posture of ").append(it->second).c_str());
   }
   key_srv = nh.advertiseService("getPostureKey", &PatternPostureGenerator::getPostureKey, this);
 }

<|original_code|>
#include "ros/ros.h"

#include "pattern_posture_generator_node.hpp"

int main(int argc, char* argv[]) {
  ros::init(argc, argv, "pattern_posture_generator");
  ros::NodeHandle nh;

  PatternPostureGenerator ppg(nh);

  ros::spin();
  return 0;
}

PatternPostureGenerator::PatternPostureGenerator(){}

PatternPostureGenerator::PatternPostureGenerator(ros::NodeHandle& nh) {
  if (!nh.getParam("pattern", pattern_names)) return;
  for (std::map<std::string, std::string >::iterator it = pattern_names.begin();
       it != pattern_names.end();
       it++) {
    std::vector<double> posture;
    if (!nh.getParam(std::string("pattern/").append(it->second), posture)) return;
    std::copy(posture.begin(), posture.end(), std::back_inserter(posture_datas[it->second]));
  }
  key_srv = nh.advertiseService("getPostureKey", &PatternPostureGenerator::getPostureKey, this);
}

bool PatternPostureGenerator::getPostureKey(pattern_posture_generator::PatternKeyPosture::Request&  req,
                                            pattern_posture_generator::PatternKeyPosture::Response& res) {
  std::copy(posture_datas[req.name].begin(), posture_datas[req.name].end(), std::back_inserter(res.posture));
  return true;
}

<|edits_diff|>
--- src/manipulator/pattern_posture_generator/src/pattern_posture_generator_node.cpp
+++ src/manipulator/pattern_posture_generator/src/pattern_posture_generator_node.cpp
@@ -8,6 +8,7 @@

   PatternPostureGenerator ppg(nh);

+  ROS_INFO("Ready. getPostureKey");
   ros::spin();
   return 0;
 }
@@ -16,6 +17,7 @@

 PatternPostureGenerator::PatternPostureGenerator(ros::NodeHandle& nh) {
   if (!nh.getParam("pattern", pattern_names)) return;
+  ROS_INFO("Get map of patterns parent");
   for (std::map<std::string, std::string >::iterator it = pattern_names.begin();
        it != pattern_names.end();
        it++) {
<|current_version|>
#include "ros/ros.h"

#include "pattern_posture_generator_node.hpp"

int main(int argc, char* argv[]) {
  ros::init(argc, argv, "pattern_posture_generator");
  ros::NodeHandle nh;

  PatternPostureGenerator ppg(nh);

  ROS_INFO("Ready. getPostureKey");
  ros::spin();
  return 0;
}

PatternPostureGenerator::PatternPostureGenerator(){}

PatternPostureGenerator::PatternPostureGenerator(ros::NodeHandle& nh) {
  if (!nh.getParam("pattern", pattern_names)) return;
  ROS_INFO("Get map of patterns parent");
  for (std::map<std::string, std::string >::iterator it = pattern_names.begin();
       it != pattern_names.end();
       it++) {
    std::vector<double> posture;
    if (!nh.getParam(std::string("pattern/").append(it->second), posture)) return;
    std::copy(posture.begin(), posture.end(), std::back_inserter(posture_datas[it->second]));
  }
  key_srv = nh.advertiseService("getPostureKey", &PatternPostureGenerator::getPostureKey, this);
}

bool PatternPostureGenerator::getPostureKey(pattern_posture_generator::PatternKeyPosture::Request&  req,
                                            pattern_posture_generator::PatternKeyPosture::Response& res) {
  std::copy(posture_datas[req.name].begin(), posture_datas[req.name].end(), std::back_inserter(res.posture));
  return true;
}

<|next_version|>
#include "ros/ros.h"

#include "pattern_posture_generator_node.hpp"

int main(int argc, char* argv[]) {
  ros::init(argc, argv, "pattern_posture_generator");
  ros::NodeHandle nh;

  PatternPostureGenerator ppg(nh);

  ROS_INFO("Ready. getPostureKey");
  ros::spin();
  return 0;
}

PatternPostureGenerator::PatternPostureGenerator(){}

PatternPostureGenerator::PatternPostureGenerator(ros::NodeHandle& nh) {
  if (!nh.getParam("pattern", pattern_names)) return;
  ROS_INFO("Get map of patterns parent");
  for (std::map<std::string, std::string >::iterator it = pattern_names.begin();
       it != pattern_names.end();
       it++) {
    std::vector<double> posture;
    if (!nh.getParam(std::string("pattern/").append(it->second), posture)) return;
    std::copy(posture.begin(), posture.end(), std::back_inserter(posture_datas[it->second]));
    ROS_INFO(std::string("Found posture of ").append(it->second).c_str());
  }
  key_srv = nh.advertiseService("getPostureKey", &PatternPostureGenerator::getPostureKey, this);
}

bool PatternPostureGenerator::getPostureKey(pattern_posture_generator::PatternKeyPosture::Request&  req,
                                            pattern_posture_generator::PatternKeyPosture::Response& res) {
  std::copy(posture_datas[req.name].begin(), posture_datas[req.name].end(), std::back_inserter(res.posture));
  return true;
}


Declare an application name and version.

--- src/main.cpp
+++ src/main.cpp
@@ -4,10 +4,14 @@
 int main(int argc, char *argv[])
 {
     QApplication a(argc, argv);
+    a.setApplicationName("Humbug Desktop");
+    a.setApplicationVersion("0.1");
+
     HumbugWindow w;
     if (argc == 3 && QString(argv[1]) == QString("--site")) {
         w.setUrl(QUrl(argv[2]));
     }
+
     w.show();

     return a.exec();

<|original_code|>
#include "HumbugWindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    HumbugWindow w;
    if (argc == 3 && QString(argv[1]) == QString("--site")) {
        w.setUrl(QUrl(argv[2]));
    }
    w.show();

    return a.exec();
}

<|edits_diff|>
--- src/main.cpp
+++ src/main.cpp
@@ -4,6 +4,9 @@
 int main(int argc, char *argv[])
 {
     QApplication a(argc, argv);
+    a.setApplicationName("Humbug Desktop");
+    a.setApplicationVersion("0.1");
+
     HumbugWindow w;
     if (argc == 3 && QString(argv[1]) == QString("--site")) {
         w.setUrl(QUrl(argv[2]));
<|current_version|>
#include "HumbugWindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    a.setApplicationName("Humbug Desktop");
    a.setApplicationVersion("0.1");

    HumbugWindow w;
    if (argc == 3 && QString(argv[1]) == QString("--site")) {
        w.setUrl(QUrl(argv[2]));
    }
    w.show();

    return a.exec();
}

<|next_version|>
#include "HumbugWindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    a.setApplicationName("Humbug Desktop");
    a.setApplicationVersion("0.1");

    HumbugWindow w;
    if (argc == 3 && QString(argv[1]) == QString("--site")) {
        w.setUrl(QUrl(argv[2]));
    }

    w.show();

    return a.exec();
}


Add implementation for adding/removing subspecies functions

--- src/common/species_dialog.cc
+++ src/common/species_dialog.cc
@@ -10,15 +10,25 @@
 }

 void SpeciesDialog::on_ok_clicked() {
+  accept();
 }

 void SpeciesDialog::on_cancel_clicked() {
+  reject();
 }

 void SpeciesDialog::on_removeSubspecies_clicked() {
+  QListWidgetItem *current = ui_->subspeciesList->currentItem();
+  if(current != nullptr) {
+    delete current;
+  }
 }

 void SpeciesDialog::on_addSubspecies_clicked() {
+  QListWidgetItem *item = new QListWidgetItem("New subspecies");
+  item->setFlags(item->flags() | Qt::ItemIsEditable);
+  ui_->subspeciesList->addItem(item);
+  ui_->subspeciesList->editItem(item);
 }

 Species SpeciesDialog::getSpecies() {

<|original_code|>
#include "fish_detector/common/species_dialog.h"
#include "ui_species_dialog.h"

namespace fish_detector {

SpeciesDialog::SpeciesDialog(QWidget *parent)
  : QDialog(parent)
  , ui_(new Ui::SpeciesDialog) {
  ui_->setupUi(this);
}

void SpeciesDialog::on_ok_clicked() {
}

void SpeciesDialog::on_cancel_clicked() {
}

void SpeciesDialog::on_removeSubspecies_clicked() {
}

void SpeciesDialog::on_addSubspecies_clicked() {
}

Species SpeciesDialog::getSpecies() {
  Species species;
  return species;
}

#include "../../include/fish_detector/common/moc_species_dialog.cpp"

} // namespace fish_detector

<|edits_diff|>
--- src/common/species_dialog.cc
+++ src/common/species_dialog.cc
@@ -10,12 +10,18 @@
 }

 void SpeciesDialog::on_ok_clicked() {
+  accept();
 }

 void SpeciesDialog::on_cancel_clicked() {
+  reject();
 }

 void SpeciesDialog::on_removeSubspecies_clicked() {
+  QListWidgetItem *current = ui_->subspeciesList->currentItem();
+  if(current != nullptr) {
+    delete current;
+  }
 }

 void SpeciesDialog::on_addSubspecies_clicked() {
<|current_version|>
#include "fish_detector/common/species_dialog.h"
#include "ui_species_dialog.h"

namespace fish_detector {

SpeciesDialog::SpeciesDialog(QWidget *parent)
  : QDialog(parent)
  , ui_(new Ui::SpeciesDialog) {
  ui_->setupUi(this);
}

void SpeciesDialog::on_ok_clicked() {
  accept();
}

void SpeciesDialog::on_cancel_clicked() {
  reject();
}

void SpeciesDialog::on_removeSubspecies_clicked() {
  QListWidgetItem *current = ui_->subspeciesList->currentItem();
  if(current != nullptr) {
    delete current;
  }
}

void SpeciesDialog::on_addSubspecies_clicked() {
}

Species SpeciesDialog::getSpecies() {
  Species species;
  return species;
}

#include "../../include/fish_detector/common/moc_species_dialog.cpp"

} // namespace fish_detector

<|next_version|>
#include "fish_detector/common/species_dialog.h"
#include "ui_species_dialog.h"

namespace fish_detector {

SpeciesDialog::SpeciesDialog(QWidget *parent)
  : QDialog(parent)
  , ui_(new Ui::SpeciesDialog) {
  ui_->setupUi(this);
}

void SpeciesDialog::on_ok_clicked() {
  accept();
}

void SpeciesDialog::on_cancel_clicked() {
  reject();
}

void SpeciesDialog::on_removeSubspecies_clicked() {
  QListWidgetItem *current = ui_->subspeciesList->currentItem();
  if(current != nullptr) {
    delete current;
  }
}

void SpeciesDialog::on_addSubspecies_clicked() {
  QListWidgetItem *item = new QListWidgetItem("New subspecies");
  item->setFlags(item->flags() | Qt::ItemIsEditable);
  ui_->subspeciesList->addItem(item);
  ui_->subspeciesList->editItem(item);
}

Species SpeciesDialog::getSpecies() {
  Species species;
  return species;
}

#include "../../include/fish_detector/common/moc_species_dialog.cpp"

} // namespace fish_detector


Use dark theme in cgwhite

Use dark theme in cgwhite

--- source/tools/cgwhite/main.cpp
+++ source/tools/cgwhite/main.cpp
@@ -10,10 +10,14 @@

 #include <gloperate-qtapplication/Viewer.h>

+#include <widgetzeug/dark_fusion_style.hpp>
+

 int main(int argc, char * argv[])
 {
     Application app(argc, argv);
+
+    widgetzeug::enableDarkFusionStyle();

     std::unique_ptr<gloperate_qtapplication::Viewer> viewer(new gloperate_qtapplication::Viewer()); // make_unique is C++14
     viewer->show();

<|original_code|>

#if defined(WIN32) && !defined(_DEBUG)
#pragma comment(linker, "/SUBSYSTEM:WINDOWS /entry:mainCRTStartup")
#endif

#include "Application.h"

#include <memory>

#include <gloperate-qtapplication/Viewer.h>

int main(int argc, char * argv[])
{
    Application app(argc, argv);

    std::unique_ptr<gloperate_qtapplication::Viewer> viewer(new gloperate_qtapplication::Viewer()); // make_unique is C++14
    viewer->show();

    return app.exec();
}

<|edits_diff|>
--- source/tools/cgwhite/main.cpp
+++ source/tools/cgwhite/main.cpp
@@ -10,6 +10,8 @@

 #include <gloperate-qtapplication/Viewer.h>

+#include <widgetzeug/dark_fusion_style.hpp>
+

 int main(int argc, char * argv[])
 {
<|current_version|>

#if defined(WIN32) && !defined(_DEBUG)
#pragma comment(linker, "/SUBSYSTEM:WINDOWS /entry:mainCRTStartup")
#endif

#include "Application.h"

#include <memory>

#include <gloperate-qtapplication/Viewer.h>

#include <widgetzeug/dark_fusion_style.hpp>

int main(int argc, char * argv[])
{
    Application app(argc, argv);

    std::unique_ptr<gloperate_qtapplication::Viewer> viewer(new gloperate_qtapplication::Viewer()); // make_unique is C++14
    viewer->show();

    return app.exec();
}

<|next_version|>

#if defined(WIN32) && !defined(_DEBUG)
#pragma comment(linker, "/SUBSYSTEM:WINDOWS /entry:mainCRTStartup")
#endif

#include "Application.h"

#include <memory>

#include <gloperate-qtapplication/Viewer.h>

#include <widgetzeug/dark_fusion_style.hpp>

int main(int argc, char * argv[])
{
    Application app(argc, argv);

    widgetzeug::enableDarkFusionStyle();

    std::unique_ptr<gloperate_qtapplication::Viewer> viewer(new gloperate_qtapplication::Viewer()); // make_unique is C++14
    viewer->show();

    return app.exec();
}


Test for map that check objectgroup

ADD: Test for map that check objectgroup

--- 2DXngine.Test/src/Integration_Tiled/ParseMapTest.cc
+++ 2DXngine.Test/src/Integration_Tiled/ParseMapTest.cc
@@ -14,4 +14,10 @@
     ASSERT_EQ(32, _parsedMap->get_tileHeight());
 }

+TEST_F(TiledFixture, map_should_have_TestObject_parsed)
+{
+    auto group = _parsedMap->getObjectGroup("TestObject");

+    ASSERT_EQ(group.get_name(), "TestObject");
+}
+

<|original_code|>
#include "gtest\gtest.h"
#include "TiledFixture.h"

TEST_F(TiledFixture, map_attributes_should_be_parsed)
{

    ASSERT_EQ("1.0", _parsedMap->get_version());
    ASSERT_EQ("1.0.3", _parsedMap->get_tiledVersion());
    ASSERT_EQ(Orientation::ORTOGNAL, _parsedMap->get_orientation());
    ASSERT_EQ(RenderOrder::RIGHT_DOWN, _parsedMap->get_renderOrder());
    ASSERT_EQ(10, _parsedMap->get_width());
    ASSERT_EQ(10, _parsedMap->get_height());
    ASSERT_EQ(32, _parsedMap->get_tileWidth());
    ASSERT_EQ(32, _parsedMap->get_tileHeight());
}

<|edits_diff|>
--- 2DXngine.Test/src/Integration_Tiled/ParseMapTest.cc
+++ 2DXngine.Test/src/Integration_Tiled/ParseMapTest.cc
@@ -14,4 +14,7 @@
     ASSERT_EQ(32, _parsedMap->get_tileHeight());
 }

+TEST_F(TiledFixture, map_should_have_TestObject_parsed)
+{
+    auto group = _parsedMap->getObjectGroup("TestObject");

<|current_version|>
#include "gtest\gtest.h"
#include "TiledFixture.h"

TEST_F(TiledFixture, map_attributes_should_be_parsed)
{

    ASSERT_EQ("1.0", _parsedMap->get_version());
    ASSERT_EQ("1.0.3", _parsedMap->get_tiledVersion());
    ASSERT_EQ(Orientation::ORTOGNAL, _parsedMap->get_orientation());
    ASSERT_EQ(RenderOrder::RIGHT_DOWN, _parsedMap->get_renderOrder());
    ASSERT_EQ(10, _parsedMap->get_width());
    ASSERT_EQ(10, _parsedMap->get_height());
    ASSERT_EQ(32, _parsedMap->get_tileWidth());
    ASSERT_EQ(32, _parsedMap->get_tileHeight());
}

TEST_F(TiledFixture, map_should_have_TestObject_parsed)
{
    auto group = _parsedMap->getObjectGroup("TestObject");

<|next_version|>
#include "gtest\gtest.h"
#include "TiledFixture.h"

TEST_F(TiledFixture, map_attributes_should_be_parsed)
{

    ASSERT_EQ("1.0", _parsedMap->get_version());
    ASSERT_EQ("1.0.3", _parsedMap->get_tiledVersion());
    ASSERT_EQ(Orientation::ORTOGNAL, _parsedMap->get_orientation());
    ASSERT_EQ(RenderOrder::RIGHT_DOWN, _parsedMap->get_renderOrder());
    ASSERT_EQ(10, _parsedMap->get_width());
    ASSERT_EQ(10, _parsedMap->get_height());
    ASSERT_EQ(32, _parsedMap->get_tileWidth());
    ASSERT_EQ(32, _parsedMap->get_tileHeight());
}

TEST_F(TiledFixture, map_should_have_TestObject_parsed)
{
    auto group = _parsedMap->getObjectGroup("TestObject");

    ASSERT_EQ(group.get_name(), "TestObject");
}


Call agclose when clearing the graph

Call agclose when clearing the graph

--- QGVCore/private/QGVGraphPrivate.cpp
+++ QGVCore/private/QGVGraphPrivate.cpp
@@ -1,12 +1,15 @@
 #include "QGVGraphPrivate.h"

 QGVGraphPrivate::QGVGraphPrivate(Agraph_t *graph)
+  : _graph (NULL)
 {
 	setGraph(graph);
 }

 void QGVGraphPrivate::setGraph(Agraph_t *graph)
 {
+  if (_graph != NULL)
+    agclose(_graph);
 	_graph = graph;
 }

<|original_code|>
#include "QGVGraphPrivate.h"

QGVGraphPrivate::QGVGraphPrivate(Agraph_t *graph)
{
	setGraph(graph);
}

void QGVGraphPrivate::setGraph(Agraph_t *graph)
{
	_graph = graph;
}

Agraph_t* QGVGraphPrivate::graph() const
{
	return _graph;
}

<|edits_diff|>
--- QGVCore/private/QGVGraphPrivate.cpp
+++ QGVCore/private/QGVGraphPrivate.cpp
@@ -1,6 +1,7 @@
 #include "QGVGraphPrivate.h"

 QGVGraphPrivate::QGVGraphPrivate(Agraph_t *graph)
+  : _graph (NULL)
 {
 	setGraph(graph);
 }
<|current_version|>
#include "QGVGraphPrivate.h"

QGVGraphPrivate::QGVGraphPrivate(Agraph_t *graph)
  : _graph (NULL)
{
	setGraph(graph);
}

void QGVGraphPrivate::setGraph(Agraph_t *graph)
{
	_graph = graph;
}

Agraph_t* QGVGraphPrivate::graph() const
{
	return _graph;
}

<|next_version|>
#include "QGVGraphPrivate.h"

QGVGraphPrivate::QGVGraphPrivate(Agraph_t *graph)
  : _graph (NULL)
{
	setGraph(graph);
}

void QGVGraphPrivate::setGraph(Agraph_t *graph)
{
  if (_graph != NULL)
    agclose(_graph);
	_graph = graph;
}

Agraph_t* QGVGraphPrivate::graph() const
{
	return _graph;
}


Add StaticRandom component to registration.

--- es-general/Registration.cpp
+++ es-general/Registration.cpp
@@ -11,6 +11,7 @@
 #include "comp/StaticKeyboardInput.hpp"
 #include "comp/StaticScreenDims.hpp"
 #include "comp/StaticGlobalTime.hpp"
+#include "comp/StaticRandom.hpp"

 #include "systems/ConstantRotationSys.hpp"
 #include "systems/ClickBox2DSys.hpp"
@@ -35,6 +36,7 @@
   core.registerComponent<StaticCamera>();
   core.registerComponent<StaticOrthoCamera>();
   core.registerComponent<StaticObjRefID>();
+  core.registerComponent<StaticRandom>();
 }

 } // namespace gen

<|original_code|>
#include "Registration.hpp"

#include "comp/StaticObjRefID.hpp"
#include "comp/Transform.hpp"
#include "comp/ConstantRotation.hpp"
#include "comp/CameraSelect.hpp"
#include "comp/ClickBox2D.hpp"
#include "comp/StaticCamera.hpp"
#include "comp/StaticOrthoCamera.hpp"
#include "comp/StaticMouseInput.hpp"
#include "comp/StaticKeyboardInput.hpp"
#include "comp/StaticScreenDims.hpp"
#include "comp/StaticGlobalTime.hpp"

#include "systems/ConstantRotationSys.hpp"
#include "systems/ClickBox2DSys.hpp"

namespace gen {

void registerAll(CPM_ES_CEREAL_NS::CerealCore& core)
{
  // Register systems
  registerSystem_ConstantRotation();
  registerSystem_ClickBox2D();

  // Register components
  core.registerComponent<ConstantRotation>();
  core.registerComponent<Transform>();
  core.registerComponent<CameraSelect>();
  core.registerComponent<ClickBox2D>();
  core.registerComponent<StaticMouseInput>();
  core.registerComponent<StaticKeyboardInput>();
  core.registerComponent<StaticScreenDims>();
  core.registerComponent<StaticGlobalTime>();
  core.registerComponent<StaticCamera>();
  core.registerComponent<StaticOrthoCamera>();
  core.registerComponent<StaticObjRefID>();
}

} // namespace gen

<|edits_diff|>
--- es-general/Registration.cpp
+++ es-general/Registration.cpp
@@ -11,6 +11,7 @@
 #include "comp/StaticKeyboardInput.hpp"
 #include "comp/StaticScreenDims.hpp"
 #include "comp/StaticGlobalTime.hpp"
+#include "comp/StaticRandom.hpp"

 #include "systems/ConstantRotationSys.hpp"
 #include "systems/ClickBox2DSys.hpp"
<|current_version|>
#include "Registration.hpp"

#include "comp/StaticObjRefID.hpp"
#include "comp/Transform.hpp"
#include "comp/ConstantRotation.hpp"
#include "comp/CameraSelect.hpp"
#include "comp/ClickBox2D.hpp"
#include "comp/StaticCamera.hpp"
#include "comp/StaticOrthoCamera.hpp"
#include "comp/StaticMouseInput.hpp"
#include "comp/StaticKeyboardInput.hpp"
#include "comp/StaticScreenDims.hpp"
#include "comp/StaticGlobalTime.hpp"
#include "comp/StaticRandom.hpp"

#include "systems/ConstantRotationSys.hpp"
#include "systems/ClickBox2DSys.hpp"

namespace gen {

void registerAll(CPM_ES_CEREAL_NS::CerealCore& core)
{
  // Register systems
  registerSystem_ConstantRotation();
  registerSystem_ClickBox2D();

  // Register components
  core.registerComponent<ConstantRotation>();
  core.registerComponent<Transform>();
  core.registerComponent<CameraSelect>();
  core.registerComponent<ClickBox2D>();
  core.registerComponent<StaticMouseInput>();
  core.registerComponent<StaticKeyboardInput>();
  core.registerComponent<StaticScreenDims>();
  core.registerComponent<StaticGlobalTime>();
  core.registerComponent<StaticCamera>();
  core.registerComponent<StaticOrthoCamera>();
  core.registerComponent<StaticObjRefID>();
}

} // namespace gen

<|next_version|>
#include "Registration.hpp"

#include "comp/StaticObjRefID.hpp"
#include "comp/Transform.hpp"
#include "comp/ConstantRotation.hpp"
#include "comp/CameraSelect.hpp"
#include "comp/ClickBox2D.hpp"
#include "comp/StaticCamera.hpp"
#include "comp/StaticOrthoCamera.hpp"
#include "comp/StaticMouseInput.hpp"
#include "comp/StaticKeyboardInput.hpp"
#include "comp/StaticScreenDims.hpp"
#include "comp/StaticGlobalTime.hpp"
#include "comp/StaticRandom.hpp"

#include "systems/ConstantRotationSys.hpp"
#include "systems/ClickBox2DSys.hpp"

namespace gen {

void registerAll(CPM_ES_CEREAL_NS::CerealCore& core)
{
  // Register systems
  registerSystem_ConstantRotation();
  registerSystem_ClickBox2D();

  // Register components
  core.registerComponent<ConstantRotation>();
  core.registerComponent<Transform>();
  core.registerComponent<CameraSelect>();
  core.registerComponent<ClickBox2D>();
  core.registerComponent<StaticMouseInput>();
  core.registerComponent<StaticKeyboardInput>();
  core.registerComponent<StaticScreenDims>();
  core.registerComponent<StaticGlobalTime>();
  core.registerComponent<StaticCamera>();
  core.registerComponent<StaticOrthoCamera>();
  core.registerComponent<StaticObjRefID>();
  core.registerComponent<StaticRandom>();
}

} // namespace gen


Allow atomic file writes from Android on the UI thread.

This is needed because Android writes its tab data during closedown or
when the browser goes into the background. This has to be done on
the UI thread to ensure timely completion.

BUG=148011

Review URL: https://codereview.chromium.org/12457007
Patch from Anthony Berent <aberent@chromium.org>.

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

--- base/android/important_file_writer_android.cc
+++ base/android/important_file_writer_android.cc
@@ -8,6 +8,7 @@

 #include "base/android/jni_string.h"
 #include "base/files/important_file_writer.h"
+#include "base/threading/thread_restrictions.h"
 #include "jni/ImportantFileWriterAndroid_jni.h"

 namespace base {
@@ -17,6 +18,9 @@
                                     jclass /* clazz */,
                                     jstring file_name,
                                     jbyteArray data) {
+  // This is called on the UI thread during shutdown to save tab data, so
+  // needs to enable IO.
+  base::ThreadRestrictions::ScopedAllowIO();
   std::string native_file_name;
   base::android::ConvertJavaStringToUTF8(env, file_name, &native_file_name);
   base::FilePath path(native_file_name);

<|original_code|>
// 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 "base/android/important_file_writer_android.h"

#include <string>

#include "base/android/jni_string.h"
#include "base/files/important_file_writer.h"
#include "jni/ImportantFileWriterAndroid_jni.h"

namespace base {
namespace android {

static jboolean WriteFileAtomically(JNIEnv* env,
                                    jclass /* clazz */,
                                    jstring file_name,
                                    jbyteArray data) {
  std::string native_file_name;
  base::android::ConvertJavaStringToUTF8(env, file_name, &native_file_name);
  base::FilePath path(native_file_name);
  int data_length = env->GetArrayLength(data);
  jbyte* native_data = env->GetByteArrayElements(data, NULL);
  std::string native_data_string(reinterpret_cast<char *>(native_data),
                                 data_length);
  bool result = base::ImportantFileWriter::WriteFileAtomically(
      path, native_data_string);
  env->ReleaseByteArrayElements(data, native_data, JNI_ABORT);
  return result;
}

bool RegisterImportantFileWriterAndroid(JNIEnv* env) {
  return RegisterNativesImpl(env);
}

}  // namespace android
}  // namespace base

<|edits_diff|>
--- base/android/important_file_writer_android.cc
+++ base/android/important_file_writer_android.cc
@@ -8,6 +8,7 @@

 #include "base/android/jni_string.h"
 #include "base/files/important_file_writer.h"
+#include "base/threading/thread_restrictions.h"
 #include "jni/ImportantFileWriterAndroid_jni.h"

 namespace base {
<|current_version|>
// 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 "base/android/important_file_writer_android.h"

#include <string>

#include "base/android/jni_string.h"
#include "base/files/important_file_writer.h"
#include "base/threading/thread_restrictions.h"
#include "jni/ImportantFileWriterAndroid_jni.h"

namespace base {
namespace android {

static jboolean WriteFileAtomically(JNIEnv* env,
                                    jclass /* clazz */,
                                    jstring file_name,
                                    jbyteArray data) {
  std::string native_file_name;
  base::android::ConvertJavaStringToUTF8(env, file_name, &native_file_name);
  base::FilePath path(native_file_name);
  int data_length = env->GetArrayLength(data);
  jbyte* native_data = env->GetByteArrayElements(data, NULL);
  std::string native_data_string(reinterpret_cast<char *>(native_data),
                                 data_length);
  bool result = base::ImportantFileWriter::WriteFileAtomically(
      path, native_data_string);
  env->ReleaseByteArrayElements(data, native_data, JNI_ABORT);
  return result;
}

bool RegisterImportantFileWriterAndroid(JNIEnv* env) {
  return RegisterNativesImpl(env);
}

}  // namespace android
}  // namespace base

<|next_version|>
// 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 "base/android/important_file_writer_android.h"

#include <string>

#include "base/android/jni_string.h"
#include "base/files/important_file_writer.h"
#include "base/threading/thread_restrictions.h"
#include "jni/ImportantFileWriterAndroid_jni.h"

namespace base {
namespace android {

static jboolean WriteFileAtomically(JNIEnv* env,
                                    jclass /* clazz */,
                                    jstring file_name,
                                    jbyteArray data) {
  // This is called on the UI thread during shutdown to save tab data, so
  // needs to enable IO.
  base::ThreadRestrictions::ScopedAllowIO();
  std::string native_file_name;
  base::android::ConvertJavaStringToUTF8(env, file_name, &native_file_name);
  base::FilePath path(native_file_name);
  int data_length = env->GetArrayLength(data);
  jbyte* native_data = env->GetByteArrayElements(data, NULL);
  std::string native_data_string(reinterpret_cast<char *>(native_data),
                                 data_length);
  bool result = base::ImportantFileWriter::WriteFileAtomically(
      path, native_data_string);
  env->ReleaseByteArrayElements(data, native_data, JNI_ABORT);
  return result;
}

bool RegisterImportantFileWriterAndroid(JNIEnv* env) {
  return RegisterNativesImpl(env);
}

}  // namespace android
}  // namespace base


Add ERROR prints on unexpected conditions

--- alice4/software/touchscreen_tests/ts_test1.cpp
+++ alice4/software/touchscreen_tests/ts_test1.cpp
@@ -9,6 +9,7 @@
     touchscreen_init();

     while(1) {
+	static bool dragging = false;
 	int x, y;
 	float z;

@@ -17,12 +18,20 @@
 	    switch(e) {
 		case TOUCHSCREEN_START:
 		    printf("start %d %d %f\n", x, y, z);
+		    if(dragging)
+			printf("ERROR: START WHILE ALREADY DRAGGING\n");
+		    dragging = true;
 		    break;
 		case TOUCHSCREEN_DRAG:
 		    printf("drag %d %d %f\n", x, y, z);
+		    if(!dragging)
+			printf("ERROR: DRAG WHILE NOT STARTED\n");
 		    break;
 		case TOUCHSCREEN_STOP:
 		    printf("stop\n");
+		    if(!dragging)
+			printf("ERROR: STOP WHILE NOT STARTED\n");
+		    dragging = false;
 		    break;
 		case TOUCHSCREEN_IDLE:
 		default:

<|original_code|>
#include <cstdio>
#include <cstdlib>
#include <fcntl.h>
#include <unistd.h>
#include "touchscreen.h"

int main()
{
    touchscreen_init();

    while(1) {
	int x, y;
	float z;

        TouchscreenEvent e;
	while((e = touchscreen_read(&x, &y, &z)) != TOUCHSCREEN_IDLE) {
	    switch(e) {
		case TOUCHSCREEN_START:
		    printf("start %d %d %f\n", x, y, z);
		    break;
		case TOUCHSCREEN_DRAG:
		    printf("drag %d %d %f\n", x, y, z);
		    break;
		case TOUCHSCREEN_STOP:
		    printf("stop\n");
		    break;
		case TOUCHSCREEN_IDLE:
		default:
		    break;
	    }
	}

	// usleep(100000);
    }
}

<|edits_diff|>
--- alice4/software/touchscreen_tests/ts_test1.cpp
+++ alice4/software/touchscreen_tests/ts_test1.cpp
@@ -9,6 +9,7 @@
     touchscreen_init();

     while(1) {
+	static bool dragging = false;
 	int x, y;
 	float z;

@@ -17,9 +18,14 @@
 	    switch(e) {
 		case TOUCHSCREEN_START:
 		    printf("start %d %d %f\n", x, y, z);
+		    if(dragging)
+			printf("ERROR: START WHILE ALREADY DRAGGING\n");
+		    dragging = true;
 		    break;
 		case TOUCHSCREEN_DRAG:
 		    printf("drag %d %d %f\n", x, y, z);
+		    if(!dragging)
+			printf("ERROR: DRAG WHILE NOT STARTED\n");
 		    break;
 		case TOUCHSCREEN_STOP:
 		    printf("stop\n");
<|current_version|>
#include <cstdio>
#include <cstdlib>
#include <fcntl.h>
#include <unistd.h>
#include "touchscreen.h"

int main()
{
    touchscreen_init();

    while(1) {
	static bool dragging = false;
	int x, y;
	float z;

        TouchscreenEvent e;
	while((e = touchscreen_read(&x, &y, &z)) != TOUCHSCREEN_IDLE) {
	    switch(e) {
		case TOUCHSCREEN_START:
		    printf("start %d %d %f\n", x, y, z);
		    if(dragging)
			printf("ERROR: START WHILE ALREADY DRAGGING\n");
		    dragging = true;
		    break;
		case TOUCHSCREEN_DRAG:
		    printf("drag %d %d %f\n", x, y, z);
		    if(!dragging)
			printf("ERROR: DRAG WHILE NOT STARTED\n");
		    break;
		case TOUCHSCREEN_STOP:
		    printf("stop\n");
		    break;
		case TOUCHSCREEN_IDLE:
		default:
		    break;
	    }
	}

	// usleep(100000);
    }
}

<|next_version|>
#include <cstdio>
#include <cstdlib>
#include <fcntl.h>
#include <unistd.h>
#include "touchscreen.h"

int main()
{
    touchscreen_init();

    while(1) {
	static bool dragging = false;
	int x, y;
	float z;

        TouchscreenEvent e;
	while((e = touchscreen_read(&x, &y, &z)) != TOUCHSCREEN_IDLE) {
	    switch(e) {
		case TOUCHSCREEN_START:
		    printf("start %d %d %f\n", x, y, z);
		    if(dragging)
			printf("ERROR: START WHILE ALREADY DRAGGING\n");
		    dragging = true;
		    break;
		case TOUCHSCREEN_DRAG:
		    printf("drag %d %d %f\n", x, y, z);
		    if(!dragging)
			printf("ERROR: DRAG WHILE NOT STARTED\n");
		    break;
		case TOUCHSCREEN_STOP:
		    printf("stop\n");
		    if(!dragging)
			printf("ERROR: STOP WHILE NOT STARTED\n");
		    dragging = false;
		    break;
		case TOUCHSCREEN_IDLE:
		default:
		    break;
	    }
	}

	// usleep(100000);
    }
}


Add noexcept test for offsetof macro per [support.types]/p4.

git-svn-id: 273b07cebdae5845b4a75aae04570b978db9eb50@159846 91177308-0d34-0410-b5e6-96231b3b80d8

--- language.support/support.types/offsetof.pass.cpp
+++ language.support/support.types/offsetof.pass.cpp
@@ -13,6 +13,14 @@
 #error offsetof not defined
 #endif

+struct A
+{
+    int x;
+};
+
 int main()
 {
+#if (__has_feature(cxx_noexcept))
+    static_assert(noexcept(offsetof(A, x)), "");
+#endif
 }

<|original_code|>
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <cstddef>

#ifndef offsetof
#error offsetof not defined
#endif

int main()
{
}

<|edits_diff|>
--- language.support/support.types/offsetof.pass.cpp
+++ language.support/support.types/offsetof.pass.cpp
@@ -13,6 +13,11 @@
 #error offsetof not defined
 #endif

+struct A
+{
+    int x;
+};
+
 int main()
 {
 }
<|current_version|>
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <cstddef>

#ifndef offsetof
#error offsetof not defined
#endif

struct A
{
    int x;
};

int main()
{
}

<|next_version|>
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <cstddef>

#ifndef offsetof
#error offsetof not defined
#endif

struct A
{
    int x;
};

int main()
{
#if (__has_feature(cxx_noexcept))
    static_assert(noexcept(offsetof(A, x)), "");
#endif
}


Write PersistentConstraintUpdater::updateConstraints timing to log.

--- src/placement/persistent_constraint_updater.cpp
+++ src/placement/persistent_constraint_updater.cpp
@@ -1,5 +1,9 @@
 #include "./persistent_constraint_updater.h"
+#include <chrono>
+#include <QLoggingCategory>
 #include "./constraint_updater.h"
+
+QLoggingCategory pcuChan("Placement.PersistentConstraintUpdater");

 PersistentConstraintUpdater::PersistentConstraintUpdater(
     std::shared_ptr<ConstraintUpdater> constraintUpdater)
@@ -11,6 +15,7 @@
     int labelId, Eigen::Vector2i anchorForBuffer,
     Eigen::Vector2i labelSizeForBuffer)
 {
+  auto startTime = std::chrono::high_resolution_clock::now();
   constraintUpdater->clear();

   for (auto &placedLabelPair : placedLabels)
@@ -23,6 +28,11 @@

   placedLabels[labelId] = PlacedLabelInfo{ labelSizeForBuffer, anchorForBuffer,
                                            Eigen::Vector2i(-1, -1) };
+
+  auto endTime = std::chrono::high_resolution_clock::now();
+  std::chrono::duration<float, std::milli> diff = endTime - startTime;
+
+  qCInfo(pcuChan) << "updateConstraints took" << diff.count() << "ms";
 }

 void PersistentConstraintUpdater::setPosition(int labelId,

<|original_code|>
#include "./persistent_constraint_updater.h"
#include "./constraint_updater.h"

PersistentConstraintUpdater::PersistentConstraintUpdater(
    std::shared_ptr<ConstraintUpdater> constraintUpdater)
  : constraintUpdater(constraintUpdater)
{
}

void PersistentConstraintUpdater::updateConstraints(
    int labelId, Eigen::Vector2i anchorForBuffer,
    Eigen::Vector2i labelSizeForBuffer)
{
  constraintUpdater->clear();

  for (auto &placedLabelPair : placedLabels)
  {
    auto &placedLabel = placedLabelPair.second;
    constraintUpdater->drawConstraintRegionFor(
        anchorForBuffer, labelSizeForBuffer, placedLabel.anchorPosition,
        placedLabel.labelPosition, placedLabel.size);
  }

  placedLabels[labelId] = PlacedLabelInfo{ labelSizeForBuffer, anchorForBuffer,
                                           Eigen::Vector2i(-1, -1) };
}

void PersistentConstraintUpdater::setPosition(int labelId,
                                              Eigen::Vector2i position)
{
  placedLabels[labelId].labelPosition = position;
}

void PersistentConstraintUpdater::clear()
{
  placedLabels.clear();
}

<|edits_diff|>
--- src/placement/persistent_constraint_updater.cpp
+++ src/placement/persistent_constraint_updater.cpp
@@ -1,5 +1,9 @@
 #include "./persistent_constraint_updater.h"
+#include <chrono>
+#include <QLoggingCategory>
 #include "./constraint_updater.h"
+
+QLoggingCategory pcuChan("Placement.PersistentConstraintUpdater");

 PersistentConstraintUpdater::PersistentConstraintUpdater(
     std::shared_ptr<ConstraintUpdater> constraintUpdater)
@@ -11,6 +15,7 @@
     int labelId, Eigen::Vector2i anchorForBuffer,
     Eigen::Vector2i labelSizeForBuffer)
 {
+  auto startTime = std::chrono::high_resolution_clock::now();
   constraintUpdater->clear();

   for (auto &placedLabelPair : placedLabels)
<|current_version|>
#include "./persistent_constraint_updater.h"
#include <chrono>
#include <QLoggingCategory>
#include "./constraint_updater.h"

QLoggingCategory pcuChan("Placement.PersistentConstraintUpdater");

PersistentConstraintUpdater::PersistentConstraintUpdater(
    std::shared_ptr<ConstraintUpdater> constraintUpdater)
  : constraintUpdater(constraintUpdater)
{
}

void PersistentConstraintUpdater::updateConstraints(
    int labelId, Eigen::Vector2i anchorForBuffer,
    Eigen::Vector2i labelSizeForBuffer)
{
  auto startTime = std::chrono::high_resolution_clock::now();
  constraintUpdater->clear();

  for (auto &placedLabelPair : placedLabels)
  {
    auto &placedLabel = placedLabelPair.second;
    constraintUpdater->drawConstraintRegionFor(
        anchorForBuffer, labelSizeForBuffer, placedLabel.anchorPosition,
        placedLabel.labelPosition, placedLabel.size);
  }

  placedLabels[labelId] = PlacedLabelInfo{ labelSizeForBuffer, anchorForBuffer,
                                           Eigen::Vector2i(-1, -1) };
}

void PersistentConstraintUpdater::setPosition(int labelId,
                                              Eigen::Vector2i position)
{
  placedLabels[labelId].labelPosition = position;
}

void PersistentConstraintUpdater::clear()
{
  placedLabels.clear();
}

<|next_version|>
#include "./persistent_constraint_updater.h"
#include <chrono>
#include <QLoggingCategory>
#include "./constraint_updater.h"

QLoggingCategory pcuChan("Placement.PersistentConstraintUpdater");

PersistentConstraintUpdater::PersistentConstraintUpdater(
    std::shared_ptr<ConstraintUpdater> constraintUpdater)
  : constraintUpdater(constraintUpdater)
{
}

void PersistentConstraintUpdater::updateConstraints(
    int labelId, Eigen::Vector2i anchorForBuffer,
    Eigen::Vector2i labelSizeForBuffer)
{
  auto startTime = std::chrono::high_resolution_clock::now();
  constraintUpdater->clear();

  for (auto &placedLabelPair : placedLabels)
  {
    auto &placedLabel = placedLabelPair.second;
    constraintUpdater->drawConstraintRegionFor(
        anchorForBuffer, labelSizeForBuffer, placedLabel.anchorPosition,
        placedLabel.labelPosition, placedLabel.size);
  }

  placedLabels[labelId] = PlacedLabelInfo{ labelSizeForBuffer, anchorForBuffer,
                                           Eigen::Vector2i(-1, -1) };

  auto endTime = std::chrono::high_resolution_clock::now();
  std::chrono::duration<float, std::milli> diff = endTime - startTime;

  qCInfo(pcuChan) << "updateConstraints took" << diff.count() << "ms";
}

void PersistentConstraintUpdater::setPosition(int labelId,
                                              Eigen::Vector2i position)
{
  placedLabels[labelId].labelPosition = position;
}

void PersistentConstraintUpdater::clear()
{
  placedLabels.clear();
}


Prepare for flag to allow writing.

Prepare for flag to allow writing.

--- Magick++/fuzz/encoder_fuzzer.cc
+++ Magick++/fuzz/encoder_fuzzer.cc
@@ -10,6 +10,7 @@
 #ifndef FUZZ_ENCODER
 #define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_ENCODER)
 #endif
+#define FUZZ_IMAGEMAGICK_ENCODER_WRITE 1

 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   const Magick::Blob blob(Data, Size);
@@ -23,11 +24,14 @@
     return 0;
   }

+#if FUZZ_IMAGEMAGICK_ENCODER_WRITE
+
   Magick::Blob outBlob;
   try {
     image.write(&outBlob, FUZZ_ENCODER);
   }
   catch (Magick::Exception &e) {
   }
+#endif
   return 0;
 }

<|original_code|>
#include <cstdint>

#include <Magick++/Blob.h>
#include <Magick++/Image.h>

#include "utils.cc"

#define FUZZ_ENCODER_STRING_LITERAL_X(name) FUZZ_ENCODER_STRING_LITERAL(name)
#define FUZZ_ENCODER_STRING_LITERAL(name) #name
#ifndef FUZZ_ENCODER
#define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_ENCODER)
#endif

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
  const Magick::Blob blob(Data, Size);
  Magick::Image image;
  image.magick(FUZZ_ENCODER);
  image.fileName(std::string(FUZZ_ENCODER) + ":");
  try {
    image.read(blob);
  }
  catch (Magick::Exception &e) {
    return 0;
  }

  Magick::Blob outBlob;
  try {
    image.write(&outBlob, FUZZ_ENCODER);
  }
  catch (Magick::Exception &e) {
  }
  return 0;
}

<|edits_diff|>
--- Magick++/fuzz/encoder_fuzzer.cc
+++ Magick++/fuzz/encoder_fuzzer.cc
@@ -10,6 +10,7 @@
 #ifndef FUZZ_ENCODER
 #define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_ENCODER)
 #endif
+#define FUZZ_IMAGEMAGICK_ENCODER_WRITE 1

 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   const Magick::Blob blob(Data, Size);
@@ -23,6 +24,8 @@
     return 0;
   }

+#if FUZZ_IMAGEMAGICK_ENCODER_WRITE
+
   Magick::Blob outBlob;
   try {
     image.write(&outBlob, FUZZ_ENCODER);
<|current_version|>
#include <cstdint>

#include <Magick++/Blob.h>
#include <Magick++/Image.h>

#include "utils.cc"

#define FUZZ_ENCODER_STRING_LITERAL_X(name) FUZZ_ENCODER_STRING_LITERAL(name)
#define FUZZ_ENCODER_STRING_LITERAL(name) #name
#ifndef FUZZ_ENCODER
#define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_ENCODER)
#endif
#define FUZZ_IMAGEMAGICK_ENCODER_WRITE 1

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
  const Magick::Blob blob(Data, Size);
  Magick::Image image;
  image.magick(FUZZ_ENCODER);
  image.fileName(std::string(FUZZ_ENCODER) + ":");
  try {
    image.read(blob);
  }
  catch (Magick::Exception &e) {
    return 0;
  }

#if FUZZ_IMAGEMAGICK_ENCODER_WRITE

  Magick::Blob outBlob;
  try {
    image.write(&outBlob, FUZZ_ENCODER);
  }
  catch (Magick::Exception &e) {
  }
  return 0;
}

<|next_version|>
#include <cstdint>

#include <Magick++/Blob.h>
#include <Magick++/Image.h>

#include "utils.cc"

#define FUZZ_ENCODER_STRING_LITERAL_X(name) FUZZ_ENCODER_STRING_LITERAL(name)
#define FUZZ_ENCODER_STRING_LITERAL(name) #name
#ifndef FUZZ_ENCODER
#define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_ENCODER)
#endif
#define FUZZ_IMAGEMAGICK_ENCODER_WRITE 1

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
  const Magick::Blob blob(Data, Size);
  Magick::Image image;
  image.magick(FUZZ_ENCODER);
  image.fileName(std::string(FUZZ_ENCODER) + ":");
  try {
    image.read(blob);
  }
  catch (Magick::Exception &e) {
    return 0;
  }

#if FUZZ_IMAGEMAGICK_ENCODER_WRITE

  Magick::Blob outBlob;
  try {
    image.write(&outBlob, FUZZ_ENCODER);
  }
  catch (Magick::Exception &e) {
  }
#endif
  return 0;
}


Fix build by adding DE_UNREF

Fix build by adding DE_UNREF

Function parameters weren't being used in the renderdoc stub interface,
so the warnings should be silenced.

Components: Framework

Change-Id: I0f060c344c6b5959028efcc2489d1bc30b43fb9f

--- external/vulkancts/framework/vulkan/vkNoRenderDocUtil.cpp
+++ external/vulkancts/framework/vulkan/vkNoRenderDocUtil.cpp
@@ -46,10 +46,12 @@

 void RenderDocUtil::startFrame (vk::VkInstance instance)
 {
+	DE_UNREF(instance);
 }

 void RenderDocUtil::endFrame (vk::VkInstance instance)
 {
+	DE_UNREF(instance);
 }

 } // vk

<|original_code|>
/*-------------------------------------------------------------------------
 * Vulkan CTS Framework
 * --------------------
 *
 * Copyright (c) 2018 The Khronos Group Inc.
 * Copyright (c) 2019 Intel Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *//*!
 * \file
 * \brief Stub no-op version of RenderDocUtil class
 *//*--------------------------------------------------------------------*/

#include "vkRenderDocUtil.hpp"

namespace vk
{

struct RenderDocPrivate
{
};

RenderDocUtil::RenderDocUtil (void)
{
}

RenderDocUtil::~RenderDocUtil (void)
{
}

bool RenderDocUtil::isValid (void)
{
	return false;
}

void RenderDocUtil::startFrame (vk::VkInstance instance)
{
}

void RenderDocUtil::endFrame (vk::VkInstance instance)
{
}

} // vk

<|edits_diff|>
--- external/vulkancts/framework/vulkan/vkNoRenderDocUtil.cpp
+++ external/vulkancts/framework/vulkan/vkNoRenderDocUtil.cpp
@@ -46,6 +46,7 @@

 void RenderDocUtil::startFrame (vk::VkInstance instance)
 {
+	DE_UNREF(instance);
 }

 void RenderDocUtil::endFrame (vk::VkInstance instance)
<|current_version|>
/*-------------------------------------------------------------------------
 * Vulkan CTS Framework
 * --------------------
 *
 * Copyright (c) 2018 The Khronos Group Inc.
 * Copyright (c) 2019 Intel Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *//*!
 * \file
 * \brief Stub no-op version of RenderDocUtil class
 *//*--------------------------------------------------------------------*/

#include "vkRenderDocUtil.hpp"

namespace vk
{

struct RenderDocPrivate
{
};

RenderDocUtil::RenderDocUtil (void)
{
}

RenderDocUtil::~RenderDocUtil (void)
{
}

bool RenderDocUtil::isValid (void)
{
	return false;
}

void RenderDocUtil::startFrame (vk::VkInstance instance)
{
	DE_UNREF(instance);
}

void RenderDocUtil::endFrame (vk::VkInstance instance)
{
}

} // vk

<|next_version|>
/*-------------------------------------------------------------------------
 * Vulkan CTS Framework
 * --------------------
 *
 * Copyright (c) 2018 The Khronos Group Inc.
 * Copyright (c) 2019 Intel Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *//*!
 * \file
 * \brief Stub no-op version of RenderDocUtil class
 *//*--------------------------------------------------------------------*/

#include "vkRenderDocUtil.hpp"

namespace vk
{

struct RenderDocPrivate
{
};

RenderDocUtil::RenderDocUtil (void)
{
}

RenderDocUtil::~RenderDocUtil (void)
{
}

bool RenderDocUtil::isValid (void)
{
	return false;
}

void RenderDocUtil::startFrame (vk::VkInstance instance)
{
	DE_UNREF(instance);
}

void RenderDocUtil::endFrame (vk::VkInstance instance)
{
	DE_UNREF(instance);
}

} // vk


Disable the failing Trap.SigSysAction test under TSan.

BUG=481297
TBR=hidehiko@chromium.org,mdempsky@chromium.org

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

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

--- sandbox/linux/seccomp-bpf/trap_unittest.cc
+++ sandbox/linux/seccomp-bpf/trap_unittest.cc
@@ -12,6 +12,7 @@
 namespace sandbox {
 namespace {

+#if !defined(THREAD_SANITIZER)
 SANDBOX_TEST_ALLOW_NOISE(Trap, SigSysAction) {
   // This creates a global Trap instance, and registers the signal handler
   // (Trap::SigSysAction).
@@ -23,6 +24,7 @@
   // "Unexpected SIGSYS received." so it is necessary to allow the noise.
   raise(SIGSYS);
 }
+#endif

 }  // namespace
 }  // namespace sandbox

<|original_code|>
// Copyright 2015 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 "sandbox/linux/seccomp-bpf/trap.h"

#include <signal.h>

#include "sandbox/linux/tests/unit_tests.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace sandbox {
namespace {

SANDBOX_TEST_ALLOW_NOISE(Trap, SigSysAction) {
  // This creates a global Trap instance, and registers the signal handler
  // (Trap::SigSysAction).
  Trap::Registry();

  // Send SIGSYS to self. If signal handler (SigSysAction) is not registered,
  // the process will be terminated with status code -SIGSYS.
  // Note that, SigSysAction handler would output an error message
  // "Unexpected SIGSYS received." so it is necessary to allow the noise.
  raise(SIGSYS);
}

}  // namespace
}  // namespace sandbox

<|edits_diff|>
--- sandbox/linux/seccomp-bpf/trap_unittest.cc
+++ sandbox/linux/seccomp-bpf/trap_unittest.cc
@@ -12,6 +12,7 @@
 namespace sandbox {
 namespace {

+#if !defined(THREAD_SANITIZER)
 SANDBOX_TEST_ALLOW_NOISE(Trap, SigSysAction) {
   // This creates a global Trap instance, and registers the signal handler
   // (Trap::SigSysAction).
<|current_version|>
// Copyright 2015 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 "sandbox/linux/seccomp-bpf/trap.h"

#include <signal.h>

#include "sandbox/linux/tests/unit_tests.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace sandbox {
namespace {

#if !defined(THREAD_SANITIZER)
SANDBOX_TEST_ALLOW_NOISE(Trap, SigSysAction) {
  // This creates a global Trap instance, and registers the signal handler
  // (Trap::SigSysAction).
  Trap::Registry();

  // Send SIGSYS to self. If signal handler (SigSysAction) is not registered,
  // the process will be terminated with status code -SIGSYS.
  // Note that, SigSysAction handler would output an error message
  // "Unexpected SIGSYS received." so it is necessary to allow the noise.
  raise(SIGSYS);
}

}  // namespace
}  // namespace sandbox

<|next_version|>
// Copyright 2015 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 "sandbox/linux/seccomp-bpf/trap.h"

#include <signal.h>

#include "sandbox/linux/tests/unit_tests.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace sandbox {
namespace {

#if !defined(THREAD_SANITIZER)
SANDBOX_TEST_ALLOW_NOISE(Trap, SigSysAction) {
  // This creates a global Trap instance, and registers the signal handler
  // (Trap::SigSysAction).
  Trap::Registry();

  // Send SIGSYS to self. If signal handler (SigSysAction) is not registered,
  // the process will be terminated with status code -SIGSYS.
  // Note that, SigSysAction handler would output an error message
  // "Unexpected SIGSYS received." so it is necessary to allow the noise.
  raise(SIGSYS);
}
#endif

}  // namespace
}  // namespace sandbox


Make sure Im using Boost libraries, not just headers.

--- Code/Apps/mpMyFirstApp.cpp
+++ Code/Apps/mpMyFirstApp.cpp
@@ -21,6 +21,8 @@

 #ifdef BUILD_Boost
 #include <boost/math/special_functions/round.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/filesystem/path.hpp>
 #endif

 #ifdef BUILD_OpenCV
@@ -37,6 +39,8 @@

 #ifdef BUILD_Boost
   std::cout << "Rounding to ... " << boost::math::round(0.123) << std::endl;
+  boost::posix_time::ptime startTime = boost::posix_time::second_clock::local_time();
+  boost::filesystem::path pathname( "/tmp/tmp.txt" );
 #endif

 #ifdef BUILD_OpenCV

<|original_code|>
/*=============================================================================

  MYPROJECT: A software package for whatever.

  Copyright (c) University College London (UCL). All rights reserved.

  This software is distributed WITHOUT ANY WARRANTY; without even
  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  PURPOSE.

  See LICENSE.txt in the top level directory for details.

=============================================================================*/

#include <mpMyFunctions.h>
#include <iostream>

#ifdef BUILD_Eigen
#include <Eigen/Dense>
#endif

#ifdef BUILD_Boost
#include <boost/math/special_functions/round.hpp>
#endif

#ifdef BUILD_OpenCV
#include <cv.h>
#endif

int main(int argc, char** argv)
{

#ifdef BUILD_Eigen
  Eigen::MatrixXd m(2,2);
  std::cout << "Printing 2x2 matrix ..." << m << std::endl;
#endif

#ifdef BUILD_Boost
  std::cout << "Rounding to ... " << boost::math::round(0.123) << std::endl;
#endif

#ifdef BUILD_OpenCV
  cv::Matx44d matrix = cv::Matx44d::eye();
  std::cout << "Printing 4x4 matrix ..." << matrix << std::endl;
#endif

  std::cout << "Calculating ... " << mp::MyFirstFunction(1) << std::endl;
  return 0;
}

<|edits_diff|>
--- Code/Apps/mpMyFirstApp.cpp
+++ Code/Apps/mpMyFirstApp.cpp
@@ -21,6 +21,8 @@

 #ifdef BUILD_Boost
 #include <boost/math/special_functions/round.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/filesystem/path.hpp>
 #endif

 #ifdef BUILD_OpenCV
<|current_version|>
/*=============================================================================

  MYPROJECT: A software package for whatever.

  Copyright (c) University College London (UCL). All rights reserved.

  This software is distributed WITHOUT ANY WARRANTY; without even
  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  PURPOSE.

  See LICENSE.txt in the top level directory for details.

=============================================================================*/

#include <mpMyFunctions.h>
#include <iostream>

#ifdef BUILD_Eigen
#include <Eigen/Dense>
#endif

#ifdef BUILD_Boost
#include <boost/math/special_functions/round.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem/path.hpp>
#endif

#ifdef BUILD_OpenCV
#include <cv.h>
#endif

int main(int argc, char** argv)
{

#ifdef BUILD_Eigen
  Eigen::MatrixXd m(2,2);
  std::cout << "Printing 2x2 matrix ..." << m << std::endl;
#endif

#ifdef BUILD_Boost
  std::cout << "Rounding to ... " << boost::math::round(0.123) << std::endl;
#endif

#ifdef BUILD_OpenCV
  cv::Matx44d matrix = cv::Matx44d::eye();
  std::cout << "Printing 4x4 matrix ..." << matrix << std::endl;
#endif

  std::cout << "Calculating ... " << mp::MyFirstFunction(1) << std::endl;
  return 0;
}

<|next_version|>
/*=============================================================================

  MYPROJECT: A software package for whatever.

  Copyright (c) University College London (UCL). All rights reserved.

  This software is distributed WITHOUT ANY WARRANTY; without even
  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  PURPOSE.

  See LICENSE.txt in the top level directory for details.

=============================================================================*/

#include <mpMyFunctions.h>
#include <iostream>

#ifdef BUILD_Eigen
#include <Eigen/Dense>
#endif

#ifdef BUILD_Boost
#include <boost/math/special_functions/round.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem/path.hpp>
#endif

#ifdef BUILD_OpenCV
#include <cv.h>
#endif

int main(int argc, char** argv)
{

#ifdef BUILD_Eigen
  Eigen::MatrixXd m(2,2);
  std::cout << "Printing 2x2 matrix ..." << m << std::endl;
#endif

#ifdef BUILD_Boost
  std::cout << "Rounding to ... " << boost::math::round(0.123) << std::endl;
  boost::posix_time::ptime startTime = boost::posix_time::second_clock::local_time();
  boost::filesystem::path pathname( "/tmp/tmp.txt" );
#endif

#ifdef BUILD_OpenCV
  cv::Matx44d matrix = cv::Matx44d::eye();
  std::cout << "Printing 4x4 matrix ..." << matrix << std::endl;
#endif

  std::cout << "Calculating ... " << mp::MyFirstFunction(1) << std::endl;
  return 0;
}


Add a basic implementation for __cxa_pure_virtual

--- src/vmm/src/lib/CxxAbi.cpp
+++ src/vmm/src/lib/CxxAbi.cpp
@@ -1,7 +1,12 @@
+#include <os/Board.h>
+
+#include <cstdio>
 #include <cstdlib>

 extern "C" void __cxa_pure_virtual()
 {
+	printf("__cxa_pure_virtual() called.  Probably a bad build.\n");
+	os::board::shutdown();
 }

 void* operator new(size_t size)

<|original_code|>
#include <cstdlib>

extern "C" void __cxa_pure_virtual()
{
}

void* operator new(size_t size)
{
	return malloc(size);
}

void* operator new[](size_t size)
{
	return malloc(size);
}

void operator delete(void *ptr)
{
	free(ptr);
}

void operator delete[](void *ptr)
{
	free(ptr);
}

<|edits_diff|>
--- src/vmm/src/lib/CxxAbi.cpp
+++ src/vmm/src/lib/CxxAbi.cpp
@@ -1,3 +1,6 @@
+#include <os/Board.h>
+
+#include <cstdio>
 #include <cstdlib>

 extern "C" void __cxa_pure_virtual()
<|current_version|>
#include <os/Board.h>

#include <cstdio>
#include <cstdlib>

extern "C" void __cxa_pure_virtual()
{
}

void* operator new(size_t size)
{
	return malloc(size);
}

void* operator new[](size_t size)
{
	return malloc(size);
}

void operator delete(void *ptr)
{
	free(ptr);
}

void operator delete[](void *ptr)
{
	free(ptr);
}

<|next_version|>
#include <os/Board.h>

#include <cstdio>
#include <cstdlib>

extern "C" void __cxa_pure_virtual()
{
	printf("__cxa_pure_virtual() called.  Probably a bad build.\n");
	os::board::shutdown();
}

void* operator new(size_t size)
{
	return malloc(size);
}

void* operator new[](size_t size)
{
	return malloc(size);
}

void operator delete(void *ptr)
{
	free(ptr);
}

void operator delete[](void *ptr)
{
	free(ptr);
}


Add Geolocation to exported APIs.

Add Geolocation to exported APIs.

--- framework/extensions.cpp
+++ framework/extensions.cpp
@@ -2,6 +2,7 @@
 #include "extensions/accelerometer.h"
 #include "extensions/debugconsole.h"
 #include "extensions/deviceinfo.h"
+#include "extensions/geolocation.h"
 #include "extensions/hash.h"
 #include "extensions/notification.h"

@@ -22,6 +23,7 @@
     m_extensions["GapAccelerometer"] = new Accelerometer(this);
     m_extensions["GapDebugConsole"] = new DebugConsole(this);
     m_extensions["GapDeviceInfo"] = new DeviceInfo(this);
+    m_extensions["GapGeolocation"] = new Geolocation(this);
     m_extensions["GapHash"] = new Hash(this);
     m_extensions["GapNotification"] = new Notification(this);

<|original_code|>
#include "extensions.h"
#include "extensions/accelerometer.h"
#include "extensions/debugconsole.h"
#include "extensions/deviceinfo.h"
#include "extensions/hash.h"
#include "extensions/notification.h"

#ifdef Q_WS_S60
#include "extensions/camera.h"
#include "extensions/memorywatcher.h"
#endif

#include <QWebFrame>

Extensions::Extensions(QWebView *webView) :
    QObject(webView) {

    m_frame = webView->page()->mainFrame();
    connect(m_frame, SIGNAL(javaScriptWindowObjectCleared()), SLOT(attachExtensions()));

    m_extensions["GapAccelerometer"] = new Accelerometer(this);
    m_extensions["GapDebugConsole"] = new DebugConsole(this);
    m_extensions["GapDeviceInfo"] = new DeviceInfo(this);
    m_extensions["GapHash"] = new Hash(this);
    m_extensions["GapNotification"] = new Notification(this);

#ifdef Q_WS_S60
    m_extensions["GapCamera"] = new Camera(this);
    m_extensions["GapMemoryWatcher"] = new MemoryWatcher(this);
#endif

    attachExtensions();
}

void Extensions::attachExtensions() {

    foreach (QString name, m_extensions.keys()) {
        m_frame->addToJavaScriptWindowObject(name, m_extensions[name]);
    }
}

<|edits_diff|>
--- framework/extensions.cpp
+++ framework/extensions.cpp
@@ -2,6 +2,7 @@
 #include "extensions/accelerometer.h"
 #include "extensions/debugconsole.h"
 #include "extensions/deviceinfo.h"
+#include "extensions/geolocation.h"
 #include "extensions/hash.h"
 #include "extensions/notification.h"

<|current_version|>
#include "extensions.h"
#include "extensions/accelerometer.h"
#include "extensions/debugconsole.h"
#include "extensions/deviceinfo.h"
#include "extensions/geolocation.h"
#include "extensions/hash.h"
#include "extensions/notification.h"

#ifdef Q_WS_S60
#include "extensions/camera.h"
#include "extensions/memorywatcher.h"
#endif

#include <QWebFrame>

Extensions::Extensions(QWebView *webView) :
    QObject(webView) {

    m_frame = webView->page()->mainFrame();
    connect(m_frame, SIGNAL(javaScriptWindowObjectCleared()), SLOT(attachExtensions()));

    m_extensions["GapAccelerometer"] = new Accelerometer(this);
    m_extensions["GapDebugConsole"] = new DebugConsole(this);
    m_extensions["GapDeviceInfo"] = new DeviceInfo(this);
    m_extensions["GapHash"] = new Hash(this);
    m_extensions["GapNotification"] = new Notification(this);

#ifdef Q_WS_S60
    m_extensions["GapCamera"] = new Camera(this);
    m_extensions["GapMemoryWatcher"] = new MemoryWatcher(this);
#endif

    attachExtensions();
}

void Extensions::attachExtensions() {

    foreach (QString name, m_extensions.keys()) {
        m_frame->addToJavaScriptWindowObject(name, m_extensions[name]);
    }
}

<|next_version|>
#include "extensions.h"
#include "extensions/accelerometer.h"
#include "extensions/debugconsole.h"
#include "extensions/deviceinfo.h"
#include "extensions/geolocation.h"
#include "extensions/hash.h"
#include "extensions/notification.h"

#ifdef Q_WS_S60
#include "extensions/camera.h"
#include "extensions/memorywatcher.h"
#endif

#include <QWebFrame>

Extensions::Extensions(QWebView *webView) :
    QObject(webView) {

    m_frame = webView->page()->mainFrame();
    connect(m_frame, SIGNAL(javaScriptWindowObjectCleared()), SLOT(attachExtensions()));

    m_extensions["GapAccelerometer"] = new Accelerometer(this);
    m_extensions["GapDebugConsole"] = new DebugConsole(this);
    m_extensions["GapDeviceInfo"] = new DeviceInfo(this);
    m_extensions["GapGeolocation"] = new Geolocation(this);
    m_extensions["GapHash"] = new Hash(this);
    m_extensions["GapNotification"] = new Notification(this);

#ifdef Q_WS_S60
    m_extensions["GapCamera"] = new Camera(this);
    m_extensions["GapMemoryWatcher"] = new MemoryWatcher(this);
#endif

    attachExtensions();
}

void Extensions::attachExtensions() {

    foreach (QString name, m_extensions.keys()) {
        m_frame->addToJavaScriptWindowObject(name, m_extensions[name]);
    }
}