From 888c78120b3d444c6c4068c3b434110bb10c238b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 27 Jul 2014 23:20:25 -0700 Subject: [PATCH 01/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/5797e7d27cd5 Author: Pavel Ivanov Desc: Merge pull request #22153 from pivanov/bug-1035696 Bug 1035696 - [Video] - check missing images ======== https://hg.mozilla.org/integration/gaia-central/rev/1b000f10c6ec Author: Pavel Ivanov Desc: Bug 1035696 - [Video] - check missing images --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 740dc62489d2..da92a5192c23 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "97a95feb1d1505c9d179266fee891e600ad8760b", + "revision": "5797e7d27cd59ae08bc32223339841548015d0c0", "repo_path": "/integration/gaia-central" } From f4dc45a01f8b1b2fcdbbe17dc8d09d379ec0b67d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 27 Jul 2014 23:26:40 -0700 Subject: [PATCH 02/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 3f0637e03d0d..c40f9bf1cc6b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index d9405d1c8f80..0c065fe94eda 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 6c6a2d018e6a..26d9013b9a04 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 3f0637e03d0d..c40f9bf1cc6b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 9382e2adf068..1752d529ccd8 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 077ed79a0159..a0ca40aa46ed 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 626c507870e5..0f13e7af4a5e 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 5b77eacd7494..9479e3e4e1d3 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 10d3d5c2b3b7..aa050d7b9b13 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 0665d01207e4a8cedd3c2aae40346bb3620cea66 Mon Sep 17 00:00:00 2001 From: Thinker Li Date: Fri, 25 Jul 2014 20:52:00 +0200 Subject: [PATCH 03/50] Bug 977026 - part 1: allow thread registering before the profiler is initialized. r=bgirard --- tools/profiler/platform.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/profiler/platform.cpp b/tools/profiler/platform.cpp index d84ef0478c2d..a4bac142f5ed 100644 --- a/tools/profiler/platform.cpp +++ b/tools/profiler/platform.cpp @@ -878,6 +878,10 @@ void mozilla_sampler_unlock() bool mozilla_sampler_register_thread(const char* aName, void* stackTop) { + if (sInitCount == 0) { + return false; + } + #if defined(MOZ_WIDGET_GONK) && !defined(MOZ_PROFILING) // The only way to profile secondary threads on b2g // is to build with profiling OR have the profiler @@ -895,6 +899,10 @@ bool mozilla_sampler_register_thread(const char* aName, void* stackTop) void mozilla_sampler_unregister_thread() { + if (sInitCount == 0) { + return; + } + Sampler::UnregisterCurrentThread(); PseudoStack *stack = tlsPseudoStack.get(); @@ -906,6 +914,10 @@ void mozilla_sampler_unregister_thread() } void mozilla_sampler_sleep_start() { + if (sInitCount == 0) { + return; + } + PseudoStack *stack = tlsPseudoStack.get(); if (stack == nullptr) { return; @@ -914,6 +926,10 @@ void mozilla_sampler_sleep_start() { } void mozilla_sampler_sleep_end() { + if (sInitCount == 0) { + return; + } + PseudoStack *stack = tlsPseudoStack.get(); if (stack == nullptr) { return; From 5a9232dbfc1d4cb3cd49ff4697532195a60cf95c Mon Sep 17 00:00:00 2001 From: "Thinker K.F. Li" Date: Fri, 25 Jul 2014 20:52:00 +0200 Subject: [PATCH 04/50] Bug 977026 - part 2: B2G loader. r=khuey,cyu --HG-- rename : ipc/app/MozillaRuntimeMain.cpp => ipc/contentproc/plugin-container.cpp --- b2g/app/B2GLoader.cpp | 167 ++++++ b2g/app/moz.build | 5 + b2g/app/nsBrowserApp.cpp | 45 +- b2g/confvars.sh | 1 + configure.in | 8 + ipc/app/Makefile.in | 4 + ipc/app/MozillaRuntimeMain.cpp | 147 +----- ipc/chromium/src/base/process_util_linux.cc | 68 +++ ipc/contentproc/moz.build | 29 ++ ipc/contentproc/plugin-container.cpp | 151 ++++++ ipc/glue/PProcLoader.ipdl | 35 ++ ipc/glue/ProcessUtils.h | 17 + ipc/glue/ProcessUtils_linux.cpp | 550 ++++++++++++++++++++ ipc/glue/moz.build | 2 + ipc/moz.build | 3 + toolkit/xre/nsAppRunner.cpp | 8 + xpcom/base/nsDebugImpl.cpp | 10 + xpcom/build/nsXULAppAPI.h | 7 + xpcom/threads/BackgroundHangMonitor.cpp | 56 +- xpcom/threads/BackgroundHangMonitor.h | 23 + 20 files changed, 1187 insertions(+), 149 deletions(-) create mode 100644 b2g/app/B2GLoader.cpp create mode 100644 ipc/contentproc/moz.build create mode 100644 ipc/contentproc/plugin-container.cpp create mode 100644 ipc/glue/PProcLoader.ipdl diff --git a/b2g/app/B2GLoader.cpp b/b2g/app/B2GLoader.cpp new file mode 100644 index 000000000000..2eb2b14f784c --- /dev/null +++ b/b2g/app/B2GLoader.cpp @@ -0,0 +1,167 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set sw=2 ts=2 autoindent cindent expandtab: */ +/* 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 "nsXULAppAPI.h" +#include "nsXPCOMGlue.h" +#include "nsStringGlue.h" +#include "nsCOMPtr.h" +#include "nsIFile.h" +#include "BinaryPath.h" +#include "nsAutoPtr.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL + +#define ASSERT(x) if (!(x)) { MOZ_CRASH(); } + + +// Functions being loaded by XPCOMGlue +XRE_ProcLoaderServiceRunType XRE_ProcLoaderServiceRun; +XRE_ProcLoaderClientInitType XRE_ProcLoaderClientInit; + +static const nsDynamicFunctionLoad kXULFuncs[] = { + { "XRE_ProcLoaderServiceRun", (NSFuncPtr*) &XRE_ProcLoaderServiceRun }, + { "XRE_ProcLoaderClientInit", (NSFuncPtr*) &XRE_ProcLoaderClientInit }, + { nullptr, nullptr } +}; + +static int +GetDirnameSlash(const char *aPath, char *aOutDir, int aMaxLen) +{ + char *lastSlash = strrchr(aPath, XPCOM_FILE_PATH_SEPARATOR[0]); + if (lastSlash == nullptr) { + return 0; + } + int cpsz = lastSlash - aPath + 1; // include slash + if (aMaxLen <= cpsz) { + return 0; + } + strncpy(aOutDir, aPath, cpsz); + aOutDir[cpsz] = 0; + return cpsz; +} + +static bool +GetXPCOMPath(const char *aProgram, char *aOutPath, int aMaxLen) +{ + nsAutoArrayPtr progBuf(new char[aMaxLen]); + nsresult rv = mozilla::BinaryPath::Get(aProgram, progBuf); + NS_ENSURE_SUCCESS(rv, false); + + int len = GetDirnameSlash(progBuf, aOutPath, aMaxLen); + NS_ENSURE_TRUE(!!len, false); + + NS_ENSURE_TRUE((len + sizeof(XPCOM_DLL)) < aMaxLen, false); + char *afterSlash = aOutPath + len; + strcpy(afterSlash, XPCOM_DLL); + return true; +} + +static bool +LoadLibxul(const char *aXPCOMPath) +{ + nsresult rv; + + XPCOMGlueEnablePreload(); + rv = XPCOMGlueStartup(aXPCOMPath); + NS_ENSURE_SUCCESS(rv, false); + + rv = XPCOMGlueLoadXULFunctions(kXULFuncs); + NS_ENSURE_SUCCESS(rv, false); + + return true; +} + +static bool +LoadStaticData(const char *aProgram) +{ + char xpcomPath[MAXPATHLEN]; + bool ok = GetXPCOMPath(aProgram, xpcomPath, MAXPATHLEN); + NS_ENSURE_TRUE(ok, false); + + ok = LoadLibxul(xpcomPath); + return ok; +} + +/** + * Fork and run parent and child process. + * + * The parent is the b2g process and child for Nuwa. + */ +static int +RunProcesses(int argc, const char *argv[]) +{ + /* + * The original main() of the b2g process. It is renamed to + * b2g_main() for the b2g loader. + */ + int b2g_main(int argc, const char *argv[]); + + int ipcSockets[2] = {-1, -1}; + int r = socketpair(AF_LOCAL, SOCK_STREAM, 0, ipcSockets); + ASSERT(r == 0); + int parentSock = ipcSockets[0]; + int childSock = ipcSockets[1]; + + r = fcntl(parentSock, F_SETFL, O_NONBLOCK); + ASSERT(r != -1); + r = fcntl(childSock, F_SETFL, O_NONBLOCK); + ASSERT(r != -1); + + pid_t pid = fork(); + ASSERT(pid >= 0); + bool isChildProcess = pid == 0; + + close(isChildProcess ? parentSock : childSock); + + if (isChildProcess) { + /* The Nuwa process */ + /* This provides the IPC service of loading Nuwa at the process. + * The b2g process would send a IPC message of loading Nuwa + * as the replacement of forking and executing plugin-container. + */ + return XRE_ProcLoaderServiceRun(getppid(), childSock, argc, argv); + } + + // The b2g process + int childPid = pid; + XRE_ProcLoaderClientInit(childPid, parentSock); + return b2g_main(argc, argv); +} + +/** + * B2G Loader is responsible for loading the b2g process and the + * Nuwa process. It forks into the parent process, for the b2g + * process, and the child process, for the Nuwa process. + * + * The loader loads libxul and performs initialization of static data + * before forking, so relocation of libxul and static data can be + * shared between the b2g process, the Nuwa process, and the content + * processes. + */ +int +main(int argc, const char* argv[]) +{ + const char *program = argv[0]; + /* + * Before fork(), libxul and static data of Gecko are loaded for + * sharing. + */ + bool ok = LoadStaticData(program); + if (!ok) { + return 255; + } + + return RunProcesses(argc, argv); +} diff --git a/b2g/app/moz.build b/b2g/app/moz.build index 77879ddb4440..82b60ad6db31 100644 --- a/b2g/app/moz.build +++ b/b2g/app/moz.build @@ -9,6 +9,11 @@ if not CONFIG['LIBXUL_SDK']: PROGRAM = CONFIG['MOZ_APP_NAME'] + "-bin" else: PROGRAM = CONFIG['MOZ_APP_NAME'] + if CONFIG['MOZ_B2G_LOADER']: + SOURCES += [ + 'B2GLoader.cpp', + ] + SOURCES += [ 'nsBrowserApp.cpp', ] diff --git a/b2g/app/nsBrowserApp.cpp b/b2g/app/nsBrowserApp.cpp index bf57ef445744..f4b3e8e45a82 100644 --- a/b2g/app/nsBrowserApp.cpp +++ b/b2g/app/nsBrowserApp.cpp @@ -17,6 +17,7 @@ #include #include +#include #include "nsCOMPtr.h" #include "nsIFile.h" @@ -163,9 +164,22 @@ static int do_main(int argc, char* argv[]) return XRE_main(argc, argv, &sAppData, 0); } -int main(int argc, char* argv[]) +#ifdef MOZ_B2G_LOADER +/* + * The main() in B2GLoader.cpp is the new main function instead of the + * main() here if it is enabled. So, rename it to b2g_man(). + */ +#define main b2g_main +#define _CONST const +#else +#define _CONST +#endif + +int main(int argc, _CONST char* argv[]) { +#ifndef MOZ_B2G_LOADER char exePath[MAXPATHLEN]; +#endif #ifdef MOZ_WIDGET_GONK // This creates a ThreadPool for binder ipc. A ThreadPool is necessary to @@ -175,7 +189,9 @@ int main(int argc, char* argv[]) android::ProcessState::self()->startThreadPool(); #endif - nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath); + nsresult rv; +#ifndef MOZ_B2G_LOADER + rv = mozilla::BinaryPath::Get(argv[0], exePath); if (NS_FAILED(rv)) { Output("Couldn't calculate the application directory.\n"); return 255; @@ -186,6 +202,7 @@ int main(int argc, char* argv[]) return 255; strcpy(++lastSlash, XPCOM_DLL); +#endif // MOZ_B2G_LOADER #if defined(XP_UNIX) // If the b2g app is launched from adb shell, then the shell will wind @@ -209,6 +226,9 @@ int main(int argc, char* argv[]) DllBlocklist_Initialize(); #endif + // B2G loader has already initialized Gecko so we can't initialize + // it again here. +#ifndef MOZ_B2G_LOADER // We do this because of data in bug 771745 XPCOMGlueEnablePreload(); @@ -219,6 +239,7 @@ int main(int argc, char* argv[]) } // Reset exePath so that it is the directory name and not the xpcom dll name *lastSlash = 0; +#endif // MOZ_B2G_LOADER rv = XPCOMGlueLoadXULFunctions(kXULFuncs); if (NS_FAILED(rv)) { @@ -253,7 +274,25 @@ int main(int argc, char* argv[]) int result; { ScopedLogging log; - result = do_main(argc, argv); + char **_argv; + + /* + * Duplicate argument vector to conform non-const argv of + * do_main() since XRE_main() is very stupid with non-const argv. + */ + _argv = new char *[argc + 1]; + for (int i = 0; i < argc; i++) { + _argv[i] = strdup(argv[i]); + MOZ_ASSERT(_argv[i] != nullptr); + } + _argv[argc] = nullptr; + + result = do_main(argc, _argv); + + for (int i = 0; i < argc; i++) { + free(_argv[i]); + } + delete[] _argv; } return result; diff --git a/b2g/confvars.sh b/b2g/confvars.sh index f77d791fb0dd..98ef5283328a 100644 --- a/b2g/confvars.sh +++ b/b2g/confvars.sh @@ -59,6 +59,7 @@ MOZ_B2G=1 if test "$OS_TARGET" = "Android"; then MOZ_NUWA_PROCESS=1 +MOZ_B2G_LOADER=1 fi MOZ_FOLD_LIBS=1 diff --git a/configure.in b/configure.in index dcc60a70d995..9c2a508d54f8 100644 --- a/configure.in +++ b/configure.in @@ -8631,6 +8631,14 @@ if test "$MOZ_WIDGET_TOOLKIT" = gonk -a -n "$MOZ_NUWA_PROCESS"; then AC_DEFINE(MOZ_NUWA_PROCESS) fi AC_SUBST(MOZ_NUWA_PROCESS) +if test "$MOZ_WIDGET_TOOLKIT" = gonk -a -n "$MOZ_B2G_LOADER"; then + if test -z "$MOZ_NUWA_PROCESS"; then + AC_MSG_ERROR([B2G loader works with Nuwa]); + fi + export MOZ_B2G_LOADER + AC_DEFINE(MOZ_B2G_LOADER) +fi +AC_SUBST(MOZ_B2G_LOADER) AC_SUBST(NSPR_CFLAGS) AC_SUBST(NSPR_LIBS) diff --git a/ipc/app/Makefile.in b/ipc/app/Makefile.in index 5cc4d7a2b41c..6c18864b7029 100644 --- a/ipc/app/Makefile.in +++ b/ipc/app/Makefile.in @@ -37,6 +37,10 @@ include $(topsrcdir)/config/config.mk include $(topsrcdir)/config/rules.mk +ifneq ($(MOZ_WIDGET_TOOLKIT),android) +#LIBS += ../contentproc/$(LIB_PREFIX)plugin-container.$(LIB_SUFFIX) +endif + ifeq ($(OS_ARCH),WINNT) #{ # Note the manifest file exists in the tree, so we use the explicit filename # here. diff --git a/ipc/app/MozillaRuntimeMain.cpp b/ipc/app/MozillaRuntimeMain.cpp index 4bdb6a56dd8a..67b636333145 100644 --- a/ipc/app/MozillaRuntimeMain.cpp +++ b/ipc/app/MozillaRuntimeMain.cpp @@ -4,148 +4,9 @@ * 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 "nsXPCOM.h" -#include "nsXULAppAPI.h" - -// FIXME/cjones testing -#if !defined(OS_WIN) -#include -#endif - -#ifdef XP_WIN -#include -// we want a wmain entry point -// but we don't want its DLL load protection, because we'll handle it here -#define XRE_DONT_PROTECT_DLL_LOAD -#include "nsWindowsWMain.cpp" -#include "nsSetDllDirectory.h" -#endif - -#if defined(XP_WIN) -#include "sandbox/chromium/base/basictypes.h" -#include "sandbox/win/src/sandbox.h" -#include "sandbox/win/src/sandbox_factory.h" -#include "mozilla/sandboxTarget.h" -#endif - -#ifdef MOZ_WIDGET_GONK -# include -# include - -# include - -# ifdef LOGE_IF -# undef LOGE_IF -# endif - -# include -# define LOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_print(ANDROID_LOG_ERROR, \ - "Gecko:MozillaRntimeMain", __VA_ARGS__)) \ - : (void)0 ) - -#endif - -#ifdef MOZ_NUWA_PROCESS -#include -#include "ipc/Nuwa.h" -#endif - -#ifdef MOZ_WIDGET_GONK -static void -InitializeBinder(void *aDummy) { - // Change thread priority to 0 only during calling ProcessState::self(). - // The priority is registered to binder driver and used for default Binder - // Thread's priority. - // To change the process's priority to small value need's root permission. - int curPrio = getpriority(PRIO_PROCESS, 0); - int err = setpriority(PRIO_PROCESS, 0, 0); - MOZ_ASSERT(!err); - LOGE_IF(err, "setpriority failed. Current process needs root permission."); - android::ProcessState::self()->startThreadPool(); - setpriority(PRIO_PROCESS, 0, curPrio); -} -#endif - -#if defined(XP_WIN) -static bool gIsSandboxEnabled = false; -void StartSandboxCallback() -{ - if (gIsSandboxEnabled) { - sandbox::TargetServices* target_service = - sandbox::SandboxFactory::GetTargetServices(); - target_service->LowerToken(); - } -} -#endif - +#include "../contentproc/plugin-container.cpp" + int -main(int argc, char* argv[]) -{ - bool isNuwa = false; - for (int i = 1; i < argc; i++) { - isNuwa |= strcmp(argv[i], "-nuwa") == 0; -#if defined(XP_WIN) - gIsSandboxEnabled |= strcmp(argv[i], "-sandbox") == 0; -#endif - } - -#ifdef MOZ_NUWA_PROCESS - if (isNuwa) { - PrepareNuwaProcess(); - } -#endif - -#ifdef MOZ_WIDGET_GONK - // This creates a ThreadPool for binder ipc. A ThreadPool is necessary to - // receive binder calls, though not necessary to send binder calls. - // ProcessState::Self() also needs to be called once on the main thread to - // register the main thread with the binder driver. - -#ifdef MOZ_NUWA_PROCESS - if (!isNuwa) { - InitializeBinder(nullptr); - } else { - NuwaAddFinalConstructor(&InitializeBinder, nullptr); - } -#else - InitializeBinder(nullptr); -#endif -#endif - - // Check for the absolute minimum number of args we need to move - // forward here. We expect the last arg to be the child process type. - if (argc < 1) - return 3; - GeckoProcessType proctype = XRE_StringToChildProcessType(argv[--argc]); - -#ifdef XP_WIN - // For plugins, this is done in PluginProcessChild::Init, as we need to - // avoid it for unsupported plugins. See PluginProcessChild::Init for - // the details. - if (proctype != GeckoProcessType_Plugin) { - mozilla::SanitizeEnvironmentVariables(); - SetDllDirectory(L""); - } - - if (gIsSandboxEnabled) { - sandbox::TargetServices* target_service = - sandbox::SandboxFactory::GetTargetServices(); - if (!target_service) { - return 1; - } - - sandbox::ResultCode result = target_service->Init(); - if (result != sandbox::SBOX_ALL_OK) { - return 2; - } - mozilla::SandboxTarget::Instance()->SetStartSandboxCallback(StartSandboxCallback); - } -#endif - - nsresult rv = XRE_InitChildProcess(argc, argv, proctype); - NS_ENSURE_SUCCESS(rv, 1); - - return 0; +main(int argc, char *argv[]) { + return content_process_main(argc, argv); } diff --git a/ipc/chromium/src/base/process_util_linux.cc b/ipc/chromium/src/base/process_util_linux.cc index 0be1b7edd770..741e912b8d9d 100644 --- a/ipc/chromium/src/base/process_util_linux.cc +++ b/ipc/chromium/src/base/process_util_linux.cc @@ -1,3 +1,5 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set sw=2 ts=2 autoindent cindent expandtab: */ // Copyright (c) 2008 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. @@ -18,6 +20,13 @@ #include "base/logging.h" #include "base/string_tokenizer.h" #include "base/string_util.h" +#include "nsLiteralString.h" + +#ifdef MOZ_B2G_LOADER +#include "ProcessUtils.h" + +using namespace mozilla::ipc; +#endif // MOZ_B2G_LOADER #ifdef MOZ_WIDGET_GONK /* @@ -188,12 +197,71 @@ bool LaunchApp(const std::vector& argv, wait, process_handle); } +#ifdef MOZ_B2G_LOADER +/** + * Launch an app using B2g Loader. + */ +static bool +LaunchAppProcLoader(const std::vector& argv, + const file_handle_mapping_vector& fds_to_remap, + const environment_map& env_vars_to_set, + ChildPrivileges privs, + ProcessHandle* process_handle) { + size_t i; + scoped_array argv_cstr(new char*[argv.size() + 1]); + for (i = 0; i < argv.size(); i++) { + argv_cstr[i] = const_cast(argv[i].c_str()); + } + argv_cstr[argv.size()] = nullptr; + + scoped_array env_cstr(new char*[env_vars_to_set.size() + 1]); + i = 0; + for (environment_map::const_iterator it = env_vars_to_set.begin(); + it != env_vars_to_set.end(); ++it) { + env_cstr[i++] = strdup((it->first + "=" + it->second).c_str()); + } + env_cstr[env_vars_to_set.size()] = nullptr; + + bool ok = ProcLoaderLoad((const char **)argv_cstr.get(), + (const char **)env_cstr.get(), + fds_to_remap, privs, + process_handle); + MOZ_ASSERT(ok, "ProcLoaderLoad() failed"); + + for (size_t i = 0; i < env_vars_to_set.size(); i++) { + free(env_cstr[i]); + } + + return ok; +} + +static bool +IsLaunchingNuwa(const std::vector& argv) { + std::vector::const_iterator it; + for (it = argv.begin(); it != argv.end(); ++it) { + if (*it == std::string("-nuwa")) { + return true; + } + } + return false; +} +#endif // MOZ_B2G_LOADER + bool LaunchApp(const std::vector& argv, const file_handle_mapping_vector& fds_to_remap, const environment_map& env_vars_to_set, ChildPrivileges privs, bool wait, ProcessHandle* process_handle, ProcessArchitecture arch) { +#ifdef MOZ_B2G_LOADER + static bool beforeFirstNuwaLaunch = true; + if (!wait && beforeFirstNuwaLaunch && IsLaunchingNuwa(argv)) { + beforeFirstNuwaLaunch = false; + return LaunchAppProcLoader(argv, fds_to_remap, env_vars_to_set, + privs, process_handle); + } +#endif // MOZ_B2G_LOADER + scoped_array argv_cstr(new char*[argv.size() + 1]); // Illegal to allocate memory after fork and before execvp InjectiveMultimap fd_shuffle1, fd_shuffle2; diff --git a/ipc/contentproc/moz.build b/ipc/contentproc/moz.build new file mode 100644 index 000000000000..39b5d3273791 --- /dev/null +++ b/ipc/contentproc/moz.build @@ -0,0 +1,29 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +LIBRARY_NAME = 'plugin-container' +if CONFIG['MOZ_B2G_LOADER']: + FINAL_LIBRARY = 'xul' + +SOURCES += [ + 'plugin-container.cpp', +] + +include('/ipc/chromium/chromium-config.mozbuild') + +if CONFIG['OS_ARCH'] == 'WINNT': + LOCAL_INCLUDES += [ + '/toolkit/xre', + '/xpcom/base', + ] + +if CONFIG['OS_ARCH'] == 'WINNT': + # For sandbox includes and the include dependencies those have + LOCAL_INCLUDES += [ + '/security', + '/security/sandbox', + '/security/sandbox/chromium', + ] diff --git a/ipc/contentproc/plugin-container.cpp b/ipc/contentproc/plugin-container.cpp new file mode 100644 index 000000000000..e8fe2cc2549f --- /dev/null +++ b/ipc/contentproc/plugin-container.cpp @@ -0,0 +1,151 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: sw=4 ts=4 et : + * 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 "nsXPCOM.h" +#include "nsXULAppAPI.h" + +// FIXME/cjones testing +#if !defined(OS_WIN) +#include +#endif + +#ifdef XP_WIN +#include +// we want a wmain entry point +// but we don't want its DLL load protection, because we'll handle it here +#define XRE_DONT_PROTECT_DLL_LOAD +#include "nsWindowsWMain.cpp" +#include "nsSetDllDirectory.h" +#endif + +#if defined(XP_WIN) +#include "sandbox/chromium/base/basictypes.h" +#include "sandbox/win/src/sandbox.h" +#include "sandbox/win/src/sandbox_factory.h" +#include "mozilla/sandboxTarget.h" +#endif + +#ifdef MOZ_WIDGET_GONK +# include +# include + +# include + +# ifdef LOGE_IF +# undef LOGE_IF +# endif + +# include +# define LOGE_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_print(ANDROID_LOG_ERROR, \ + "Gecko:MozillaRntimeMain", __VA_ARGS__)) \ + : (void)0 ) + +#endif + +#ifdef MOZ_NUWA_PROCESS +#include +#include "ipc/Nuwa.h" +#endif + +#ifdef MOZ_WIDGET_GONK +static void +InitializeBinder(void *aDummy) { + // Change thread priority to 0 only during calling ProcessState::self(). + // The priority is registered to binder driver and used for default Binder + // Thread's priority. + // To change the process's priority to small value need's root permission. + int curPrio = getpriority(PRIO_PROCESS, 0); + int err = setpriority(PRIO_PROCESS, 0, 0); + MOZ_ASSERT(!err); + LOGE_IF(err, "setpriority failed. Current process needs root permission."); + android::ProcessState::self()->startThreadPool(); + setpriority(PRIO_PROCESS, 0, curPrio); +} +#endif + +#if defined(XP_WIN) +static bool gIsSandboxEnabled = false; +void StartSandboxCallback() +{ + if (gIsSandboxEnabled) { + sandbox::TargetServices* target_service = + sandbox::SandboxFactory::GetTargetServices(); + target_service->LowerToken(); + } +} +#endif + +int +content_process_main(int argc, char* argv[]) +{ + bool isNuwa = false; + for (int i = 1; i < argc; i++) { + isNuwa |= strcmp(argv[i], "-nuwa") == 0; +#if defined(XP_WIN) + gIsSandboxEnabled |= strcmp(argv[i], "-sandbox") == 0; +#endif + } + +#ifdef MOZ_NUWA_PROCESS + if (isNuwa) { + PrepareNuwaProcess(); + } +#endif + +#ifdef MOZ_WIDGET_GONK + // This creates a ThreadPool for binder ipc. A ThreadPool is necessary to + // receive binder calls, though not necessary to send binder calls. + // ProcessState::Self() also needs to be called once on the main thread to + // register the main thread with the binder driver. + +#ifdef MOZ_NUWA_PROCESS + if (!isNuwa) { + InitializeBinder(nullptr); + } else { + NuwaAddFinalConstructor(&InitializeBinder, nullptr); + } +#else + InitializeBinder(nullptr); +#endif +#endif + + // Check for the absolute minimum number of args we need to move + // forward here. We expect the last arg to be the child process type. + if (argc < 1) + return 3; + GeckoProcessType proctype = XRE_StringToChildProcessType(argv[--argc]); + +#ifdef XP_WIN + // For plugins, this is done in PluginProcessChild::Init, as we need to + // avoid it for unsupported plugins. See PluginProcessChild::Init for + // the details. + if (proctype != GeckoProcessType_Plugin) { + mozilla::SanitizeEnvironmentVariables(); + SetDllDirectory(L""); + } + + if (gIsSandboxEnabled) { + sandbox::TargetServices* target_service = + sandbox::SandboxFactory::GetTargetServices(); + if (!target_service) { + return 1; + } + + sandbox::ResultCode result = target_service->Init(); + if (result != sandbox::SBOX_ALL_OK) { + return 2; + } + mozilla::SandboxTarget::Instance()->SetStartSandboxCallback(StartSandboxCallback); + } +#endif + + nsresult rv = XRE_InitChildProcess(argc, argv, proctype); + NS_ENSURE_SUCCESS(rv, 1); + + return 0; +} diff --git a/ipc/glue/PProcLoader.ipdl b/ipc/glue/PProcLoader.ipdl new file mode 100644 index 000000000000..d295d8b7221a --- /dev/null +++ b/ipc/glue/PProcLoader.ipdl @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set sw=2 ts=2 autoindent cindent expandtab: */ +/* 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/. */ + +namespace mozilla { +namespace ipc { + +struct FDRemap { + FileDescriptor fd; + int mapto; +}; + +protocol PProcLoader +{ +child: + /** + * Request B2G loader service to load content process. + * + * It actually calls the main() function of plugin-container. + */ + async Load(nsCString[] argv, nsCString[] env, + FDRemap[] fdsRemap, uint32_t privs, + int32_t cookie); + +parent: + /** + * The acknowledgement of Load(). + */ + async LoadComplete(int32_t pid, int32_t cookie); +}; + +} +} diff --git a/ipc/glue/ProcessUtils.h b/ipc/glue/ProcessUtils.h index fc17609dcadc..99d0f532dd8b 100644 --- a/ipc/glue/ProcessUtils.h +++ b/ipc/glue/ProcessUtils.h @@ -1,3 +1,5 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set sw=2 ts=2 autoindent cindent expandtab: */ /* 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/. */ @@ -5,6 +7,10 @@ #ifndef mozilla_ipc_ProcessUtils_h #define mozilla_ipc_ProcessUtils_h +#ifdef MOZ_B2G_LOADER +#include "base/process_util.h" +#endif + namespace mozilla { namespace ipc { @@ -12,6 +18,17 @@ namespace ipc { // this directly. void SetThisProcessName(const char *aName); +#ifdef MOZ_B2G_LOADER +// see ProcessUtils_linux.cpp for explaination. +void ProcLoaderClientGeckoInit(); + +bool ProcLoaderLoad(const char *aArgv[], + const char *aEnvp[], + const base::file_handle_mapping_vector &aFdsRemap, + const base::ChildPrivileges aPrivs, + base::ProcessHandle *aProcessHandle); +#endif /* MOZ_B2G_LOADER */ + } // namespace ipc } // namespace mozilla diff --git a/ipc/glue/ProcessUtils_linux.cpp b/ipc/glue/ProcessUtils_linux.cpp index d5b8c092e0f3..10156e63a2c4 100644 --- a/ipc/glue/ProcessUtils_linux.cpp +++ b/ipc/glue/ProcessUtils_linux.cpp @@ -1,3 +1,5 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set sw=2 ts=2 autoindent cindent expandtab: */ /* 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/. */ @@ -8,6 +10,37 @@ #include +#ifdef MOZ_B2G_LOADER + +#include +#include + +#include "nsAutoPtr.h" + +#include "mozilla/Assertions.h" +#include "mozilla/ipc/PProcLoaderParent.h" +#include "mozilla/ipc/PProcLoaderChild.h" +#include "mozilla/ipc/Transport.h" +#include "mozilla/ipc/FileDescriptorUtils.h" +#include "mozilla/ipc/IOThreadChild.h" +#include "mozilla/dom/ContentProcess.h" +#include "base/file_descriptor_shuffle.h" +#include "mozilla/BackgroundHangMonitor.h" +#include "mozilla/DebugOnly.h" +#include "base/process_util.h" + +#include "prenv.h" + +#include "nsXULAppAPI.h" // export XRE_* functions + +#include "nsAppRunner.h" + +int content_process_main(int argc, char *argv[]); + +extern bool gDisableAndroidLog; + +#endif /* MOZ_B2G_LOADER */ + namespace mozilla { namespace ipc { @@ -16,5 +49,522 @@ void SetThisProcessName(const char *aName) prctl(PR_SET_NAME, (unsigned long)aName, 0uL, 0uL, 0uL); } +#ifdef MOZ_B2G_LOADER +/** + * How does B2G Loader Work? + * + * <> <> + * ProcLoaderParent -----> ProcLoaderChild + * ^ | + * | load() | content_process_main() + * | V + * ProcLoaderClient Nuwa/plugin-container + * ^ + * | ProcLoaderLoad() + * ... + * ContentParent + * + * + * B2G loader includes an IPC protocol PProcLoader for communication + * between client (parent) and server (child). The b2g process is the + * client. It requests the server to load/start the Nuwa process with + * the given arguments, env variables, and file descriptors. + * + * ProcLoaderClientInit() is called by B2G loader to initialize the + * client side, the b2g process. Then the b2g_main() is called to + * start b2g process. + * + * ProcLoaderClientGeckoInit() is called by XRE_main() to create the + * parent actor, |ProcLoaderParent|, of PProcLoader for servicing the + * request to run Nuwa process later once Gecko has been initialized. + * + * ProcLoaderServiceRun() is called by the server process. It starts + * an IOThread and event loop to serve the |ProcLoaderChild| + * implmentation of PProcLoader protocol as the child actor. Once it + * recieves a load() request, it stops the IOThread and event loop, + * then starts running the main function of the content process with + * the given arguments. + * + * NOTE: The server process serves at most one load() request. + */ + +using namespace base; +using namespace mozilla::dom; + +static bool sProcLoaderClientOnDeinit = false; +static DebugOnly sProcLoaderClientInitialized = false; +static DebugOnly sProcLoaderClientGeckoInitialized = false; +static pid_t sProcLoaderPid = 0; +static int sProcLoaderChannelFd = -1; +static PProcLoaderParent *sProcLoaderParent = nullptr; +static MessageLoop *sProcLoaderLoop = nullptr; + +static void ProcLoaderClientDeinit(); + + +class ProcLoaderParent : public PProcLoaderParent +{ +private: + nsAutoPtr mChannelFd; // To keep a reference. + +public: + ProcLoaderParent(FileDescriptor *aFd) : mChannelFd(aFd) {} + + virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; + + virtual bool RecvLoadComplete(const int32_t &aPid, + const int32_t &aCookie) MOZ_OVERRIDE; + + virtual void OnChannelError() MOZ_OVERRIDE; +}; + +void +ProcLoaderParent::ActorDestroy(ActorDestroyReason aWhy) +{ +} + +static void +_ProcLoaderParentDestroy(PProcLoaderParent *aLoader) +{ + aLoader->Close(); + delete aLoader; + sProcLoaderClientOnDeinit = false; +} + +bool +ProcLoaderParent::RecvLoadComplete(const int32_t &aPid, + const int32_t &aCookie) +{ + ProcLoaderClientDeinit(); + return true; +} + +void +ProcLoaderParent::OnChannelError() +{ + if (sProcLoaderClientOnDeinit) { + // Get error for closing while the channel is already error. + return; + } + NS_WARNING("ProcLoaderParent is in channel error"); + ProcLoaderClientDeinit(); +} + +/** + * Initialize the client of B2G loader for loader itself. + * + * The initialization of B2G loader are divided into two stages. First + * stage is to collect child info passed from the main program of the + * loader. Second stage is to initialize Gecko according to info from the + * first stage and make the client of loader service ready. + * + * \param aPeerPid is the pid of the child. + * \param aChannelFd is the file descriptor of the socket used for IPC. + */ +static void +ProcLoaderClientInit(pid_t aPeerPid, int aChannelFd) +{ + MOZ_ASSERT(!sProcLoaderClientInitialized, "call ProcLoaderClientInit() more than once"); + MOZ_ASSERT(aPeerPid != 0 && aChannelFd != -1, "invalid argument"); + sProcLoaderPid = aPeerPid; + sProcLoaderChannelFd = aChannelFd; + sProcLoaderClientInitialized = true; +} + +/** + * Initialize the client of B2G loader for Gecko. + */ +void +ProcLoaderClientGeckoInit() +{ + MOZ_ASSERT(sProcLoaderClientInitialized, "call ProcLoaderClientInit() at first"); + MOZ_ASSERT(!sProcLoaderClientGeckoInitialized, + "call ProcLoaderClientGeckoInit() more than once"); + + sProcLoaderClientGeckoInitialized = true; + + FileDescriptor *fd = new FileDescriptor(sProcLoaderChannelFd); + close(sProcLoaderChannelFd); + sProcLoaderChannelFd = -1; + Transport *transport = OpenDescriptor(*fd, Transport::MODE_CLIENT); + sProcLoaderParent = new ProcLoaderParent(fd); + sProcLoaderParent->Open(transport, + sProcLoaderPid, + XRE_GetIOMessageLoop(), + ParentSide); + sProcLoaderLoop = MessageLoop::current(); +} + +/** + * Shutdown and destroy the client of B2G loader service. + */ +static void +ProcLoaderClientDeinit() +{ + MOZ_ASSERT(sProcLoaderClientGeckoInitialized && sProcLoaderClientInitialized); + sProcLoaderClientGeckoInitialized = false; + sProcLoaderClientInitialized = false; + + sProcLoaderClientOnDeinit = true; + + MOZ_ASSERT(sProcLoaderParent != nullptr); + PProcLoaderParent *procLoaderParent = sProcLoaderParent; + sProcLoaderParent = nullptr; + sProcLoaderLoop = nullptr; + + MessageLoop::current()-> + PostTask(FROM_HERE, + NewRunnableFunction(&_ProcLoaderParentDestroy, + procLoaderParent)); +} + +struct AsyncSendLoadData +{ + nsTArray mArgv; + nsTArray mEnv; + nsTArray mFdsremap; + ChildPrivileges mPrivs; + int mCookie; +}; + +static void +AsyncSendLoad(AsyncSendLoadData *aLoad) +{ + PProcLoaderParent *loader = sProcLoaderParent; + DebugOnly ok = + loader->SendLoad(aLoad->mArgv, aLoad->mEnv, aLoad->mFdsremap, + aLoad->mPrivs, aLoad->mCookie); + MOZ_ASSERT(ok); + delete aLoad; +} + +/** + * Request the loader service, the server, to load Nuwa. + */ +bool +ProcLoaderLoad(const char *aArgv[], + const char *aEnvp[], + const file_handle_mapping_vector &aFdsRemap, + const ChildPrivileges aPrivs, + ProcessHandle *aProcessHandle) +{ + static int cookie=0; + int i; + + if (sProcLoaderParent == nullptr || sProcLoaderPid == 0) { + return false; + } + + AsyncSendLoadData *load = new AsyncSendLoadData(); + nsTArray &argv = load->mArgv; + for (i = 0; aArgv[i] != nullptr; i++) { + argv.AppendElement(nsCString(aArgv[i])); + } + nsTArray &env = load->mEnv; + for (i = 0; aEnvp[i] != nullptr; i++) { + env.AppendElement(nsCString(aEnvp[i])); + } + nsTArray &fdsremap = load->mFdsremap; + for (file_handle_mapping_vector::const_iterator fdmap = + aFdsRemap.begin(); + fdmap != aFdsRemap.end(); + fdmap++) { + fdsremap.AppendElement(FDRemap(fdmap->first, fdmap->second)); + } + load->mPrivs = aPrivs; + load->mCookie = cookie++; + + *aProcessHandle = sProcLoaderPid; + sProcLoaderPid = 0; + + sProcLoaderLoop->PostTask(FROM_HERE, + NewRunnableFunction(AsyncSendLoad, load)); + return true; +} + + +class ProcLoaderRunnerBase; + +static bool sProcLoaderServing = false; +static ProcLoaderRunnerBase *sProcLoaderDispatchedTask = nullptr; + +class ProcLoaderRunnerBase +{ +public: + virtual int DoWork() = 0; +}; + + +class ProcLoaderNoopRunner : public ProcLoaderRunnerBase { +public: + virtual int DoWork(); +}; + +int +ProcLoaderNoopRunner::DoWork() { + return 0; +} + + +/** + * The runner to load Nuwa at the current process. + */ +class ProcLoaderLoadRunner : public ProcLoaderRunnerBase { +private: + const nsTArray mArgv; + const nsTArray mEnv; + const nsTArray mFdsRemap; + const ChildPrivileges mPrivs; + + void ShuffleFds(); + +public: + ProcLoaderLoadRunner(const InfallibleTArray& aArgv, + const InfallibleTArray& aEnv, + const InfallibleTArray& aFdsRemap, + const ChildPrivileges aPrivs) + : mArgv(aArgv) + , mEnv(aEnv) + , mFdsRemap(aFdsRemap) + , mPrivs(aPrivs) {} + + int DoWork(); +}; + +void +ProcLoaderLoadRunner::ShuffleFds() +{ + unsigned int i; + + InjectiveMultimap fd_shuffle1, fd_shuffle2; + fd_shuffle1.reserve(mFdsRemap.Length()); + fd_shuffle2.reserve(mFdsRemap.Length()); + for (i = 0; i < mFdsRemap.Length(); i++) { + const FDRemap *map = &mFdsRemap[i]; + int fd = map->fd().PlatformHandle(); + int tofd = map->mapto(); + + fd_shuffle1.push_back(InjectionArc(fd, tofd, false)); + fd_shuffle2.push_back(InjectionArc(fd, tofd, false)); + } + + DebugOnly ok = ShuffleFileDescriptors(&fd_shuffle1); + MOZ_ASSERT(ok, "ShuffleFileDescriptors failed"); + + CloseSuperfluousFds(fd_shuffle2); +} + +int +ProcLoaderLoadRunner::DoWork() +{ + unsigned int i; + + ShuffleFds(); + + unsigned int argc = mArgv.Length(); + char **argv = new char *[argc + 1]; + for (i = 0; i < argc; i++) { + argv[i] = ::strdup(mArgv[i].get()); + } + argv[argc] = nullptr; + + unsigned int envc = mEnv.Length(); + for (i = 0; i < envc; i++) { + PR_SetEnv(mEnv[i].get()); + } + + SetCurrentProcessPrivileges(mPrivs); + + MOZ_ASSERT(content_process_main != nullptr, + "content_process_main not found"); + // Start Nuwa (main function) + int ret = content_process_main(argc, argv); + + for (i = 0; i < argc; i++) { + free(argv[i]); + } + delete[] argv; + + return ret; +} + + +class ProcLoaderChild : public PProcLoaderChild +{ + pid_t mPeerPid; + +public: + ProcLoaderChild(pid_t aPeerPid) : mPeerPid(aPeerPid) {} + + virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; + + virtual bool RecvLoad(const InfallibleTArray& aArgv, + const InfallibleTArray& aEnv, + const InfallibleTArray& aFdsremap, + const uint32_t& aPrivs, + const int32_t& aCookie); + + virtual void OnChannelError(); +}; + +void +ProcLoaderChild::ActorDestroy(ActorDestroyReason aWhy) +{ +} + +static void +_ProcLoaderChildDestroy(ProcLoaderChild *aChild) +{ + aChild->Close(); + delete aChild; + MessageLoop::current()->Quit(); +} + +bool +ProcLoaderChild::RecvLoad(const InfallibleTArray& aArgv, + const InfallibleTArray& aEnv, + const InfallibleTArray& aFdsRemap, + const uint32_t& aPrivs, + const int32_t& aCookie) { + if (!sProcLoaderServing) { + return true; + } + sProcLoaderServing = false; + + MOZ_ASSERT(sProcLoaderDispatchedTask == nullptr); + ChildPrivileges privs = static_cast(aPrivs); + sProcLoaderDispatchedTask = + new ProcLoaderLoadRunner(aArgv, aEnv, aFdsRemap, privs); + + SendLoadComplete(mPeerPid, aCookie); + + MessageLoop::current()->PostTask(FROM_HERE, + NewRunnableFunction(_ProcLoaderChildDestroy, + this)); + return true; +} + +void +ProcLoaderChild::OnChannelError() +{ + if (!sProcLoaderServing) { + return; + } + sProcLoaderServing = false; + + PProcLoaderChild::OnChannelError(); + + MOZ_ASSERT(sProcLoaderDispatchedTask == nullptr); + sProcLoaderDispatchedTask = new ProcLoaderNoopRunner(); + + MessageLoop::current()->PostTask(FROM_HERE, + NewRunnableFunction(_ProcLoaderChildDestroy, + this)); +} + +/** + * A helper class which calls NS_LogInit/NS_LogTerm in its scope. + */ +class ScopedLogging +{ +public: + ScopedLogging() { NS_LogInit(); } + ~ScopedLogging() { NS_LogTerm(); } +}; + +/** + * Run service of ProcLoader. + * + * \param aPeerPid is the pid of the parent. + * \param aFd is the file descriptor of the socket for IPC. + * + * See the comment near the head of this file. + */ +static int +ProcLoaderServiceRun(pid_t aPeerPid, int aFd, + int aArgc, const char *aArgv[]) +{ + ScopedLogging logging; + + char **_argv; + _argv = new char *[aArgc + 1]; + for (int i = 0; i < aArgc; i++) { + _argv[i] = ::strdup(aArgv[i]); + MOZ_ASSERT(_argv[i] != nullptr); + } + _argv[aArgc] = nullptr; + + gArgv = _argv; + gArgc = aArgc; + + { + gDisableAndroidLog = true; + + nsresult rv = XRE_InitCommandLine(aArgc, _argv); + if (NS_FAILED(rv)) { + gDisableAndroidLog = false; + MOZ_CRASH(); + } + + FileDescriptor fd(aFd); + close(aFd); + + MOZ_ASSERT(!sProcLoaderServing); + MessageLoop loop; + + nsAutoPtr process; + process = new ContentProcess(aPeerPid); + ChildThread *iothread = process->child_thread(); + + Transport *transport = OpenDescriptor(fd, Transport::MODE_CLIENT); + ProcLoaderChild *loaderChild = new ProcLoaderChild(aPeerPid); + // Pass a message loop to initialize (connect) the channel + // (connection). + loaderChild->Open(transport, aPeerPid, iothread->message_loop()); + + BackgroundHangMonitor::Prohibit(); + + sProcLoaderServing = true; + loop.Run(); + + BackgroundHangMonitor::Allow(); + + XRE_DeinitCommandLine(); + + gDisableAndroidLog = false; + } + + MOZ_ASSERT(sProcLoaderDispatchedTask != nullptr); + ProcLoaderRunnerBase *task = sProcLoaderDispatchedTask; + sProcLoaderDispatchedTask = nullptr; + int ret = task->DoWork(); + delete task; + + for (int i = 0; i < aArgc; i++) { + free(_argv[i]); + } + delete[] _argv; + + return ret; +} + +#endif /* MOZ_B2G_LOADER */ + } // namespace ipc } // namespace mozilla + +#ifdef MOZ_B2G_LOADER +void +XRE_ProcLoaderClientInit(pid_t aPeerPid, int aChannelFd) +{ + mozilla::ipc::ProcLoaderClientInit(aPeerPid, aChannelFd); +} + +int +XRE_ProcLoaderServiceRun(pid_t aPeerPid, int aFd, + int aArgc, const char *aArgv[]) +{ + return mozilla::ipc::ProcLoaderServiceRun(aPeerPid, aFd, + aArgc, aArgv); +} +#endif /* MOZ_B2G_LOADER */ diff --git a/ipc/glue/moz.build b/ipc/glue/moz.build index 08e50d92cfc4..af3e146b6292 100644 --- a/ipc/glue/moz.build +++ b/ipc/glue/moz.build @@ -130,12 +130,14 @@ IPDL_SOURCES = [ 'PBackground.ipdl', 'PBackgroundSharedTypes.ipdlh', 'PBackgroundTest.ipdl', + 'PProcLoader.ipdl', 'ProtocolTypes.ipdlh', 'URIParams.ipdlh', ] LOCAL_INCLUDES += [ + '/toolkit/xre', '/xpcom/threads', ] diff --git a/ipc/moz.build b/ipc/moz.build index ff5df8d550e7..0c2bceb89cae 100644 --- a/ipc/moz.build +++ b/ipc/moz.build @@ -26,4 +26,7 @@ if CONFIG['MOZ_B2G_RIL'] or CONFIG['MOZ_B2G_BT'] or CONFIG['MOZ_NFC'] or CONFIG[ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': DIRS += ['keystore', 'netd'] +if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android': + DIRS += ['contentproc'] + TOOL_DIRS += ['app'] diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 36e7aea2bc5e..fe8ed3c449e9 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -185,6 +185,10 @@ #include "GTestRunner.h" #endif +#ifdef MOZ_B2G_LOADER +#include "ProcessUtils.h" +#endif + #ifdef MOZ_WIDGET_ANDROID #include "AndroidBridge.h" #endif @@ -3772,6 +3776,10 @@ XREMain::XRE_mainRun() nsresult rv = NS_OK; NS_ASSERTION(mScopedXPCom, "Scoped xpcom not initialized."); +#ifdef MOZ_B2G_LOADER + mozilla::ipc::ProcLoaderClientGeckoInit(); +#endif + #ifdef NS_FUNCTION_TIMER // initialize some common services, so we don't pay the cost for these at odd times later on; // SetWindowCreator -> ChromeRegistry -> IOService -> SocketTransportService -> (nspr wspm init), Prefs diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index 0befeeece873..10735b25d5bd 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -101,6 +101,13 @@ Break(const char* aMsg); #include #endif +#ifdef MOZ_B2G_LOADER +/* Avoid calling Android logger/logd temporarily while running + * B2GLoader to start the child process. + */ +bool gDisableAndroidLog = false; +#endif + using namespace mozilla; static const char* sMultiprocessDescription = nullptr; @@ -392,6 +399,9 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr, #endif #ifdef ANDROID +#ifdef MOZ_B2G_LOADER + if (!gDisableAndroidLog) +#endif __android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", buf.buffer); #endif diff --git a/xpcom/build/nsXULAppAPI.h b/xpcom/build/nsXULAppAPI.h index 6f320744fd60..e5ace7e9439e 100644 --- a/xpcom/build/nsXULAppAPI.h +++ b/xpcom/build/nsXULAppAPI.h @@ -467,6 +467,13 @@ XRE_API(WindowsEnvironmentType, XRE_GetWindowsEnvironment, ()) #endif // XP_WIN +#ifdef MOZ_B2G_LOADER +XRE_API(int, + XRE_ProcLoaderServiceRun, (pid_t, int, int argc, const char *argv[])); +XRE_API(void, + XRE_ProcLoaderClientInit, (pid_t, int)); +#endif // MOZ_B2G_LOADER + XRE_API(int, XRE_XPCShellMain, (int argc, char** argv, char** envp)) diff --git a/xpcom/threads/BackgroundHangMonitor.cpp b/xpcom/threads/BackgroundHangMonitor.cpp index 7f4328b41573..93b38f50f547 100644 --- a/xpcom/threads/BackgroundHangMonitor.cpp +++ b/xpcom/threads/BackgroundHangMonitor.cpp @@ -65,6 +65,7 @@ private: public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BackgroundHangManager) static StaticRefPtr sInstance; + static bool sProhibited; // Lock for access to members of this class Monitor mLock; @@ -162,6 +163,7 @@ public: StaticRefPtr BackgroundHangManager::sInstance; +bool BackgroundHangManager::sProhibited = false; ThreadLocal BackgroundHangThread::sTlsKey; @@ -409,8 +411,16 @@ BackgroundHangThread* BackgroundHangThread::FindThread() { #ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR + if (BackgroundHangManager::sInstance == nullptr) { + MOZ_ASSERT(BackgroundHangManager::sProhibited, + "BackgroundHandleManager is not initialized"); + return nullptr; + } + if (sTlsKey.initialized()) { // Use TLS if available + MOZ_ASSERT(!BackgroundHangManager::sProhibited, + "BackgroundHandleManager is not initialized"); return sTlsKey.get(); } // If TLS is unavailable, we can search through the thread list @@ -436,6 +446,7 @@ void BackgroundHangMonitor::Startup() { #ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR + MOZ_ASSERT(!BackgroundHangManager::sProhibited, "Prohibited"); MOZ_ASSERT(!BackgroundHangManager::sInstance, "Already initialized"); ThreadStackHelper::Startup(); BackgroundHangThread::Startup(); @@ -447,6 +458,7 @@ void BackgroundHangMonitor::Shutdown() { #ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR + MOZ_ASSERT(!BackgroundHangManager::sProhibited, "Prohibited"); MOZ_ASSERT(BackgroundHangManager::sInstance, "Not initialized"); /* Scope our lock inside Shutdown() because the sInstance object can be destroyed as soon as we set sInstance to nullptr below, and @@ -463,7 +475,8 @@ BackgroundHangMonitor::BackgroundHangMonitor(const char* aName, : mThread(BackgroundHangThread::FindThread()) { #ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR - if (!mThread) { + if (!BackgroundHangManager::sProhibited && !mThread) { + // If sProhibit is true, mThread would be null, and no monitoring. mThread = new BackgroundHangThread(aName, aTimeoutMs, aMaxTimeoutMs); } #endif @@ -473,7 +486,8 @@ BackgroundHangMonitor::BackgroundHangMonitor() : mThread(BackgroundHangThread::FindThread()) { #ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR - MOZ_ASSERT(mThread, "Thread not initialized for hang monitoring"); + MOZ_ASSERT(!BackgroundHangManager::sProhibited || mThread, + "This thread is not initialized for hang monitoring"); #endif } @@ -485,6 +499,11 @@ void BackgroundHangMonitor::NotifyActivity() { #ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR + if (mThread == nullptr) { + MOZ_ASSERT(BackgroundHangManager::sProhibited, + "This thread is not initialized for hang monitoring"); + return; + } mThread->NotifyActivity(); #endif } @@ -493,18 +512,49 @@ void BackgroundHangMonitor::NotifyWait() { #ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR + if (mThread == nullptr) { + MOZ_ASSERT(BackgroundHangManager::sProhibited, + "This thread is not initialized for hang monitoring"); + return; + } mThread->NotifyWait(); #endif } +void +BackgroundHangMonitor::Prohibit() +{ +#ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR + MOZ_ASSERT(BackgroundHangManager::sInstance == nullptr, + "The background hang monitor is already initialized"); + BackgroundHangManager::sProhibited = true; +#endif +} + +void +BackgroundHangMonitor::Allow() +{ +#ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR + MOZ_ASSERT(BackgroundHangManager::sInstance == nullptr, + "The background hang monitor is already initialized"); + BackgroundHangManager::sProhibited = false; +#endif +} + /* Because we are iterating through the BackgroundHangThread linked list, we need to take a lock. Using MonitorAutoLock as a base class makes sure all of that is taken care of for us. */ BackgroundHangMonitor::ThreadHangStatsIterator::ThreadHangStatsIterator() : MonitorAutoLock(BackgroundHangManager::sInstance->mLock) - , mThread(BackgroundHangManager::sInstance->mHangThreads.getFirst()) + , mThread(BackgroundHangManager::sInstance ? + BackgroundHangManager::sInstance->mHangThreads.getFirst() : + nullptr) { +#ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR + MOZ_ASSERT(BackgroundHangManager::sInstance || BackgroundHangManager::sProhibited, + "Inconsistent state"); +#endif } Telemetry::ThreadHangStats* diff --git a/xpcom/threads/BackgroundHangMonitor.h b/xpcom/threads/BackgroundHangMonitor.h index 76d517fce4dd..059fb0a08ff9 100644 --- a/xpcom/threads/BackgroundHangMonitor.h +++ b/xpcom/threads/BackgroundHangMonitor.h @@ -107,6 +107,8 @@ class BackgroundHangThread; * } * } * + * Prohibit() and Allow() make the background hang monitor work safely + * before Startup(). */ class BackgroundHangMonitor { @@ -204,6 +206,27 @@ public: * NotifyActivity when subsequently exiting the wait state. */ void NotifyWait(); + + /** + * Prohibit the hang monitor from activating. + * + * Startup() should not be called between Prohibit() and Allow(). + * This function makes the background hang monitor stop monitoring + * threads. + * + * Prohibit() and Allow() can be called before XPCOM is ready. If + * we don't stop monitoring threads it could case errors. + */ + static void Prohibit(); + + /** + * Allow the hang monitor to run. + * + * Allow() and Prohibit() should be called in pair. + * + * \see Prohibit() + */ + static void Allow(); }; } // namespace mozilla From 05f5436a80447ee8af55fd882094a347dc202d68 Mon Sep 17 00:00:00 2001 From: "Thinker K.F. Li" Date: Fri, 25 Jul 2014 20:52:00 +0200 Subject: [PATCH 05/50] Bug 977026 - part 3: preload XPT before calling fork. r=bsmedberg --- b2g/app/B2GLoader.cpp | 89 +++++++++++++++- toolkit/xre/moz.build | 2 + toolkit/xre/nsEmbedFunctions.cpp | 40 ++++++++ xpcom/build/nsXULAppAPI.h | 3 + xpcom/components/ManifestParser.cpp | 102 +++++++++++++++---- xpcom/components/ManifestParser.h | 2 +- xpcom/components/nsComponentManager.cpp | 129 ++++++++++++++++++++++-- xpcom/components/nsComponentManager.h | 28 +++++ 8 files changed, 360 insertions(+), 35 deletions(-) diff --git a/b2g/app/B2GLoader.cpp b/b2g/app/B2GLoader.cpp index 2eb2b14f784c..7e0aa9627840 100644 --- a/b2g/app/B2GLoader.cpp +++ b/b2g/app/B2GLoader.cpp @@ -5,6 +5,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsXULAppAPI.h" +#include "application.ini.h" #include "nsXPCOMGlue.h" #include "nsStringGlue.h" #include "nsCOMPtr.h" @@ -29,10 +30,16 @@ // Functions being loaded by XPCOMGlue XRE_ProcLoaderServiceRunType XRE_ProcLoaderServiceRun; XRE_ProcLoaderClientInitType XRE_ProcLoaderClientInit; +XRE_ProcLoaderPreloadType XRE_ProcLoaderPreload; +extern XRE_CreateAppDataType XRE_CreateAppData; +extern XRE_GetFileFromPathType XRE_GetFileFromPath; static const nsDynamicFunctionLoad kXULFuncs[] = { { "XRE_ProcLoaderServiceRun", (NSFuncPtr*) &XRE_ProcLoaderServiceRun }, { "XRE_ProcLoaderClientInit", (NSFuncPtr*) &XRE_ProcLoaderClientInit }, + { "XRE_ProcLoaderPreload", (NSFuncPtr*) &XRE_ProcLoaderPreload }, + { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData }, + { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath }, { nullptr, nullptr } }; @@ -83,15 +90,89 @@ LoadLibxul(const char *aXPCOMPath) return true; } +/** + * Return true if |arg| matches the given argument name. + */ static bool -LoadStaticData(const char *aProgram) +IsArg(const char* arg, const char* s) +{ + if (*arg == '-') { + if (*++arg == '-') { + ++arg; + } + return !strcasecmp(arg, s); + } + +#if defined(XP_WIN) + if (*arg == '/') { + return !strcasecmp(++arg, s); + } +#endif + + return false; +} + +static already_AddRefed +GetAppIni(int argc, const char *argv[]) +{ + nsCOMPtr appini; + nsresult rv; + + // Allow firefox.exe to launch XULRunner apps via -app + // Note that -app must be the *first* argument. + const char *appDataFile = getenv("XUL_APP_FILE"); + if (appDataFile && *appDataFile) { + rv = XRE_GetFileFromPath(appDataFile, getter_AddRefs(appini)); + NS_ENSURE_SUCCESS(rv, nullptr); + } else if (argc > 1 && IsArg(argv[1], "app")) { + if (argc == 2) { + return nullptr; + } + + rv = XRE_GetFileFromPath(argv[2], getter_AddRefs(appini)); + NS_ENSURE_SUCCESS(rv, nullptr); + + char appEnv[MAXPATHLEN]; + snprintf(appEnv, MAXPATHLEN, "XUL_APP_FILE=%s", argv[2]); + if (putenv(appEnv)) { + return nullptr; + } + } + + return appini.forget(); +} + +static bool +LoadStaticData(int argc, const char *argv[]) { char xpcomPath[MAXPATHLEN]; - bool ok = GetXPCOMPath(aProgram, xpcomPath, MAXPATHLEN); + bool ok = GetXPCOMPath(argv[0], xpcomPath, MAXPATHLEN); NS_ENSURE_TRUE(ok, false); ok = LoadLibxul(xpcomPath); - return ok; + NS_ENSURE_TRUE(ok, false); + + char progDir[MAXPATHLEN]; + ok = GetDirnameSlash(xpcomPath, progDir, MAXPATHLEN); + NS_ENSURE_TRUE(ok, false); + + nsCOMPtr appini = GetAppIni(argc, argv); + const nsXREAppData *appData; + if (appini) { + nsresult rv = + XRE_CreateAppData(appini, const_cast(&appData)); + NS_ENSURE_SUCCESS(rv, false); + } else { + appData = &sAppData; + } + + XRE_ProcLoaderPreload(progDir, appData); + + if (appini) { + XRE_FreeAppData(const_cast(appData)); + } + + return true; } /** @@ -158,7 +239,7 @@ main(int argc, const char* argv[]) * Before fork(), libxul and static data of Gecko are loaded for * sharing. */ - bool ok = LoadStaticData(program); + bool ok = LoadStaticData(argc, argv); if (!ok) { return 255; } diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build index ba01e0d26258..0633851c8023 100644 --- a/toolkit/xre/moz.build +++ b/toolkit/xre/moz.build @@ -160,3 +160,5 @@ if CONFIG['MOZ_ENABLE_XREMOTE']: '/widget/xremoteclient', ] +if CONFIG['MOZ_B2G_LOADER']: + DEFINES['OMNIJAR_NAME'] = CONFIG['OMNIJAR_NAME'] diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp index 3a7f5b9780ff..4857abdf5f5c 100644 --- a/toolkit/xre/nsEmbedFunctions.cpp +++ b/toolkit/xre/nsEmbedFunctions.cpp @@ -81,6 +81,11 @@ using mozilla::_ipdltest::IPDLUnitTestProcessChild; #endif // ifdef MOZ_IPDL_TESTS +#ifdef MOZ_B2G_LOADER +#include "nsLocalFile.h" +#include "nsXREAppData.h" +#endif + using namespace mozilla; using mozilla::ipc::BrowserProcessSubThread; @@ -815,3 +820,38 @@ XRE_GetWindowsEnvironment() } #endif // XP_WIN +#ifdef MOZ_B2G_LOADER +extern const nsXREAppData* gAppData; + +/** + * Preload static data of Gecko for B2G loader. + * + * This function is supposed to be called before XPCOM is initialized. + * For now, this function preloads + * - XPT interface Information + */ +void +XRE_ProcLoaderPreload(const char* aProgramDir, const nsXREAppData* aAppData) +{ + void PreloadXPT(nsIFile *); + + nsresult rv; + nsCOMPtr omnijarFile; + rv = NS_NewNativeLocalFile(nsCString(aProgramDir), + true, + getter_AddRefs(omnijarFile)); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + rv = omnijarFile->AppendNative(NS_LITERAL_CSTRING(NS_STRINGIFY(OMNIJAR_NAME))); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + + /* + * gAppData is required by nsXULAppInfo. The manifest parser + * evaluate flags with the information from nsXULAppInfo. + */ + gAppData = aAppData; + + PreloadXPT(omnijarFile); + + gAppData = nullptr; +} +#endif /* MOZ_B2G_LOADER */ diff --git a/xpcom/build/nsXULAppAPI.h b/xpcom/build/nsXULAppAPI.h index e5ace7e9439e..33329e33b23f 100644 --- a/xpcom/build/nsXULAppAPI.h +++ b/xpcom/build/nsXULAppAPI.h @@ -472,6 +472,9 @@ XRE_API(int, XRE_ProcLoaderServiceRun, (pid_t, int, int argc, const char *argv[])); XRE_API(void, XRE_ProcLoaderClientInit, (pid_t, int)); +XRE_API(void, + XRE_ProcLoaderPreload, (const char* aProgramDir, + const nsXREAppData* aAppData)); #endif // MOZ_B2G_LOADER XRE_API(int, diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp index 28ac26814886..00a2d471407e 100644 --- a/xpcom/components/ManifestParser.cpp +++ b/xpcom/components/ManifestParser.cpp @@ -36,6 +36,18 @@ #include "nsIScriptError.h" #include "nsIXULAppInfo.h" #include "nsIXULRuntime.h" +#ifdef MOZ_B2G_LOADER +#include "mozilla/XPTInterfaceInfoManager.h" +#endif + +#ifdef MOZ_B2G_LOADER +#define XPTONLY_MANIFEST &nsComponentManagerImpl::XPTOnlyManifestManifest +#define XPTONLY_XPT &nsComponentManagerImpl::XPTOnlyManifestXPT +#else +#define XPTONLY_MANIFEST nullptr +#define XPTONLY_XPT nullptr +#endif + using namespace mozilla; @@ -64,36 +76,43 @@ struct ManifestDirective (nsChromeRegistry::ManifestProcessingContext& cx, int lineno, char *const *argv, bool platform, bool contentaccessible); +#ifdef MOZ_B2G_LOADER + // The function to handle the directive for XPT Only parsing. + void (*xptonlyfunc)(nsComponentManagerImpl::XPTOnlyManifestProcessingContext& cx, + int lineno, char *const * argv); +#else + void *xptonlyfunc; +#endif bool isContract; }; static const ManifestDirective kParsingTable[] = { { "manifest", 1, false, true, true, false, - &nsComponentManagerImpl::ManifestManifest, nullptr }, + &nsComponentManagerImpl::ManifestManifest, nullptr, XPTONLY_MANIFEST }, { "binary-component", 1, true, false, false, false, - &nsComponentManagerImpl::ManifestBinaryComponent, nullptr }, + &nsComponentManagerImpl::ManifestBinaryComponent, nullptr, nullptr }, { "interfaces", 1, true, false, false, false, - &nsComponentManagerImpl::ManifestXPT, nullptr }, + &nsComponentManagerImpl::ManifestXPT, nullptr, XPTONLY_XPT }, { "component", 2, true, false, false, false, - &nsComponentManagerImpl::ManifestComponent, nullptr }, + &nsComponentManagerImpl::ManifestComponent, nullptr, nullptr }, { "contract", 2, true, false, false, false, - &nsComponentManagerImpl::ManifestContract, nullptr, true}, + &nsComponentManagerImpl::ManifestContract, nullptr, nullptr, true}, { "category", 3, true, false, false, false, - &nsComponentManagerImpl::ManifestCategory, nullptr }, + &nsComponentManagerImpl::ManifestCategory, nullptr, nullptr }, { "content", 2, true, true, true, true, - nullptr, &nsChromeRegistry::ManifestContent }, + nullptr, &nsChromeRegistry::ManifestContent, nullptr }, { "locale", 3, true, true, true, false, - nullptr, &nsChromeRegistry::ManifestLocale }, + nullptr, &nsChromeRegistry::ManifestLocale, nullptr }, { "skin", 3, false, true, true, false, - nullptr, &nsChromeRegistry::ManifestSkin }, + nullptr, &nsChromeRegistry::ManifestSkin, nullptr }, { "overlay", 2, true, true, false, false, - nullptr, &nsChromeRegistry::ManifestOverlay }, + nullptr, &nsChromeRegistry::ManifestOverlay, nullptr }, { "style", 2, false, true, false, false, - nullptr, &nsChromeRegistry::ManifestStyle }, + nullptr, &nsChromeRegistry::ManifestStyle, nullptr }, { "override", 2, true, true, true, false, - nullptr, &nsChromeRegistry::ManifestOverride }, + nullptr, &nsChromeRegistry::ManifestOverride, nullptr }, { "resource", 2, true, true, false, false, - nullptr, &nsChromeRegistry::ManifestResource } + nullptr, &nsChromeRegistry::ManifestResource, nullptr } }; static const char kWhitespace[] = "\t "; @@ -126,8 +145,16 @@ struct AutoPR_smprintf_free } // anonymous namespace +/** + * If we are pre-loading XPTs, this method may do nothing because the + * console service is not initialized. + */ void LogMessage(const char* aMsg, ...) { + if (!nsComponentManagerImpl::gComponentManager) { + return; + } + nsCOMPtr console = do_GetService(NS_CONSOLESERVICE_CONTRACTID); if (!console) @@ -143,6 +170,10 @@ void LogMessage(const char* aMsg, ...) console->LogMessage(error); } +/** + * If we are pre-loading XPTs, this method may do nothing because the + * console service is not initialized. + */ void LogMessageWithContext(FileLocation &aFile, uint32_t aLineNumber, const char* aMsg, ...) { @@ -153,6 +184,10 @@ void LogMessageWithContext(FileLocation &aFile, if (!formatted) return; + if (!nsComponentManagerImpl::gComponentManager) { + return; + } + nsCString file; aFile.GetURIString(file); @@ -388,11 +423,23 @@ struct CachedDirective } // anonymous namespace +/** + * For XPT-Only mode, the parser handles only directives of "manifest" + * and "interfaces", and always call the function given by |xptonlyfunc| + * variable of struct |ManifestDirective|. + * + * This function is safe to be called before the component manager is + * ready if aXPTOnly is true for it don't invoke any component during + * parsing. + */ void -ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOnly) +ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOnly, bool aXPTOnly) { nsComponentManagerImpl::ManifestProcessingContext mgrcx(type, file, aChromeOnly); nsChromeRegistry::ManifestProcessingContext chromecx(type, file); +#ifdef MOZ_B2G_LOADER + nsComponentManagerImpl::XPTOnlyManifestProcessingContext xptonlycx(file); +#endif nsresult rv; NS_NAMED_LITERAL_STRING(kPlatform, "platform"); @@ -416,7 +463,12 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn nsAutoString osTarget; nsAutoString abi; - nsCOMPtr xapp (do_GetService(XULAPPINFO_SERVICE_CONTRACTID)); + nsCOMPtr xapp; + if (!aXPTOnly) { + // Avoid to create any component for XPT only mode. + // No xapp means no ID, version, ..., modifiers checking. + xapp = do_GetService(XULAPPINFO_SERVICE_CONTRACTID); + } if (xapp) { nsAutoCString s; rv = xapp->GetID(s); @@ -516,9 +568,10 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn for (const ManifestDirective* d = kParsingTable; d < ArrayEnd(kParsingTable); ++d) { - if (!strcmp(d->directive, token)) { - directive = d; - break; + if (!strcmp(d->directive, token) && + (!aXPTOnly || d->xptonlyfunc)) { + directive = d; + break; } } @@ -577,8 +630,9 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn CheckStringFlag(kABI, wtoken, abi, stABI) || CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) || CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) || - CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) + CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) { continue; + } #if defined(MOZ_WIDGET_ANDROID) bool tablet = false; @@ -619,6 +673,11 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn stABI == eBad) continue; +#ifdef MOZ_B2G_LOADER + if (aXPTOnly) { + directive->xptonlyfunc(xptonlycx, line, argv); + } else +#endif /* MOZ_B2G_LOADER */ if (directive->regfunc) { if (GeckoProcessType_Default != XRE_GetProcessType()) continue; @@ -636,7 +695,7 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn (nsChromeRegistry::gChromeRegistry->*(directive->regfunc)) (chromecx, line, argv, platform, contentAccessible); } - else if (directive->ischrome || !aChromeOnly) { + else if (directive->mgrfunc && (directive->ischrome || !aChromeOnly)) { if (directive->isContract) { CachedDirective* cd = contracts.AppendElement(); cd->lineno = line; @@ -646,6 +705,9 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn else (nsComponentManagerImpl::gComponentManager->*(directive->mgrfunc)) (mgrcx, line, argv); + } else { + LogMessageWithContext(file, line, + "No valid manifest directive."); } } diff --git a/xpcom/components/ManifestParser.h b/xpcom/components/ManifestParser.h index 5dc98602bdf6..61f70182deef 100644 --- a/xpcom/components/ManifestParser.h +++ b/xpcom/components/ManifestParser.h @@ -13,7 +13,7 @@ class nsIFile; void ParseManifest(NSLocationType type, mozilla::FileLocation &file, - char* buf, bool aChromeOnly); + char* buf, bool aChromeOnly, bool aXPTOnly=false); void LogMessage(const char* aMsg, ...); diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index 8a5c0955ebc2..61f670636eed 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -69,6 +69,7 @@ #include "nsStringEnumerator.h" #include "mozilla/FileUtils.h" #include "nsNetUtil.h" +#include "nsDataHashtable.h" #include // for placement new @@ -104,6 +105,36 @@ NS_DEFINE_CID(kCategoryManagerCID, NS_CATEGORYMANAGER_CID); #define UID_STRING_LENGTH 39 +#ifdef MOZ_B2G_LOADER +typedef nsDataHashtable XPTIInfosBookType; +static XPTIInfosBookType *sXPTIInfosBook = nullptr; + +static XPTIInfosBookType * +GetXPTIInfosBook() +{ + if (sXPTIInfosBook == nullptr) { + sXPTIInfosBook = new XPTIInfosBookType; + } + return sXPTIInfosBook; +} + +static bool +IsRegisteredXPTIInfo(FileLocation &aFile) +{ + nsAutoCString uri; + aFile.GetURIString(uri); + return GetXPTIInfosBook()->Get(uri); +} + +static void +MarkRegisteredXPTIInfo(FileLocation &aFile) +{ + nsAutoCString uri; + aFile.GetURIString(uri); + GetXPTIInfosBook()->Put(uri, true); +} +#endif /* MOZ_B2G_LOADER */ + nsresult nsGetServiceFromCategory::operator()(const nsIID& aIID, void** aInstancePtr) const { @@ -524,11 +555,14 @@ CutExtension(nsCString& path) path.Cut(0, dotPos + 1); } -void -nsComponentManagerImpl::RegisterManifest(NSLocationType aType, - FileLocation &aFile, - bool aChromeOnly) +static void +DoRegisterManifest(NSLocationType aType, + FileLocation &aFile, + bool aChromeOnly, + bool aXPTOnly) { + MOZ_ASSERT(!aXPTOnly || + nsComponentManagerImpl::gComponentManager == nullptr); uint32_t len; FileLocation::Data data; nsAutoArrayPtr buf; @@ -542,7 +576,7 @@ nsComponentManagerImpl::RegisterManifest(NSLocationType aType, } if (NS_SUCCEEDED(rv)) { buf[len] = '\0'; - ParseManifest(aType, aFile, buf, aChromeOnly); + ParseManifest(aType, aFile, buf, aChromeOnly, aXPTOnly); } else if (NS_BOOTSTRAPPED_LOCATION != aType) { nsCString uri; aFile.GetURIString(uri); @@ -550,6 +584,14 @@ nsComponentManagerImpl::RegisterManifest(NSLocationType aType, } } +void +nsComponentManagerImpl::RegisterManifest(NSLocationType aType, + FileLocation &aFile, + bool aChromeOnly) +{ + DoRegisterManifest(aType, aFile, aChromeOnly, false); +} + void nsComponentManagerImpl::ManifestManifest(ManifestProcessingContext& cx, int lineno, char *const * argv) { @@ -587,14 +629,19 @@ nsComponentManagerImpl::ManifestBinaryComponent(ManifestProcessingContext& cx, i RegisterModule(m, &f); } -void -nsComponentManagerImpl::ManifestXPT(ManifestProcessingContext& cx, int lineno, char *const * argv) +static void +DoRegisterXPT(FileLocation &aFile) { - FileLocation f(cx.mFile, argv[0]); +#ifdef MOZ_B2G_LOADER + if (IsRegisteredXPTIInfo(aFile)) { + return; + } +#endif + uint32_t len; FileLocation::Data data; nsAutoArrayPtr buf; - nsresult rv = f.GetData(data); + nsresult rv = aFile.GetData(data); if (NS_SUCCEEDED(rv)) { rv = data.GetSize(&len); } @@ -604,13 +651,23 @@ nsComponentManagerImpl::ManifestXPT(ManifestProcessingContext& cx, int lineno, c } if (NS_SUCCEEDED(rv)) { XPTInterfaceInfoManager::GetSingleton()->RegisterBuffer(buf, len); +#ifdef MOZ_B2G_LOADER + MarkRegisteredXPTIInfo(aFile); +#endif } else { nsCString uri; - f.GetURIString(uri); + aFile.GetURIString(uri); LogMessage("Could not read '%s'.", uri.get()); } } +void +nsComponentManagerImpl::ManifestXPT(ManifestProcessingContext& cx, int lineno, char *const * argv) +{ + FileLocation f(cx.mFile, argv[0]); + DoRegisterXPT(f); +} + void nsComponentManagerImpl::ManifestComponent(ManifestProcessingContext& cx, int lineno, char *const * argv) { @@ -794,6 +851,10 @@ nsresult nsComponentManagerImpl::Shutdown(void) delete sStaticModules; delete sModuleLocations; +#ifdef MOZ_B2G_LOADER + delete sXPTIInfosBook; + sXPTIInfosBook = nullptr; +#endif // Unload libraries mNativeModuleLoader.UnloadLibraries(); @@ -1942,6 +2003,54 @@ nsComponentManagerImpl::GetManifestLocations(nsIArray **aLocations) return NS_OK; } +#ifdef MOZ_B2G_LOADER + +/* static */ +void +nsComponentManagerImpl::XPTOnlyManifestManifest(XPTOnlyManifestProcessingContext &aCx, + int aLineno, + char * const * aArgv) +{ + char* file = aArgv[0]; + FileLocation f(aCx.mFile, file); + + DoRegisterManifest(NS_COMPONENT_LOCATION, f, false, true); +} + +/* static */ +void +nsComponentManagerImpl::XPTOnlyManifestXPT(XPTOnlyManifestProcessingContext &aCx, + int aLineno, + char * const * aArgv) +{ + FileLocation f(aCx.mFile, aArgv[0]); + DoRegisterXPT(f); +} + +/** + * To load XPT Interface Information before the component manager is ready. + * + * With this function, B2G loader could XPT interface info. as earier + * as possible to gain benefit of shared memory model of the kernel. + */ +/* static */ void +nsComponentManagerImpl::PreloadXPT(nsIFile *aFile) +{ + MOZ_ASSERT(nsComponentManagerImpl::gComponentManager == nullptr); + FileLocation location(aFile, "chrome.manifest"); + + DoRegisterManifest(NS_COMPONENT_LOCATION, location, + false, true /* aXPTOnly */); +} + +void +PreloadXPT(nsIFile *aOmnijarFile) +{ + nsComponentManagerImpl::PreloadXPT(aOmnijarFile); +} + +#endif /* MOZ_B2G_LOADER */ + EXPORT_XPCOM_API(nsresult) XRE_AddManifestLocation(NSLocationType aType, nsIFile* aLocation) { diff --git a/xpcom/components/nsComponentManager.h b/xpcom/components/nsComponentManager.h index e9354df2c68d..024201bf0b37 100644 --- a/xpcom/components/nsComponentManager.h +++ b/xpcom/components/nsComponentManager.h @@ -38,6 +38,10 @@ #include "mozilla/Omnijar.h" #include "mozilla/Attributes.h" +#ifdef MOZ_B2G_LOADER +#include "mozilla/FileLocation.h" +#endif + struct nsFactoryEntry; class nsIServiceManager; struct PRThread; @@ -316,6 +320,30 @@ public: size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf); +#ifdef MOZ_B2G_LOADER + // Preload XPT interface info for B2G loader. + // This function is called before XPCOM has been initialized. + static void PreloadXPT(nsIFile *aFile); +#endif + +#ifdef MOZ_B2G_LOADER + // Parsing functions of directives of manifest for XPT only parsing. + struct XPTOnlyManifestProcessingContext + { + XPTOnlyManifestProcessingContext(mozilla::FileLocation &aFile) + : mFile(aFile) + { } + + ~XPTOnlyManifestProcessingContext() { } + + mozilla::FileLocation mFile; + }; + static void XPTOnlyManifestManifest(XPTOnlyManifestProcessingContext& aCx, + int aLineno, char * const *aArgv); + static void XPTOnlyManifestXPT(XPTOnlyManifestProcessingContext& aCx, + int aLineno, char * const *aArgv); +#endif + private: ~nsComponentManagerImpl(); }; From 9dca59d28a438bb89b0e35e2a90e5d4935f23118 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 00:35:24 -0700 Subject: [PATCH 06/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/667742f9e04c Author: Carsten Book Desc: Merge pull request #22086 from flodolo/lockscreen_rtl Bug 1042879 - [rtl] Lockscreen: display camera icon on the left when passcode is enabled. r=gweng ======== https://hg.mozilla.org/integration/gaia-central/rev/9b62cef71d07 Author: Francesco Lodolo (:flod) Desc: Bug 1042879 - [rtl] Lockscreen: display camera icon on the left when passcode is enabled --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index da92a5192c23..86d386d22fe4 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "5797e7d27cd59ae08bc32223339841548015d0c0", + "revision": "667742f9e04c204015f994dcb18833109b8b148e", "repo_path": "/integration/gaia-central" } From 3d111064d54ed2970a774f57830ac4cf810e88d5 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 00:41:41 -0700 Subject: [PATCH 07/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index c40f9bf1cc6b..b6948cea7cc6 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 0c065fe94eda..d9f044b79cc1 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 26d9013b9a04..777f81d416e9 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index c40f9bf1cc6b..b6948cea7cc6 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 1752d529ccd8..0e9e077da5a4 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index a0ca40aa46ed..48d353b49e1c 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 0f13e7af4a5e..36e041d2dece 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 9479e3e4e1d3..4ecf8be63313 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index aa050d7b9b13..d687b0af205b 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 6c5cf788bdc0b6d0a73ff2c7f37b808b2cb5fbda Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 28 Jul 2014 09:52:50 +0200 Subject: [PATCH 08/50] Bug 1042691: Add A2DP/AVRCP result-handler infrastructure (under bluetooth2/), r=btian --- .../bluedroid/BluetoothInterface.cpp | 62 +++++++++++++++++++ dom/bluetooth2/bluedroid/BluetoothInterface.h | 51 +++++++++++++++ 2 files changed, 113 insertions(+) diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp index 58924c23c52a..d7126111217a 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp @@ -847,6 +847,37 @@ struct interface_traits } }; +typedef + BluetoothInterfaceRunnable0 + BluetoothA2dpResultRunnable; + +typedef + BluetoothInterfaceRunnable1 + BluetoothA2dpErrorRunnable; + +static nsresult +DispatchBluetoothA2dpResult( + BluetoothA2dpResultHandler* aRes, + void (BluetoothA2dpResultHandler::*aMethod)(), + bt_status_t aStatus) +{ + MOZ_ASSERT(aRes); + + nsRunnable* runnable; + + if (aStatus == BT_STATUS_SUCCESS) { + runnable = new BluetoothA2dpResultRunnable(aRes, aMethod); + } else { + runnable = new BluetoothA2dpErrorRunnable(aRes, + &BluetoothA2dpResultHandler::OnError, aStatus); + } + nsresult rv = NS_DispatchToMainThread(runnable); + if (NS_FAILED(rv)) { + BT_WARNING("NS_DispatchToMainThread failed: %X", rv); + } + return rv; +} + BluetoothA2dpInterface::BluetoothA2dpInterface( const btav_interface_t* aInterface) : mInterface(aInterface) @@ -897,6 +928,37 @@ struct interface_traits } }; +typedef + BluetoothInterfaceRunnable0 + BluetoothAvrcpResultRunnable; + +typedef + BluetoothInterfaceRunnable1 + BluetoothAvrcpErrorRunnable; + +static nsresult +DispatchBluetoothAvrcpResult( + BluetoothAvrcpResultHandler* aRes, + void (BluetoothAvrcpResultHandler::*aMethod)(), + bt_status_t aStatus) +{ + MOZ_ASSERT(aRes); + + nsRunnable* runnable; + + if (aStatus == BT_STATUS_SUCCESS) { + runnable = new BluetoothAvrcpResultRunnable(aRes, aMethod); + } else { + runnable = new BluetoothAvrcpErrorRunnable(aRes, + &BluetoothAvrcpResultHandler::OnError, aStatus); + } + nsresult rv = NS_DispatchToMainThread(runnable); + if (NS_FAILED(rv)) { + BT_WARNING("NS_DispatchToMainThread failed: %X", rv); + } + return rv; +} + BluetoothAvrcpInterface::BluetoothAvrcpInterface( const btrc_interface_t* aInterface) : mInterface(aInterface) diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.h b/dom/bluetooth2/bluedroid/BluetoothInterface.h index b3ff596e77e1..0ea223826fbc 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.h +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.h @@ -181,6 +181,24 @@ private: // Bluetooth Advanced Audio Interface // +class BluetoothA2dpResultHandler +{ +public: + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BluetoothA2dpResultHandler) + + virtual ~BluetoothA2dpResultHandler() { } + + virtual void OnError(bt_status_t aStatus) + { + BT_WARNING("received error code %d", (int)aStatus); + } + + virtual void Init() { } + virtual void Cleanup() { } + virtual void Connect() { } + virtual void Disconnect() { } +}; + class BluetoothA2dpInterface { public: @@ -204,6 +222,39 @@ private: // Bluetooth AVRCP Interface // +class BluetoothAvrcpResultHandler +{ +public: + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BluetoothAvrcpResultHandler) + + virtual ~BluetoothAvrcpResultHandler() { } + + virtual void OnError(bt_status_t aStatus) + { + BT_WARNING("received error code %d", (int)aStatus); + } + + virtual void Init() { } + virtual void Cleanup() { } + + virtual void GetPlayStatusRsp() { } + + virtual void ListPlayerAppAttrRsp() { } + virtual void ListPlayerAppValueRsp() { } + + virtual void GetPlayerAppValueRsp() { } + virtual void GetPlayerAppAttrTextRsp() { } + virtual void GetPlayerAppValueTextRsp() { } + + virtual void GetElementAttrRsp() { } + + virtual void SetPlayerAppValueRsp() { } + + virtual void RegisterNotificationRsp() { } + + virtual void SetVolume() { } +}; + class BluetoothAvrcpInterface { #if ANDROID_VERSION >= 18 From abbdf7f4d9f8b5e399c567ebee5f0ca81d88f4a1 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 28 Jul 2014 09:52:51 +0200 Subject: [PATCH 09/50] Bug 1042691: Asynchronous init and cleanup of A2DP/AVRCP (under bluetooth2/), r=btian --- .../bluedroid/BluetoothA2dpManager.cpp | 216 +++++++++++++++--- .../bluedroid/BluetoothInterface.cpp | 38 ++- dom/bluetooth2/bluedroid/BluetoothInterface.h | 10 +- 3 files changed, 217 insertions(+), 47 deletions(-) diff --git a/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp b/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp index 1ccc890cc0d1..b7c524b8955c 100644 --- a/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp @@ -492,6 +492,85 @@ static btrc_callbacks_t sBtAvrcpCallbacks = { }; #endif +#if ANDROID_VERSION > 17 +class InitAvrcpResultHandler MOZ_FINAL : public BluetoothAvrcpResultHandler +{ +public: + InitAvrcpResultHandler(BluetoothProfileResultHandler* aRes) + : mRes(aRes) + { } + + void OnError(bt_status_t aStatus) MOZ_OVERRIDE + { + BT_WARNING("BluetoothAvrcpInterface::Init failed: %d", + (int)aStatus); + if (mRes) { + mRes->OnError(NS_ERROR_FAILURE); + } + } + + void Init() MOZ_OVERRIDE + { + if (mRes) { + mRes->Init(); + } + } + +private: + nsRefPtr mRes; +}; +#endif + +class InitA2dpResultHandler MOZ_FINAL : public BluetoothA2dpResultHandler +{ +public: + InitA2dpResultHandler(BluetoothProfileResultHandler* aRes) + : mRes(aRes) + { } + + void OnError(bt_status_t aStatus) MOZ_OVERRIDE + { + BT_WARNING("BluetoothA2dpInterface::Init failed: %d", + (int)aStatus); + if (mRes) { + mRes->OnError(NS_ERROR_FAILURE); + } + } + + void Init() MOZ_OVERRIDE + { +#if ANDROID_VERSION > 17 + /* Also init AVRCP if it's available, ... */ + BluetoothInterface* btInf = BluetoothInterface::GetInstance(); + if (!btInf) { + if (mRes) { + mRes->OnError(NS_ERROR_FAILURE); + } + return; + } + + sBtAvrcpInterface = btInf->GetBluetoothAvrcpInterface(); + if (!sBtAvrcpInterface) { + if (mRes) { + mRes->OnError(NS_ERROR_FAILURE); + } + return; + } + + sBtAvrcpInterface->Init(&sBtAvrcpCallbacks, + new InitAvrcpResultHandler(mRes)); +#else + /* ...or signal success otherwise. */ + if (mRes) { + mRes->Init(); + } +#endif + } + +private: + nsRefPtr mRes; +}; + /* * This function will be only called when Bluetooth is turning on. * It is important to register a2dp callbacks before enable() gets called. @@ -520,30 +599,7 @@ BluetoothA2dpManager::InitA2dpInterface(BluetoothProfileResultHandler* aRes) return; } - int ret = sBtA2dpInterface->Init(&sBtA2dpCallbacks); - if (ret != BT_STATUS_SUCCESS) { - BT_LOGR("Warning: failed to init a2dp module"); - } - -#if ANDROID_VERSION > 17 - sBtAvrcpInterface = btInf->GetBluetoothAvrcpInterface(); - if (!sBtAvrcpInterface) { - BT_LOGR("Error: Bluetooth AVRCP interface not available"); - if (aRes) { - aRes->OnError(NS_ERROR_FAILURE); - } - return; - } - - ret = sBtAvrcpInterface->Init(&sBtAvrcpCallbacks); - if (ret != BT_STATUS_SUCCESS) { - BT_LOGR("Warning: failed to init avrcp module"); - } -#endif - - if (aRes) { - aRes->Init(); - } + sBtA2dpInterface->Init(&sBtA2dpCallbacks, new InitA2dpResultHandler(aRes)); } BluetoothA2dpManager::~BluetoothA2dpManager() @@ -617,6 +673,99 @@ BluetoothA2dpManager::Get() return sBluetoothA2dpManager; } +#if ANDROID_VERSION > 17 +class CleanupAvrcpResultHandler MOZ_FINAL : public BluetoothAvrcpResultHandler +{ +public: + CleanupAvrcpResultHandler(BluetoothProfileResultHandler* aRes) + : mRes(aRes) + { } + + void OnError(bt_status_t aStatus) MOZ_OVERRIDE + { + BT_WARNING("BluetoothAvrcpInterface::Cleanup failed: %d", + (int)aStatus); + if (mRes) { + mRes->OnError(NS_ERROR_FAILURE); + } + } + + void Cleanup() MOZ_OVERRIDE + { + sBtAvrcpInterface = nullptr; + if (mRes) { + mRes->Deinit(); + } + } + +private: + nsRefPtr mRes; +}; +#endif + +class CleanupA2dpResultHandler MOZ_FINAL : public BluetoothA2dpResultHandler +{ +public: + CleanupA2dpResultHandler(BluetoothProfileResultHandler* aRes) + : mRes(aRes) + { } + + void OnError(bt_status_t aStatus) MOZ_OVERRIDE + { + BT_WARNING("BluetoothA2dpInterface::Cleanup failed: %d", + (int)aStatus); + if (mRes) { + mRes->OnError(NS_ERROR_FAILURE); + } + } + + void Cleanup() MOZ_OVERRIDE + { + sBtA2dpInterface = nullptr; +#if ANDROID_VERSION > 17 + /* Cleanup AVRCP if it's available and initialized, ...*/ + if (sBtAvrcpInterface) { + sBtAvrcpInterface->Cleanup(new CleanupAvrcpResultHandler(mRes)); + } else +#endif + if (mRes) { + /* ...or simply signal success from here. */ + mRes->Deinit(); + } + } + +private: + nsRefPtr mRes; +}; + +class CleanupA2dpResultHandlerRunnable MOZ_FINAL : public nsRunnable +{ +public: + CleanupA2dpResultHandlerRunnable(BluetoothProfileResultHandler* aRes) + : mRes(aRes) + { } + + NS_IMETHOD Run() MOZ_OVERRIDE + { + sBtA2dpInterface = nullptr; +#if ANDROID_VERSION > 17 + /* Cleanup AVRCP if it's available and initialized, ...*/ + if (sBtAvrcpInterface) { + sBtAvrcpInterface->Cleanup(new CleanupAvrcpResultHandler(mRes)); + } else +#endif + if (mRes) { + /* ...or simply signal success from here. */ + mRes->Deinit(); + } + + return NS_OK; + } + +private: + nsRefPtr mRes; +}; + // static void BluetoothA2dpManager::DeinitA2dpInterface(BluetoothProfileResultHandler* aRes) @@ -624,17 +773,14 @@ BluetoothA2dpManager::DeinitA2dpInterface(BluetoothProfileResultHandler* aRes) MOZ_ASSERT(NS_IsMainThread()); if (sBtA2dpInterface) { - sBtA2dpInterface->Cleanup(); - sBtA2dpInterface = nullptr; - } -#if ANDROID_VERSION > 17 - if (sBtAvrcpInterface) { - sBtAvrcpInterface->Cleanup(); - sBtAvrcpInterface = nullptr; - } -#endif - if (aRes) { - aRes->Deinit(); + sBtA2dpInterface->Cleanup(new CleanupA2dpResultHandler(aRes)); + } else if (aRes) { + // We dispatch a runnable here to make the profile resource handler + // behave as if A2DP was initialized. + nsRefPtr r = new CleanupA2dpResultHandlerRunnable(aRes); + if (NS_FAILED(NS_DispatchToMainThread(r))) { + BT_LOGR("Failed to dispatch cleanup-result-handler runnable"); + } } } diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp index d7126111217a..58d6c4bf57d6 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp @@ -888,16 +888,27 @@ BluetoothA2dpInterface::BluetoothA2dpInterface( BluetoothA2dpInterface::~BluetoothA2dpInterface() { } -bt_status_t -BluetoothA2dpInterface::Init(btav_callbacks_t* aCallbacks) +void +BluetoothA2dpInterface::Init(btav_callbacks_t* aCallbacks, + BluetoothA2dpResultHandler* aRes) { - return mInterface->init(aCallbacks); + bt_status_t status = mInterface->init(aCallbacks); + + if (aRes) { + DispatchBluetoothA2dpResult(aRes, &BluetoothA2dpResultHandler::Init, + status); + } } void -BluetoothA2dpInterface::Cleanup() +BluetoothA2dpInterface::Cleanup(BluetoothA2dpResultHandler* aRes) { mInterface->cleanup(); + + if (aRes) { + DispatchBluetoothA2dpResult(aRes, &BluetoothA2dpResultHandler::Cleanup, + BT_STATUS_SUCCESS); + } } bt_status_t @@ -969,16 +980,27 @@ BluetoothAvrcpInterface::BluetoothAvrcpInterface( BluetoothAvrcpInterface::~BluetoothAvrcpInterface() { } -bt_status_t -BluetoothAvrcpInterface::Init(btrc_callbacks_t* aCallbacks) +void +BluetoothAvrcpInterface::Init(btrc_callbacks_t* aCallbacks, + BluetoothAvrcpResultHandler* aRes) { - return mInterface->init(aCallbacks); + bt_status_t status = mInterface->init(aCallbacks); + + if (aRes) { + DispatchBluetoothAvrcpResult(aRes, &BluetoothAvrcpResultHandler::Init, + status); + } } void -BluetoothAvrcpInterface::Cleanup() +BluetoothAvrcpInterface::Cleanup(BluetoothAvrcpResultHandler* aRes) { mInterface->cleanup(); + + if (aRes) { + DispatchBluetoothAvrcpResult(aRes, &BluetoothAvrcpResultHandler::Cleanup, + BT_STATUS_SUCCESS); + } } bt_status_t diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.h b/dom/bluetooth2/bluedroid/BluetoothInterface.h index 0ea223826fbc..3119ff07bc2c 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.h +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.h @@ -204,8 +204,9 @@ class BluetoothA2dpInterface public: friend class BluetoothInterface; - bt_status_t Init(btav_callbacks_t *aCallbacks); - void Cleanup(); + void Init(btav_callbacks_t *aCallbacks, + BluetoothA2dpResultHandler* aRes); + void Cleanup(BluetoothA2dpResultHandler* aRes); bt_status_t Connect(bt_bdaddr_t *aBdAddr); bt_status_t Disconnect(bt_bdaddr_t *aBdAddr); @@ -261,8 +262,9 @@ class BluetoothAvrcpInterface public: friend class BluetoothInterface; - bt_status_t Init(btrc_callbacks_t* aCallbacks); - void Cleanup(); + void Init(btrc_callbacks_t* aCallbacks, + BluetoothAvrcpResultHandler* aRes); + void Cleanup(BluetoothAvrcpResultHandler* aRes); bt_status_t GetPlayStatusRsp(btrc_play_status_t aPlayStatus, uint32_t aSongLen, uint32_t aSongPos); From 36fc86ade82c318c7bdb762cda3952c8bc3dd2d0 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 28 Jul 2014 09:52:51 +0200 Subject: [PATCH 10/50] Bug 1042691: Asynchronous A2DP connect/disconnect (under bluetooth2/), r=btian --- .../bluedroid/BluetoothA2dpManager.cpp | 57 +++++++++++++++---- .../bluedroid/BluetoothA2dpManager.h | 3 + .../bluedroid/BluetoothInterface.cpp | 24 ++++++-- dom/bluetooth2/bluedroid/BluetoothInterface.h | 6 +- 4 files changed, 70 insertions(+), 20 deletions(-) diff --git a/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp b/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp index b7c524b8955c..8e0c2d60ae70 100644 --- a/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp @@ -793,6 +793,29 @@ BluetoothA2dpManager::HandleShutdown() sBluetoothA2dpManager = nullptr; } +void +BluetoothA2dpManager::OnConnectError() +{ + MOZ_ASSERT(NS_IsMainThread()); + + mController->NotifyCompletion(NS_LITERAL_STRING(ERR_CONNECTION_FAILED)); + + mController = nullptr; + mDeviceAddress.Truncate(); +} + +class ConnectResultHandler MOZ_FINAL : public BluetoothA2dpResultHandler +{ +public: + void OnError(bt_status_t aStatus) MOZ_OVERRIDE + { + BT_LOGR("BluetoothA2dpInterface::Connect failed: %d", (int)aStatus); + + NS_ENSURE_TRUE_VOID(sBluetoothA2dpManager); + sBluetoothA2dpManager->OnConnectError(); + } +}; + void BluetoothA2dpManager::Connect(const nsAString& aDeviceAddress, BluetoothProfileController* aController) @@ -824,14 +847,29 @@ BluetoothA2dpManager::Connect(const nsAString& aDeviceAddress, bt_bdaddr_t remoteAddress; StringToBdAddressType(aDeviceAddress, &remoteAddress); - bt_status_t result = sBtA2dpInterface->Connect(&remoteAddress); - if (BT_STATUS_SUCCESS != result) { - BT_LOGR("Failed to connect: %x", result); - aController->NotifyCompletion(NS_LITERAL_STRING(ERR_CONNECTION_FAILED)); - return; - } + sBtA2dpInterface->Connect(&remoteAddress, new ConnectResultHandler()); } +void +BluetoothA2dpManager::OnDisconnectError() +{ + MOZ_ASSERT(NS_IsMainThread()); + + mController->NotifyCompletion(NS_LITERAL_STRING(ERR_DISCONNECTION_FAILED)); +} + +class DisconnectResultHandler MOZ_FINAL : public BluetoothA2dpResultHandler +{ +public: + void OnError(bt_status_t aStatus) MOZ_OVERRIDE + { + BT_LOGR("BluetoothA2dpInterface::Disconnect failed: %d", (int)aStatus); + + NS_ENSURE_TRUE_VOID(sBluetoothA2dpManager); + sBluetoothA2dpManager->OnDisconnectError(); + } +}; + void BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController) { @@ -866,12 +904,7 @@ BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController) bt_bdaddr_t remoteAddress; StringToBdAddressType(mDeviceAddress, &remoteAddress); - bt_status_t result = sBtA2dpInterface->Disconnect(&remoteAddress); - if (BT_STATUS_SUCCESS != result) { - BT_LOGR("Failed to disconnect: %x", result); - aController->NotifyCompletion(NS_LITERAL_STRING(ERR_DISCONNECTION_FAILED)); - return; - } + sBtA2dpInterface->Disconnect(&remoteAddress, new DisconnectResultHandler()); } void diff --git a/dom/bluetooth2/bluedroid/BluetoothA2dpManager.h b/dom/bluetooth2/bluedroid/BluetoothA2dpManager.h index 9f7a01daeb20..52490e3f4189 100644 --- a/dom/bluetooth2/bluedroid/BluetoothA2dpManager.h +++ b/dom/bluetooth2/bluedroid/BluetoothA2dpManager.h @@ -34,6 +34,9 @@ public: static void DeinitA2dpInterface(BluetoothProfileResultHandler* aRes); virtual ~BluetoothA2dpManager(); + void OnConnectError(); + void OnDisconnectError(); + // A2DP-specific functions void HandleSinkPropertyChanged(const BluetoothSignal& aSignal); diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp index 58d6c4bf57d6..8042283d4970 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp @@ -911,16 +911,28 @@ BluetoothA2dpInterface::Cleanup(BluetoothA2dpResultHandler* aRes) } } -bt_status_t -BluetoothA2dpInterface::Connect(bt_bdaddr_t *aBdAddr) +void +BluetoothA2dpInterface::Connect(bt_bdaddr_t *aBdAddr, + BluetoothA2dpResultHandler* aRes) { - return mInterface->connect(aBdAddr); + bt_status_t status = mInterface->connect(aBdAddr); + + if (aRes) { + DispatchBluetoothA2dpResult(aRes, &BluetoothA2dpResultHandler::Connect, + status); + } } -bt_status_t -BluetoothA2dpInterface::Disconnect(bt_bdaddr_t *aBdAddr) +void +BluetoothA2dpInterface::Disconnect(bt_bdaddr_t *aBdAddr, + BluetoothA2dpResultHandler* aRes) { - return mInterface->disconnect(aBdAddr); + bt_status_t status = mInterface->disconnect(aBdAddr); + + if (aRes) { + DispatchBluetoothA2dpResult(aRes, &BluetoothA2dpResultHandler::Disconnect, + status); + } } // diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.h b/dom/bluetooth2/bluedroid/BluetoothInterface.h index 3119ff07bc2c..08c1625a9194 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.h +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.h @@ -208,8 +208,10 @@ public: BluetoothA2dpResultHandler* aRes); void Cleanup(BluetoothA2dpResultHandler* aRes); - bt_status_t Connect(bt_bdaddr_t *aBdAddr); - bt_status_t Disconnect(bt_bdaddr_t *aBdAddr); + void Connect(bt_bdaddr_t *aBdAddr, + BluetoothA2dpResultHandler* aRes); + void Disconnect(bt_bdaddr_t *aBdAddr, + BluetoothA2dpResultHandler* aRes); protected: BluetoothA2dpInterface(const btav_interface_t* aInterface); From 34f492910332fd2bcb187f46e48449a99beb81d3 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 28 Jul 2014 09:52:51 +0200 Subject: [PATCH 11/50] Bug 1042691: Asynchronous AVRCP response interfaces (under bluetooth2/), r=btian --- .../bluedroid/BluetoothA2dpManager.cpp | 14 +-- .../bluedroid/BluetoothInterface.cpp | 118 +++++++++++++----- dom/bluetooth2/bluedroid/BluetoothInterface.h | 38 +++--- 3 files changed, 116 insertions(+), 54 deletions(-) diff --git a/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp b/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp index 8e0c2d60ae70..065d7ead82a5 100644 --- a/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp @@ -169,7 +169,7 @@ public: } NS_ENSURE_TRUE(sBtAvrcpInterface, NS_OK); - sBtAvrcpInterface->GetElementAttrRsp(mNumAttr, attrs); + sBtAvrcpInterface->GetElementAttrRsp(mNumAttr, attrs, nullptr); return NS_OK; } @@ -1136,7 +1136,7 @@ BluetoothA2dpManager::UpdateMetaData(const nsAString& aTitle, mTrackChangedNotifyType = BTRC_NOTIFICATION_TYPE_CHANGED; sBtAvrcpInterface->RegisterNotificationRsp(BTRC_EVT_TRACK_CHANGE, BTRC_NOTIFICATION_TYPE_CHANGED, - ¶m); + ¶m, nullptr); if (mPlayPosChangedNotifyType == BTRC_NOTIFICATION_TYPE_INTERIM) { param.song_pos = mPosition; // EVENT_PLAYBACK_POS_CHANGED shall be notified if changed current track @@ -1144,7 +1144,7 @@ BluetoothA2dpManager::UpdateMetaData(const nsAString& aTitle, sBtAvrcpInterface->RegisterNotificationRsp( BTRC_EVT_PLAY_POS_CHANGED, BTRC_NOTIFICATION_TYPE_CHANGED, - ¶m); + ¶m, nullptr); } } @@ -1172,7 +1172,7 @@ BluetoothA2dpManager::UpdatePlayStatus(uint32_t aDuration, NS_ENSURE_TRUE_VOID(sBtAvrcpInterface); // always update playstatus first sBtAvrcpInterface->GetPlayStatusRsp((btrc_play_status_t)aPlayStatus, - aDuration, aPosition); + aDuration, aPosition, nullptr); // when play status changed, send both play status and position if (mPlayStatus != aPlayStatus && mPlayStatusChangedNotifyType == BTRC_NOTIFICATION_TYPE_INTERIM) { @@ -1181,7 +1181,7 @@ BluetoothA2dpManager::UpdatePlayStatus(uint32_t aDuration, mPlayStatusChangedNotifyType = BTRC_NOTIFICATION_TYPE_CHANGED; sBtAvrcpInterface->RegisterNotificationRsp(BTRC_EVT_PLAY_STATUS_CHANGED, BTRC_NOTIFICATION_TYPE_CHANGED, - ¶m); + ¶m, nullptr); } if (mPosition != aPosition && @@ -1191,7 +1191,7 @@ BluetoothA2dpManager::UpdatePlayStatus(uint32_t aDuration, mPlayPosChangedNotifyType = BTRC_NOTIFICATION_TYPE_CHANGED; sBtAvrcpInterface->RegisterNotificationRsp(BTRC_EVT_PLAY_POS_CHANGED, BTRC_NOTIFICATION_TYPE_CHANGED, - ¶m); + ¶m, nullptr); } mDuration = aDuration; @@ -1259,7 +1259,7 @@ BluetoothA2dpManager::UpdateRegisterNotification(int aEventId, int aParam) sBtAvrcpInterface->RegisterNotificationRsp((btrc_event_id_t)aEventId, BTRC_NOTIFICATION_TYPE_INTERIM, - ¶m); + ¶m, nullptr); #endif } diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp index 8042283d4970..574b300c7577 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp @@ -1015,64 +1015,118 @@ BluetoothAvrcpInterface::Cleanup(BluetoothAvrcpResultHandler* aRes) } } -bt_status_t +void BluetoothAvrcpInterface::GetPlayStatusRsp(btrc_play_status_t aPlayStatus, - uint32_t aSongLen, uint32_t aSongPos) + uint32_t aSongLen, uint32_t aSongPos, + BluetoothAvrcpResultHandler* aRes) { - return mInterface->get_play_status_rsp(aPlayStatus, aSongLen, aSongPos); + bt_status_t status = mInterface->get_play_status_rsp(aPlayStatus, aSongLen, + aSongPos); + if (aRes) { + DispatchBluetoothAvrcpResult( + aRes, &BluetoothAvrcpResultHandler::GetPlayStatusRsp, status); + } } -bt_status_t -BluetoothAvrcpInterface::ListPlayerAppAttrRsp(int aNumAttr, - btrc_player_attr_t* aPAttrs) +void +BluetoothAvrcpInterface::ListPlayerAppAttrRsp( + int aNumAttr, btrc_player_attr_t* aPAttrs, + BluetoothAvrcpResultHandler* aRes) { - return mInterface->list_player_app_attr_rsp(aNumAttr, aPAttrs); + bt_status_t status = mInterface->list_player_app_attr_rsp(aNumAttr, aPAttrs); + + if (aRes) { + DispatchBluetoothAvrcpResult( + aRes, &BluetoothAvrcpResultHandler::ListPlayerAppAttrRsp, status); + } } -bt_status_t -BluetoothAvrcpInterface::ListPlayerAppValueRsp(int aNumVal, uint8_t* aPVals) +void +BluetoothAvrcpInterface::ListPlayerAppValueRsp( + int aNumVal, uint8_t* aPVals, BluetoothAvrcpResultHandler* aRes) { - return mInterface->list_player_app_value_rsp(aNumVal, aPVals); + bt_status_t status = mInterface->list_player_app_value_rsp(aNumVal, aPVals); + + if (aRes) { + DispatchBluetoothAvrcpResult( + aRes, &BluetoothAvrcpResultHandler::ListPlayerAppValueRsp, status); + } } -bt_status_t -BluetoothAvrcpInterface::GetPlayerAppValueRsp(btrc_player_settings_t* aPVals) +void +BluetoothAvrcpInterface::GetPlayerAppValueRsp( + btrc_player_settings_t* aPVals, BluetoothAvrcpResultHandler* aRes) { - return mInterface->get_player_app_value_rsp(aPVals); + bt_status_t status = mInterface->get_player_app_value_rsp(aPVals); + + if (aRes) { + DispatchBluetoothAvrcpResult( + aRes, &BluetoothAvrcpResultHandler::GetPlayerAppValueRsp, status); + } } -bt_status_t -BluetoothAvrcpInterface::GetPlayerAppAttrTextRsp(int aNumAttr, - btrc_player_setting_text_t* aPAttrs) +void +BluetoothAvrcpInterface::GetPlayerAppAttrTextRsp( + int aNumAttr, btrc_player_setting_text_t* aPAttrs, + BluetoothAvrcpResultHandler* aRes) { - return mInterface->get_player_app_attr_text_rsp(aNumAttr, aPAttrs); + bt_status_t status = mInterface->get_player_app_attr_text_rsp(aNumAttr, + aPAttrs); + if (aRes) { + DispatchBluetoothAvrcpResult( + aRes, &BluetoothAvrcpResultHandler::GetPlayerAppAttrTextRsp, status); + } } -bt_status_t -BluetoothAvrcpInterface::GetPlayerAppValueTextRsp(int aNumVal, - btrc_player_setting_text_t* aPVals) +void +BluetoothAvrcpInterface::GetPlayerAppValueTextRsp( + int aNumVal, btrc_player_setting_text_t* aPVals, + BluetoothAvrcpResultHandler* aRes) { - return mInterface->get_player_app_value_text_rsp(aNumVal, aPVals); + bt_status_t status = mInterface->get_player_app_value_text_rsp(aNumVal, + aPVals); + if (aRes) { + DispatchBluetoothAvrcpResult( + aRes, &BluetoothAvrcpResultHandler::GetPlayerAppValueTextRsp, status); + } } -bt_status_t -BluetoothAvrcpInterface::GetElementAttrRsp(uint8_t aNumAttr, - btrc_element_attr_val_t* aPAttrs) +void +BluetoothAvrcpInterface::GetElementAttrRsp( + uint8_t aNumAttr, btrc_element_attr_val_t* aPAttrs, + BluetoothAvrcpResultHandler* aRes) { - return mInterface->get_element_attr_rsp(aNumAttr, aPAttrs); + bt_status_t status = mInterface->get_element_attr_rsp(aNumAttr, aPAttrs); + + if (aRes) { + DispatchBluetoothAvrcpResult( + aRes, &BluetoothAvrcpResultHandler::GetElementAttrRsp, status); + } } -bt_status_t -BluetoothAvrcpInterface::SetPlayerAppValueRsp(btrc_status_t aRspStatus) +void +BluetoothAvrcpInterface::SetPlayerAppValueRsp( + btrc_status_t aRspStatus, BluetoothAvrcpResultHandler* aRes) { - return mInterface->set_player_app_value_rsp(aRspStatus); + bt_status_t status = mInterface->set_player_app_value_rsp(aRspStatus); + + if (aRes) { + DispatchBluetoothAvrcpResult( + aRes, &BluetoothAvrcpResultHandler::SetPlayerAppValueRsp, status); + } } -bt_status_t -BluetoothAvrcpInterface::RegisterNotificationRsp(btrc_event_id_t aEventId, - btrc_notification_type_t aType, btrc_register_notification_t* aPParam) +void +BluetoothAvrcpInterface::RegisterNotificationRsp( + btrc_event_id_t aEventId, btrc_notification_type_t aType, + btrc_register_notification_t* aPParam, BluetoothAvrcpResultHandler* aRes) { - return mInterface->register_notification_rsp(aEventId, aType, aPParam); + bt_status_t status = mInterface->register_notification_rsp(aEventId, aType, + aPParam); + if (aRes) { + DispatchBluetoothAvrcpResult( + aRes, &BluetoothAvrcpResultHandler::RegisterNotificationRsp, status); + } } bt_status_t diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.h b/dom/bluetooth2/bluedroid/BluetoothInterface.h index 08c1625a9194..d06593d95ba8 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.h +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.h @@ -268,26 +268,34 @@ public: BluetoothAvrcpResultHandler* aRes); void Cleanup(BluetoothAvrcpResultHandler* aRes); - bt_status_t GetPlayStatusRsp(btrc_play_status_t aPlayStatus, - uint32_t aSongLen, uint32_t aSongPos); + void GetPlayStatusRsp(btrc_play_status_t aPlayStatus, + uint32_t aSongLen, uint32_t aSongPos, + BluetoothAvrcpResultHandler* aRes); - bt_status_t ListPlayerAppAttrRsp(int aNumAttr, btrc_player_attr_t* aPAttrs); - bt_status_t ListPlayerAppValueRsp(int aNumVal, uint8_t* aPVals); + void ListPlayerAppAttrRsp(int aNumAttr, btrc_player_attr_t* aPAttrs, + BluetoothAvrcpResultHandler* aRes); + void ListPlayerAppValueRsp(int aNumVal, uint8_t* aPVals, + BluetoothAvrcpResultHandler* aRes); - bt_status_t GetPlayerAppValueRsp(btrc_player_settings_t* aPVals); - bt_status_t GetPlayerAppAttrTextRsp(int aNumAttr, - btrc_player_setting_text_t* aPAttrs); - bt_status_t GetPlayerAppValueTextRsp(int aNumVal, - btrc_player_setting_text_t* aPVals); + void GetPlayerAppValueRsp(btrc_player_settings_t* aPVals, + BluetoothAvrcpResultHandler* aRes); + void GetPlayerAppAttrTextRsp(int aNumAttr, + btrc_player_setting_text_t* aPAttrs, + BluetoothAvrcpResultHandler* aRes); + void GetPlayerAppValueTextRsp(int aNumVal, + btrc_player_setting_text_t* aPVals, + BluetoothAvrcpResultHandler* aRes); - bt_status_t GetElementAttrRsp(uint8_t aNumAttr, - btrc_element_attr_val_t* aPAttrs); + void GetElementAttrRsp(uint8_t aNumAttr, btrc_element_attr_val_t* aPAttrs, + BluetoothAvrcpResultHandler* aRes); - bt_status_t SetPlayerAppValueRsp(btrc_status_t aRspStatus); + void SetPlayerAppValueRsp(btrc_status_t aRspStatus, + BluetoothAvrcpResultHandler* aRes); - bt_status_t RegisterNotificationRsp(btrc_event_id_t aEventId, - btrc_notification_type_t aType, - btrc_register_notification_t* aPParam); + void RegisterNotificationRsp(btrc_event_id_t aEventId, + btrc_notification_type_t aType, + btrc_register_notification_t* aPParam, + BluetoothAvrcpResultHandler* aRes); bt_status_t SetVolume(uint8_t aVolume); From a4d154c3813f0f2aacfb327e45eac93c05bb34fa Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 28 Jul 2014 09:52:52 +0200 Subject: [PATCH 12/50] Bug 1042691: Asynchronous |BluetoothAvrcpInterface::SetVolume| (under bluetooth2/), r=btian --- dom/bluetooth2/bluedroid/BluetoothInterface.cpp | 14 ++++++++++---- dom/bluetooth2/bluedroid/BluetoothInterface.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp index 574b300c7577..41c62a5d325b 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.cpp @@ -1129,14 +1129,20 @@ BluetoothAvrcpInterface::RegisterNotificationRsp( } } -bt_status_t -BluetoothAvrcpInterface::SetVolume(uint8_t aVolume) +void +BluetoothAvrcpInterface::SetVolume(uint8_t aVolume, + BluetoothAvrcpResultHandler* aRes) { #if ANDROID_VERSION >= 19 - return mInterface->set_volume(aVolume); + bt_status_t status = mInterface->set_volume(aVolume); #else - return BT_STATUS_UNSUPPORTED; + bt_status_t status = BT_STATUS_UNSUPPORTED; #endif + + if (aRes) { + DispatchBluetoothAvrcpResult( + aRes, &BluetoothAvrcpResultHandler::SetVolume, status); + } } #endif // ANDROID_VERSION >= 18 diff --git a/dom/bluetooth2/bluedroid/BluetoothInterface.h b/dom/bluetooth2/bluedroid/BluetoothInterface.h index d06593d95ba8..62d51c19ad5b 100644 --- a/dom/bluetooth2/bluedroid/BluetoothInterface.h +++ b/dom/bluetooth2/bluedroid/BluetoothInterface.h @@ -297,7 +297,7 @@ public: btrc_register_notification_t* aPParam, BluetoothAvrcpResultHandler* aRes); - bt_status_t SetVolume(uint8_t aVolume); + void SetVolume(uint8_t aVolume, BluetoothAvrcpResultHandler* aRes); protected: BluetoothAvrcpInterface(const btrc_interface_t* aInterface); From 06209d0f33636dab8f076b491dba7161d69a575e Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Fri, 25 Jul 2014 15:19:26 +0800 Subject: [PATCH 13/50] Bug 1037359 - when user turned off bt, delay routing to avoid leakage of audio from speaker. r=mwu --- dom/system/gonk/AudioManager.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/dom/system/gonk/AudioManager.cpp b/dom/system/gonk/AudioManager.cpp index 0fcb2b1ac862..a4a2ceead67b 100644 --- a/dom/system/gonk/AudioManager.cpp +++ b/dom/system/gonk/AudioManager.cpp @@ -78,6 +78,7 @@ static int sMaxStreamVolumeTbl[AUDIO_STREAM_CNT] = { static int sHeadsetState; static const int kBtSampleRate = 8000; static bool sSwitchDone = true; +static bool sA2dpSwitchDone = true; namespace mozilla { namespace dom { @@ -196,6 +197,19 @@ static void ProcessDelayedAudioRoute(SwitchState aState) sSwitchDone = true; } +static void ProcessDelayedA2dpRoute(audio_policy_dev_state_t aState, const char *aAddress) +{ + if (sA2dpSwitchDone) + return; + AudioSystem::setDeviceConnectionState(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, + aState, aAddress); + String8 cmd("bluetooth_enabled=false"); + AudioSystem::setParameters(0, cmd); + cmd.setTo("A2dpSuspended=true"); + AudioSystem::setParameters(0, cmd); + sA2dpSwitchDone = true; +} + NS_IMPL_ISUPPORTS(AudioManager, nsIAudioManager, nsIObserver) static void @@ -262,18 +276,18 @@ AudioManager::HandleBluetoothStatusChanged(nsISupports* aSubject, SetForceForUse(nsIAudioManager::USE_COMMUNICATION, nsIAudioManager::FORCE_NONE); } } else if (!strcmp(aTopic, BLUETOOTH_A2DP_STATUS_CHANGED_ID)) { - AudioSystem::setDeviceConnectionState(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, - audioState, aAddress.get()); - if (audioState == AUDIO_POLICY_DEVICE_STATE_AVAILABLE) { + if (audioState == AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE && sA2dpSwitchDone) { + MessageLoop::current()->PostDelayedTask( + FROM_HERE, NewRunnableFunction(&ProcessDelayedA2dpRoute, audioState, aAddress.get()), 1000); + sA2dpSwitchDone = false; + } else { + AudioSystem::setDeviceConnectionState(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, + audioState, aAddress.get()); String8 cmd("bluetooth_enabled=true"); AudioSystem::setParameters(0, cmd); cmd.setTo("A2dpSuspended=false"); AudioSystem::setParameters(0, cmd); - } else { - String8 cmd("bluetooth_enabled=false"); - AudioSystem::setParameters(0, cmd); - cmd.setTo("A2dpSuspended=true"); - AudioSystem::setParameters(0, cmd); + sA2dpSwitchDone = true; } } else if (!strcmp(aTopic, BLUETOOTH_HFP_STATUS_CHANGED_ID)) { AudioSystem::setDeviceConnectionState(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, From d6243797f205c579c0fe8f70a67d130d027f1979 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 01:30:29 -0700 Subject: [PATCH 14/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/4c82568674aa Author: Yuren Ju Desc: Merge pull request #22198 from xfq/jshint-fix Bug 1031997 - Fix jshint error for build/config/gps-prefs.js r=@yurenju ======== https://hg.mozilla.org/integration/gaia-central/rev/2d76183e8bda Author: Xue Fuqiao Desc: Bug 1031997 - Fix jshint error for build/config/gps-prefs.js --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 86d386d22fe4..16d6ef6dbc2b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "667742f9e04c204015f994dcb18833109b8b148e", + "revision": "4c82568674aab2d6459ecd8aa8dbaa93d69ca384", "repo_path": "/integration/gaia-central" } From 58c9b747bee2a444c47a8584b3a98bac44412d46 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 01:36:30 -0700 Subject: [PATCH 15/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index b6948cea7cc6..3eb4df414910 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index d9f044b79cc1..cc9ca9aa180e 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 777f81d416e9..da1f5dab571c 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index b6948cea7cc6..3eb4df414910 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 0e9e077da5a4..ec725dfee776 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 48d353b49e1c..7c6104bd4fe5 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 36e041d2dece..9053d77c8bee 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 4ecf8be63313..e3753b7e320f 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index d687b0af205b..3bfcdb7e253e 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From c83ef0322a6fe3a4375ed08551a6c97c4eb3ca76 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 02:00:27 -0700 Subject: [PATCH 16/50] Bumping gaia.json for 1 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/08e99af57637 Author: Salvador de la Puente Desc: Revert "Merge pull request #21998 from lodr/bug-1034735-installing-when-low-battery" This reverts commit dd8d9ad3e6ad7a0ed778353a745eda4cae44fcb4, reversing changes made to 2cd08bafae2745a272594638e36ef87d47c75cb4. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 16d6ef6dbc2b..4df9b15ccceb 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "4c82568674aab2d6459ecd8aa8dbaa93d69ca384", + "revision": "08e99af57637d579150ec44708cebc40a4f6b05d", "repo_path": "/integration/gaia-central" } From 30f25efaf94f4b14e845359881e3909fa0c48493 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 02:01:57 -0700 Subject: [PATCH 17/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 3eb4df414910..33ff9636ec8b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index cc9ca9aa180e..c14f33e90e90 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index da1f5dab571c..81f85394c237 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 3eb4df414910..33ff9636ec8b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index ec725dfee776..e61bb79178cb 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 7c6104bd4fe5..82c5349dd656 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 9053d77c8bee..95385a1b1a7a 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e3753b7e320f..13174b254c40 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 3bfcdb7e253e..9a8df8e7a679 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 1b760bf3740cb9cca7eb7a1eb62526a51a2c504a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 02:55:26 -0700 Subject: [PATCH 18/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/c9d200d52584 Author: viorelaioia Desc: Merge pull request #22173 from bebef1987/clean Bug 1044019 - Add /storage/sdcard to cleanup_storage in gaia test ======== https://hg.mozilla.org/integration/gaia-central/rev/51060ed4e1c3 Author: Bebe Desc: Bug 1044019 - Add /storage/sdcard to cleanup_storage in gaia test --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 4df9b15ccceb..0e21ee202b56 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "08e99af57637d579150ec44708cebc40a4f6b05d", + "revision": "c9d200d52584c4e0b64c439227a7c58092019734", "repo_path": "/integration/gaia-central" } From 17637b8364419d65ed7574f81904c667b4cfdc06 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 03:01:40 -0700 Subject: [PATCH 19/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 33ff9636ec8b..4ce904ab2fbf 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index c14f33e90e90..146c098440df 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 81f85394c237..b0b466a662ed 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 33ff9636ec8b..4ce904ab2fbf 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index e61bb79178cb..c8aff9cc9eba 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 82c5349dd656..c8e0f54f72d8 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 95385a1b1a7a..014e4c048c9e 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 13174b254c40..3bfa6d5271b3 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 9a8df8e7a679..a08bd2c20ea4 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From b1a65698cf394246f8141db00ae60af2db289763 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 03:10:25 -0700 Subject: [PATCH 20/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/1cd03cacf9f7 Author: viorelaioia Desc: Merge pull request #22080 from bebef1987/persona Bug 1036867 - Make persona_test_user fail more nicely if it can't get a ... ======== https://hg.mozilla.org/integration/gaia-central/rev/e14ac4c75210 Author: Bebe Desc: Bug 1036867 - Make persona_test_user fail more nicely if it can't get a user --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 0e21ee202b56..36bc1fb40860 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "c9d200d52584c4e0b64c439227a7c58092019734", + "revision": "1cd03cacf9f793d1997c5f32fe25d8b25dc1e379", "repo_path": "/integration/gaia-central" } From aef514964a87ece45c2e61a5e7a7400e3700fb61 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 03:16:44 -0700 Subject: [PATCH 21/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 4ce904ab2fbf..80ec892dd3e8 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 146c098440df..bea038bff4dd 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index b0b466a662ed..320f91739a00 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 4ce904ab2fbf..80ec892dd3e8 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index c8aff9cc9eba..8932d73c936b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index c8e0f54f72d8..fb3ea1fa6526 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 014e4c048c9e..ede2e148b57f 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 3bfa6d5271b3..e59b764739fa 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index a08bd2c20ea4..a932e82a0e17 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 3c08fb75c9cdd7a352771ead458ed2d619a99911 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 03:40:24 -0700 Subject: [PATCH 22/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/407ca0cf5960 Author: punamdahiya Desc: Merge pull request #22161 from ranjithgithub/1039988_ShareButtonNotWorking Bug-1039988 - [Gallery] Fix of share button in fullscreen mode for images that needs EXIF to display correctly r=pdahiya ======== https://hg.mozilla.org/integration/gaia-central/rev/6c0110252eed Author: ranjith.gutha Desc: Bug-1039988 Fixing Javascript error while pressing share button in full screen mode --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 36bc1fb40860..0305188123c1 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "1cd03cacf9f793d1997c5f32fe25d8b25dc1e379", + "revision": "407ca0cf5960a1911e189fed54ae12829f82fcdc", "repo_path": "/integration/gaia-central" } From d2fa61e938c342bacdc0673b9430750744e7290b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 03:41:44 -0700 Subject: [PATCH 23/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 80ec892dd3e8..d52439cbd2dd 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index bea038bff4dd..1f3bb6cb5ace 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 320f91739a00..a3225c7db305 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 80ec892dd3e8..d52439cbd2dd 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 8932d73c936b..7afb17ecbf79 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index fb3ea1fa6526..b5b2e5d4ab7e 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index ede2e148b57f..5f1779ed05a9 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e59b764739fa..45dab40c2b10 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index a932e82a0e17..d288600d7593 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 2d4b6cee10ce2056f8fff9de634072c97cf784da Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 05:20:31 -0700 Subject: [PATCH 24/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/ae10a86027a2 Author: viorelaioia Desc: Merge pull request #22211 from bebef1987/xfail_video Bug 1045001 - Xfail Video recording tests because Bug 1044317 ======== https://hg.mozilla.org/integration/gaia-central/rev/56e49b647ce2 Author: Bebe Desc: Bug 1045001 - Xfail Video recording tests because Bug 1044317 --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 0305188123c1..4026b01403ac 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "407ca0cf5960a1911e189fed54ae12829f82fcdc", + "revision": "ae10a86027a2b1ac5142d15ba7dd4272cd6baf80", "repo_path": "/integration/gaia-central" } From 7947ef70e77a3df95adbb3db1d0e7f7ebac5ec6c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 05:26:16 -0700 Subject: [PATCH 25/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index d52439cbd2dd..4c0c9a637eb4 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 1f3bb6cb5ace..4ec824ace160 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index a3225c7db305..23315f1619c9 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index d52439cbd2dd..4c0c9a637eb4 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 7afb17ecbf79..62a263e38858 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index b5b2e5d4ab7e..3dc252ad6033 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 5f1779ed05a9..fc44e07b579d 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 45dab40c2b10..aac8769f3191 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index d288600d7593..e1c1a0b3e351 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From f2b8a5747139cc565e568fb1212eefac3edec8b6 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 05:45:35 -0700 Subject: [PATCH 26/50] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ======== https://hg.mozilla.org/integration/gaia-central/rev/e1dc6aae8ae2 Author: Fernando Jiménez Moreno Desc: Merge pull request #22084 from ferjm/bug1037662.fxa.systemdialog Bug 1037662 - Grant Firefox Accounts (FxA) access to web payment provide... ======== https://hg.mozilla.org/integration/gaia-central/rev/ca3c3ee96e80 Author: Fernando Jiménez Desc: Bug 1037662 - Grant Firefox Accounts (FxA) access to web payment providers. r=alive ======== https://hg.mozilla.org/integration/gaia-central/rev/d0abe585af6a Author: vingtetun <21@vingtetun.org> Desc: Merge pull request #22212 from vingtetun/container-no-failures Bug 1042744 - Add a container around app window iframe. r=alive ======== https://hg.mozilla.org/integration/gaia-central/rev/4509084a3083 Author: Vivien Nicolas Desc: Bug 1042744 - Add a container around app window iframe. r=alive --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 4026b01403ac..0d17e4510b1d 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "ae10a86027a2b1ac5142d15ba7dd4272cd6baf80", + "revision": "e1dc6aae8ae2b4ca14fc471944a7e0a40bf32281", "repo_path": "/integration/gaia-central" } From 6a857f747e14511c7a0fd2cba095ee3c75b9e7e0 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 05:47:03 -0700 Subject: [PATCH 27/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 4c0c9a637eb4..5f8a8f82953c 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 4ec824ace160..3f6258672774 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 23315f1619c9..5d6c0acc3d5d 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 4c0c9a637eb4..5f8a8f82953c 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 62a263e38858..573d2e3d3328 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 3dc252ad6033..54af4bc5e23e 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index fc44e07b579d..5ad5b0f40aeb 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index aac8769f3191..9d3650a68994 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index e1c1a0b3e351..a4293cead3e9 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 77f1822dfe0fda675c74ababf71ce9b817ed5ecf Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 06:21:58 -0700 Subject: [PATCH 28/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 5f8a8f82953c..d45ee8bdf549 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -25,7 +25,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 3f6258672774..40dc753a2fb5 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 5d6c0acc3d5d..bef0b7af9a03 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -23,7 +23,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 5f8a8f82953c..d45ee8bdf549 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -25,7 +25,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 573d2e3d3328..bac4972de73b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 54af4bc5e23e..d7bef6f8178b 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -22,7 +22,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 9d3650a68994..a980fb76ea09 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index a4293cead3e9..ddbe22754830 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -22,7 +22,7 @@ - + From c74478cec2a081f362cb3b90fea546722644ca6b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 06:30:32 -0700 Subject: [PATCH 29/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/480f4b58108b Author: Fernando Campo Desc: Merge pull request #21875 from empoalp/bug-995938 Bug 995938 - Device does not play an 'end tone' when the call is finished (r=etienne) ======== https://hg.mozilla.org/integration/gaia-central/rev/35f7a7e5d36b Author: David Garcia Desc: Bug 995938 - Device does not play an 'end tone' when the call is finished --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 0d17e4510b1d..9cffc1a38e63 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "e1dc6aae8ae2b4ca14fc471944a7e0a40bf32281", + "revision": "480f4b58108b376482640e6581a356bce38c41b7", "repo_path": "/integration/gaia-central" } From 99a89a4b113baeae78e12553918280d14a072b94 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 06:36:18 -0700 Subject: [PATCH 30/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index d45ee8bdf549..bffec6a4110f 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 40dc753a2fb5..36c976c29c16 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index bef0b7af9a03..f1fb821ba0ed 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index d45ee8bdf549..bffec6a4110f 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index bac4972de73b..aae5922a72a6 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index d7bef6f8178b..88dc13a50420 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 5ad5b0f40aeb..bf301aeaf9ff 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index a980fb76ea09..d316f57abbd4 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index ddbe22754830..099e91ffb808 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From f4fbf955eb469b2acca5f890f6487de3e165a814 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 07:25:31 -0700 Subject: [PATCH 31/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/6a6db1dac429 Author: Carsten Book Desc: Merge pull request #21414 from mdotoum/clock-issue-964036 Bug 964036 - (gaia-rtl) Support RTL for Clock App r=nefzaoui ======== https://hg.mozilla.org/integration/gaia-central/rev/580239bc1c99 Author: MD Otoum Desc: Bug 964036 - (gaia-rtl) Support RTL for Clock App r=nefzaoui --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 9cffc1a38e63..88dc7785c463 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "480f4b58108b376482640e6581a356bce38c41b7", + "revision": "6a6db1dac429f932a52b28073c09502d9ee96b57", "repo_path": "/integration/gaia-central" } From f99389af0cdd3a02b6d37c16b032ccbd1abf62fc Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 07:31:16 -0700 Subject: [PATCH 32/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index bffec6a4110f..5636371e9517 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 36c976c29c16..1f6711d59493 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index f1fb821ba0ed..087a2e8cc581 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index bffec6a4110f..5636371e9517 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index aae5922a72a6..4084dbec3b03 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 88dc13a50420..3137d9a2246f 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index bf301aeaf9ff..84ad7cfeaedc 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index d316f57abbd4..fd52c2d84ecc 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 099e91ffb808..28d9fa26dbf3 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From cf2465d3749fb1536aa339cb624198bafdf7925e Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 08:10:28 -0700 Subject: [PATCH 33/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ======== https://hg.mozilla.org/integration/gaia-central/rev/3c5ae69f1d72 Author: Salvador de la Puente González Desc: Merge pull request #22205 from lodr/bug-1034735-installing-when-low-battery Bug 1034735 - [System][OTA] When the device is plugged-in, it should not block OTA even the energy is lower than 50% r=etienne ======== https://hg.mozilla.org/integration/gaia-central/rev/98dbf45597a7 Author: Salvador de la Puente Desc: Bug 1034735 - [System][OTA] When the device is plugged-in, it should not block OTA even the energy is lower than 50% --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 88dc7785c463..1365929d29cf 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "6a6db1dac429f932a52b28073c09502d9ee96b57", + "revision": "3c5ae69f1d7209a26f7540c92a456a30a077dae1", "repo_path": "/integration/gaia-central" } From 86117636e6f8812d5154450953e2886453077467 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 08:12:30 -0700 Subject: [PATCH 34/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 5636371e9517..8a8a9e9decf0 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 1f6711d59493..3bceb022fee0 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 087a2e8cc581..be6e0a55b9fb 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 5636371e9517..8a8a9e9decf0 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 4084dbec3b03..6840a021d55d 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 3137d9a2246f..ca4e825b31f0 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 84ad7cfeaedc..9c845961fd1e 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index fd52c2d84ecc..9f2cc6ae0430 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 28d9fa26dbf3..fb514291bdd8 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 113d3361d1fde572bf3a1b34a82168906f805a15 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 08:25:31 -0700 Subject: [PATCH 35/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/d6a0f6acfa82 Author: vingtetun <21@vingtetun.org> Desc: Merge pull request #22218 from vingtetun/chromebar-additional2 Bug 1044423 - Add more logics to AppChrome.js. r=etienne ======== https://hg.mozilla.org/integration/gaia-central/rev/eeb437204a33 Author: Vivien Nicolas Desc: Bug 1044423 - Add more logics to AppChrome.js. r=etienne --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 1365929d29cf..8d6d63c85c17 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "3c5ae69f1d7209a26f7540c92a456a30a077dae1", + "revision": "d6a0f6acfa82447b47747042de9aadef7dc56f81", "repo_path": "/integration/gaia-central" } From 5944fa0b69601895fef4e96b54d1fbbca671b333 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 08:27:33 -0700 Subject: [PATCH 36/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 8a8a9e9decf0..787874abeb20 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 3bceb022fee0..8eb9a242735e 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index be6e0a55b9fb..68f654efbdf4 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 8a8a9e9decf0..787874abeb20 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 6840a021d55d..fe0943a5f04e 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index ca4e825b31f0..104cafd1282f 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 9c845961fd1e..8191c5be7033 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 9f2cc6ae0430..ceacc407b87c 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index fb514291bdd8..d6ad09adc870 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 803f8da8e426f6d4828fb7624aaac37f450646ba Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 08:40:23 -0700 Subject: [PATCH 37/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/93b6be5e33f6 Author: Jose Antonio Olivera Ortega Desc: Merge pull request #22003 from jaoo/1038749 Bug 1038749 - [B2G][Audio Channel]After playing sound through front speaker, all sound will play through front speaker instead of speakerphone. r=etienne ======== https://hg.mozilla.org/integration/gaia-central/rev/86c6a4d5f462 Author: Jose Antonio Olivera Ortega Desc: Bug 1038749 - [B2G][Audio Channel]After playing sound through front speaker, all sound will play through front speaker instead of speakerphone --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 8d6d63c85c17..94d42a3904da 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "d6a0f6acfa82447b47747042de9aadef7dc56f81", + "revision": "93b6be5e33f66a6c949bba3d3ee291f0078831ee", "repo_path": "/integration/gaia-central" } From 074ada332174d20fbc49dbe85571716a313490b0 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 08:47:49 -0700 Subject: [PATCH 38/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 787874abeb20..3ec7c0a66fe1 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 8eb9a242735e..2ba9978ae052 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 68f654efbdf4..06e247ad380c 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 787874abeb20..3ec7c0a66fe1 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index fe0943a5f04e..5dd965c9dcfd 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 104cafd1282f..623f55f59f40 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 8191c5be7033..77028bf33842 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index ceacc407b87c..432e7364fb5d 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index d6ad09adc870..109cb842106a 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From ca7c3a2c996eed6cb905af76b3b217fe40b48f3f Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 09:05:27 -0700 Subject: [PATCH 39/50] Bumping gaia.json for 1 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/3669bf08c4a5 Author: Gabriele Svelto Desc: Bug 1045023 - Ensure that the GaiaGrid component is loaded before it is used r=kgrandon --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 94d42a3904da..dc96dc4cc59b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "93b6be5e33f66a6c949bba3d3ee291f0078831ee", + "revision": "3669bf08c4a5553583d7adca3603e5a527e84b00", "repo_path": "/integration/gaia-central" } From cfa46e559978c0f6dc54077be3126ca38641400d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 09:12:45 -0700 Subject: [PATCH 40/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 3ec7c0a66fe1..8c38caf8e15c 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 2ba9978ae052..72f0fb197738 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 06e247ad380c..d58093a41ff9 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 3ec7c0a66fe1..8c38caf8e15c 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 5dd965c9dcfd..cfd9108000a0 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 623f55f59f40..baa29b51d164 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 77028bf33842..bfcddb1bdb53 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 432e7364fb5d..5f491b5662e5 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 109cb842106a..e41edcd4d367 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From f94380ecb7e4312958c44ea14c30b74fd3602289 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 10:05:29 -0700 Subject: [PATCH 41/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/2ff8b89f2004 Author: Gareth Aye Desc: Merge pull request #22092 from millermedeiros/1042422-refresh-disabled Bug 1042422 - [B2G][Calendar] Refreshing calendar causes events to be pu.lled down for accounts that are disabled r=gaye ======== https://hg.mozilla.org/integration/gaia-central/rev/4e684365da93 Author: Miller Medeiros Desc: Bug 1042422 - [B2G][Calendar] Refreshing calendar causes events to be pulled down for accounts that are disabled --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index dc96dc4cc59b..e63fce8c5917 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "3669bf08c4a5553583d7adca3603e5a527e84b00", + "revision": "2ff8b89f2004e186fa12ffc8c8a88ccad798621e", "repo_path": "/integration/gaia-central" } From 9d07349c946315673dc5be36186631c3c7cfe08c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 10:11:24 -0700 Subject: [PATCH 42/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 8c38caf8e15c..0666c44fa4ee 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 72f0fb197738..e7a154e14b5a 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index d58093a41ff9..7d9e261ed43c 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 8c38caf8e15c..0666c44fa4ee 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index cfd9108000a0..68eb657d37fa 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index baa29b51d164..0292a75cd179 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index bfcddb1bdb53..44cda8aa5896 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 5f491b5662e5..e7f9448ee894 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index e41edcd4d367..2dfcaeed77e3 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 23fb8180d58b5c0de6ddc0e6bde0c5110b3c0bc6 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 10:20:34 -0700 Subject: [PATCH 43/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/4d2fb3417053 Author: Marcus Cavanaugh Desc: Merge pull request #22186 from mcav/improved-retry-logic Bug 1042190 - [Email] Improve IMAP retry logic. r=asuth ======== https://hg.mozilla.org/integration/gaia-central/rev/3e7cbc4734dc Author: Marcus Cavanaugh Desc: Bug 1042190 - [Email] Improve IMAP retry logic. r=asuth --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index e63fce8c5917..6a35905627e2 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "2ff8b89f2004e186fa12ffc8c8a88ccad798621e", + "revision": "4d2fb3417053d34221fe0e6bf9c03dd3bdcfca47", "repo_path": "/integration/gaia-central" } From 66028856581c9b24036c2aad4a1c54b97882014e Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 10:26:36 -0700 Subject: [PATCH 44/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 0666c44fa4ee..550375dc6e1b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index e7a154e14b5a..542388650228 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 7d9e261ed43c..b901685a9153 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 0666c44fa4ee..550375dc6e1b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 68eb657d37fa..7fa5ae6b32da 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 0292a75cd179..c3eb66fb09d8 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 44cda8aa5896..a0eebd6d8de5 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e7f9448ee894..cf7d8fa08029 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 2dfcaeed77e3..59af26deb3cd 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 6e24fb6bcf3318b76fb9504842d0979f3fa6c8b1 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 10:35:33 -0700 Subject: [PATCH 45/50] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/9863517bfb59 Author: Marcus Cavanaugh Desc: Merge pull request #22187 from mcav/kill-unused-connections Bug 1042197 - [Email] Close IMAP connections. r=asuth ======== https://hg.mozilla.org/integration/gaia-central/rev/1ccba738ea37 Author: Marcus Cavanaugh Desc: Bug 1042197 - [Email] Close IMAP connections. r=asuth --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 6a35905627e2..c4a2d8fb1f13 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "4d2fb3417053d34221fe0e6bf9c03dd3bdcfca47", + "revision": "9863517bfb599a39300f5e8c6f94e16189a4c698", "repo_path": "/integration/gaia-central" } From ed41562209a3c3b7e08157db7666cafa2866e491 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 28 Jul 2014 10:41:21 -0700 Subject: [PATCH 46/50] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 550375dc6e1b..b59270f9f6f6 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 542388650228..32cadc48cc49 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index b901685a9153..b80c7855c0ca 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 550375dc6e1b..b59270f9f6f6 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 7fa5ae6b32da..308fcfce7062 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index c3eb66fb09d8..1c1d5187dd58 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index a0eebd6d8de5..dadd9218c814 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index cf7d8fa08029..508c0ad0a25a 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 59af26deb3cd..30b644a27e90 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 06c91b453ad085481844d53b343414dfe522a3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Mon, 28 Jul 2014 11:06:00 -0700 Subject: [PATCH 47/50] Bug 1037662 - Grant Firefox Accounts (FxA) access to web payment providers r=ferjm --- dom/payment/Payment.jsm | 30 +++++++++++++++++++++++++++++- dom/payment/moz.build | 2 +- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/dom/payment/Payment.jsm b/dom/payment/Payment.jsm index d9e981e4c0bd..1a0d519d9f22 100644 --- a/dom/payment/Payment.jsm +++ b/dom/payment/Payment.jsm @@ -198,6 +198,18 @@ let PaymentManager = { } } +#ifdef MOZ_B2G + let appsService = Cc["@mozilla.org/AppsService;1"] + .getService(Ci.nsIAppsService); + let systemAppId = Ci.nsIScriptSecurityManager.NO_APP_ID; + + try { + let manifestURL = Services.prefs.getCharPref("b2g.system_manifest_url"); + systemAppId = appsService.getAppLocalIdByManifestURL(manifestURL); + this.LOG("System app id=" + systemAppId); + } catch(e) {} +#endif + // Now register the payment providers. for (let i in nums) { let branch = prefService @@ -211,12 +223,28 @@ let PaymentManager = { if (type in this.registeredProviders) { continue; } - this.registeredProviders[type] = { + let provider = this.registeredProviders[type] = { name: branch.getCharPref("name"), uri: branch.getCharPref("uri"), description: branch.getCharPref("description"), requestMethod: branch.getCharPref("requestMethod") }; + +#ifdef MOZ_B2G + // Let this payment provider access the firefox-accounts API when + // it's loaded in the trusted UI. + if (systemAppId != Ci.nsIScriptSecurityManager.NO_APP_ID) { + this.LOG("Granting firefox-accounts permission to " + provider.uri); + let uri = Services.io.newURI(provider.uri, null, null); + let principal = Services.scriptSecurityManager + .getAppCodebasePrincipal(uri, systemAppId, true); + + Services.perms.addFromPrincipal(principal, "firefox-accounts", + Ci.nsIPermissionManager.ALLOW_ACTION, + Ci.nsIPermissionManager.EXPIRE_SESSION); + } +#endif + if (this._debug) { this.LOG("Registered Payment Providers: " + JSON.stringify(this.registeredProviders[type])); diff --git a/dom/payment/moz.build b/dom/payment/moz.build index c697d97fc0d7..82399c403c04 100644 --- a/dom/payment/moz.build +++ b/dom/payment/moz.build @@ -6,7 +6,7 @@ PARALLEL_DIRS += ['interfaces'] -EXTRA_JS_MODULES += [ +EXTRA_PP_JS_MODULES += [ 'Payment.jsm', ] From 58d84e4782080699433e8d776f58a807c07f5aaa Mon Sep 17 00:00:00 2001 From: Sam Foster Date: Mon, 28 Jul 2014 11:13:10 -0700 Subject: [PATCH 48/50] Bug 1040146 - Copy existing deviceinfo.os into previous_os when populating settings. r=fabrice --- b2g/chrome/content/settings.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/b2g/chrome/content/settings.js b/b2g/chrome/content/settings.js index 27916c53bcf8..98847326d3ef 100644 --- a/b2g/chrome/content/settings.js +++ b/b2g/chrome/content/settings.js @@ -155,17 +155,25 @@ Components.utils.import('resource://gre/modules/ctypes.jsm'); product_model = libcutils.property_get('ro.product.model'); #endif - let software = os_name + ' ' + os_version; - let setting = { - 'deviceinfo.os': os_version, - 'deviceinfo.software': software, - 'deviceinfo.platform_version': appInfo.platformVersion, - 'deviceinfo.platform_build_id': appInfo.platformBuildID, - 'deviceinfo.hardware': hardware_info, - 'deviceinfo.firmware_revision': firmware_revision, - 'deviceinfo.product_model': product_model + // Populate deviceinfo settings, + // copying any existing deviceinfo.os into deviceinfo.previous_os + let lock = window.navigator.mozSettings.createLock(); + let req = lock.get('deviceinfo.os'); + req.onsuccess = req.onerror = () => { + let previous_os = req.result && req.result['deviceinfo.os'] || ''; + let software = os_name + ' ' + os_version; + let setting = { + 'deviceinfo.os': os_version, + 'deviceinfo.previous_os': previous_os, + 'deviceinfo.software': software, + 'deviceinfo.platform_version': appInfo.platformVersion, + 'deviceinfo.platform_build_id': appInfo.platformBuildID, + 'deviceinfo.hardware': hardware_info, + 'deviceinfo.firmware_revision': firmware_revision, + 'deviceinfo.product_model': product_model + } + lock.set(setting); } - window.navigator.mozSettings.createLock().set(setting); })(); // =================== DevTools ==================== From 5183c902b62eb9b3b418fd2adf7a818442f42ff7 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Mon, 28 Jul 2014 14:47:46 -0400 Subject: [PATCH 49/50] Backed out changeset a04107c24084 (bug 1037662) for Windows B2G bustage. CLOSED TREE --- dom/payment/Payment.jsm | 30 +----------------------------- dom/payment/moz.build | 2 +- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/dom/payment/Payment.jsm b/dom/payment/Payment.jsm index 1a0d519d9f22..d9e981e4c0bd 100644 --- a/dom/payment/Payment.jsm +++ b/dom/payment/Payment.jsm @@ -198,18 +198,6 @@ let PaymentManager = { } } -#ifdef MOZ_B2G - let appsService = Cc["@mozilla.org/AppsService;1"] - .getService(Ci.nsIAppsService); - let systemAppId = Ci.nsIScriptSecurityManager.NO_APP_ID; - - try { - let manifestURL = Services.prefs.getCharPref("b2g.system_manifest_url"); - systemAppId = appsService.getAppLocalIdByManifestURL(manifestURL); - this.LOG("System app id=" + systemAppId); - } catch(e) {} -#endif - // Now register the payment providers. for (let i in nums) { let branch = prefService @@ -223,28 +211,12 @@ let PaymentManager = { if (type in this.registeredProviders) { continue; } - let provider = this.registeredProviders[type] = { + this.registeredProviders[type] = { name: branch.getCharPref("name"), uri: branch.getCharPref("uri"), description: branch.getCharPref("description"), requestMethod: branch.getCharPref("requestMethod") }; - -#ifdef MOZ_B2G - // Let this payment provider access the firefox-accounts API when - // it's loaded in the trusted UI. - if (systemAppId != Ci.nsIScriptSecurityManager.NO_APP_ID) { - this.LOG("Granting firefox-accounts permission to " + provider.uri); - let uri = Services.io.newURI(provider.uri, null, null); - let principal = Services.scriptSecurityManager - .getAppCodebasePrincipal(uri, systemAppId, true); - - Services.perms.addFromPrincipal(principal, "firefox-accounts", - Ci.nsIPermissionManager.ALLOW_ACTION, - Ci.nsIPermissionManager.EXPIRE_SESSION); - } -#endif - if (this._debug) { this.LOG("Registered Payment Providers: " + JSON.stringify(this.registeredProviders[type])); diff --git a/dom/payment/moz.build b/dom/payment/moz.build index 82399c403c04..c697d97fc0d7 100644 --- a/dom/payment/moz.build +++ b/dom/payment/moz.build @@ -6,7 +6,7 @@ PARALLEL_DIRS += ['interfaces'] -EXTRA_PP_JS_MODULES += [ +EXTRA_JS_MODULES += [ 'Payment.jsm', ] From 39f2cb9cf83cf0a41f6e39c20509c4a7fe6954d9 Mon Sep 17 00:00:00 2001 From: Chris Manchester Date: Mon, 28 Jul 2014 19:51:55 -0400 Subject: [PATCH 50/50] Bug 1045255 - Add back global logging setup removed in bug 886570 needed for leak logging on a CLOSED TREE.;r=gps --- testing/mochitest/runtests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index cd2d1f64c361..7c963ff9b59d 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -47,6 +47,18 @@ from mozlog.structured.structuredlog import StructuredLogger # not yet present in the mozharness environment from mozrunner.utils import findInPath as which + +# Necessary to set up the global logger in automationutils.py +import logging +log = logging.getLogger() +def resetGlobalLog(): + while log.handlers: + log.removeHandler(log.handlers[0]) + handler = logging.StreamHandler(sys.stdout) + log.setLevel(logging.INFO) + log.addHandler(handler) +resetGlobalLog() + ########################### # Option for NSPR logging # ###########################