Skip to content

Commit 1cf4af9

Browse files
author
Marian-Vasile Laza
committed
Backed out 7 changesets (bug 1546154) for causing build bustages on ContentProcess.cpp. CLOSED TREE
Backed out changeset 0bd777eee249 (bug 1546154) Backed out changeset 611812ee62a2 (bug 1546154) Backed out changeset cef0aa18a3ab (bug 1546154) Backed out changeset cfda47fb0a46 (bug 1546154) Backed out changeset f3e005f5fedc (bug 1546154) Backed out changeset 7f50fca0c2cd (bug 1546154) Backed out changeset bbb0b25450f5 (bug 1546154)
1 parent a8a8259 commit 1cf4af9

File tree

24 files changed

+144
-193
lines changed

24 files changed

+144
-193
lines changed

browser/app/winlauncher/moz.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Library("winlauncher")
99
FORCE_STATIC_LIB = True
1010

1111
UNIFIED_SOURCES += [
12-
"/ipc/mscom/COMWrappers.cpp",
1312
"/ipc/mscom/ProcessRuntime.cpp",
1413
"/toolkit/xre/WinTokenUtils.cpp",
1514
"/widget/windows/WindowsConsole.cpp",

dom/ipc/ContentProcess.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#if (defined(XP_WIN) || defined(XP_MACOSX)) && defined(MOZ_SANDBOX)
1919
# include "mozilla/SandboxSettings.h"
20-
# include "mozilla/WindowsProcessMitigations.h"
2120
# include "nsAppDirectoryServiceDefs.h"
2221
# include "nsDirectoryService.h"
2322
# include "nsDirectoryServiceDefs.h"
@@ -54,9 +53,8 @@ static void SetUpSandboxEnvironment() {
5453
"SetUpSandboxEnvironment relies on nsDirectoryService being initialized");
5554

5655
// On Windows, a sandbox-writable temp directory is used whenever the sandbox
57-
// is enabled, except when win32k is locked down when we no longer require a
58-
// temp directory.
59-
if (!IsContentSandboxEnabled() || IsWin32kLockedDown()) {
56+
// is enabled.
57+
if (!IsContentSandboxEnabled()) {
6058
return;
6159
}
6260

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2+
/* vim:set ts=2 sw=2 sts=2 et cindent: */
3+
/* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6+
7+
#include "ThreadPoolCOMListener.h"
8+
9+
namespace mozilla {
10+
11+
NS_IMPL_ISUPPORTS(MSCOMInitThreadPoolListener, nsIThreadPoolListener)
12+
13+
NS_IMETHODIMP
14+
MSCOMInitThreadPoolListener::OnThreadCreated() {
15+
HRESULT hr = CoInitializeEx(0, COINIT_MULTITHREADED);
16+
if (FAILED(hr)) {
17+
NS_WARNING("Failed to initialize MSCOM on decoder thread.");
18+
}
19+
return NS_OK;
20+
}
21+
22+
NS_IMETHODIMP
23+
MSCOMInitThreadPoolListener::OnThreadShuttingDown() {
24+
CoUninitialize();
25+
return NS_OK;
26+
}
27+
28+
} // namespace mozilla

dom/media/ThreadPoolCOMListener.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2+
/* vim:set ts=2 sw=2 sts=2 et cindent: */
3+
/* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6+
7+
#ifndef MSCOMInitThreadPoolListener_h_
8+
#define MSCOMInitThreadPoolListener_h_
9+
10+
#include "nsIThreadPool.h"
11+
#include <objbase.h>
12+
13+
namespace mozilla {
14+
15+
// Thread pool listener which ensures that MSCOM is initialized and
16+
// deinitialized on the thread pool thread. We may call into WMF on this thread,
17+
// so we need MSCOM working.
18+
class MSCOMInitThreadPoolListener final : public nsIThreadPoolListener {
19+
~MSCOMInitThreadPoolListener() {}
20+
21+
public:
22+
NS_DECL_THREADSAFE_ISUPPORTS
23+
NS_DECL_NSITHREADPOOLLISTENER
24+
};
25+
26+
} // namespace mozilla
27+
28+
#endif // MSCOMInitThreadPoolListener_h_

dom/media/gmp-plugin-openh264/moz.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ SOURCES += [
1818

1919
SharedLibrary("fakeopenh264")
2020

21+
if CONFIG["OS_ARCH"] == "WINNT":
22+
OS_LIBS += [
23+
"ole32",
24+
]
25+
2126
USE_STATIC_LIBS = True
2227
NoVisibilityFlags()
2328
# Don't use STL wrappers; this isn't Gecko code

dom/media/gmp/GMPChild.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ mozilla::ipc::IPCResult GMPChild::RecvPreloadLibs(const nsCString& aLibs) {
209209
// MFCreateMediaType
210210
u"msmpeg2vdec.dll", // H.264 decoder
211211
u"nss3.dll", // NSS for clearkey CDM
212-
u"ole32.dll", // required for OPM
213212
u"psapi.dll", // For GetMappedFileNameW, see bug 1383611
214213
u"softokn3.dll", // NSS for clearkey CDM
215214
};

dom/media/gmp/GMPParent.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,13 +862,13 @@ RefPtr<GenericPromise> GMPParent::ParseChromiumManifest(
862862
#if XP_WIN
863863
// psapi.dll added for GetMappedFileNameW, which could possibly be avoided
864864
// in future versions, see bug 1383611 for details.
865-
mLibs = "dxva2.dll, ole32.dll, psapi.dll"_ns;
865+
mLibs = "dxva2.dll, psapi.dll"_ns;
866866
#endif
867867
} else if (mDisplayName.EqualsASCII("fake")) {
868868
// The fake CDM just exposes a key system with id "fake".
869869
video.mAPITags.AppendElement(nsCString{"fake"});
870870
#if XP_WIN
871-
mLibs = "dxva2.dll, ole32.dll"_ns;
871+
mLibs = "dxva2.dll"_ns;
872872
#endif
873873
} else {
874874
GMP_PARENT_LOG_DEBUG("%s: Unrecognized key system: %s, failing.",

dom/media/moz.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ EXPORTS += [
181181
"SeekTarget.h",
182182
"SelfRef.h",
183183
"SharedBuffer.h",
184+
"ThreadPoolCOMListener.h",
184185
"TimeUnits.h",
185186
"Tracing.h",
186187
"VideoFrameContainer.h",
@@ -303,6 +304,11 @@ if CONFIG["OS_TARGET"] == "Linux":
303304
else:
304305
UNIFIED_SOURCES += ["UnderrunHandlerNoop.cpp"]
305306

307+
if CONFIG["OS_TARGET"] == "WINNT":
308+
SOURCES += [
309+
"ThreadPoolCOMListener.cpp",
310+
]
311+
306312
# CubebUtils.cpp needs to be built separately due to what appears to be some kind
307313
# of compiler bug on Android 4.2 x86 opt. See bug 1408459.
308314
# DecoderTraits.cpp needs to be built separately because of Mac OS X headers.

ipc/chromium/src/base/command_line.cc

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#if defined(OS_WIN)
1010
# include <windows.h>
1111
# include <shellapi.h>
12-
# include "mozilla/DynamicallyLinkedFunctionPtr.h"
1312
#endif
1413

1514
#include <algorithm>
@@ -51,16 +50,8 @@ void CommandLine::ParseFromString(const std::wstring& command_line) {
5150

5251
int num_args = 0;
5352
wchar_t** args = NULL;
54-
// When calling CommandLineToArgvW, use the API set if available.
55-
// Doing so will bypass loading shell32.dll on Win8+.
56-
mozilla::DynamicallyLinkedFunctionPtr<decltype(&::CommandLineToArgvW)>
57-
pCommandLineToArgvW(L"api-ms-win-downlevel-shell32-l1-1-0.dll",
58-
"CommandLineToArgvW");
59-
if (pCommandLineToArgvW) {
60-
args = pCommandLineToArgvW(command_line_string_.c_str(), &num_args);
61-
} else {
62-
args = CommandLineToArgvW(command_line_string_.c_str(), &num_args);
63-
}
53+
54+
args = CommandLineToArgvW(command_line_string_.c_str(), &num_args);
6455

6556
// Populate program_ with the trimmed version of the first arg.
6657
TrimWhitespace(args[0], TRIM_ALL, &program_);

ipc/mscom/ApartmentRegion.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
#include "mozilla/Assertions.h"
1111
#include "mozilla/Attributes.h"
12-
#include "mozilla/mscom/COMWrappers.h"
12+
13+
#include <objbase.h>
1314

1415
namespace mozilla {
1516
namespace mscom {
@@ -24,14 +25,14 @@ class MOZ_NON_TEMPORARY_CLASS ApartmentRegion final {
2425
constexpr ApartmentRegion() : mInitResult(CO_E_NOTINITIALIZED) {}
2526

2627
explicit ApartmentRegion(COINIT aAptType)
27-
: mInitResult(wrapped::CoInitializeEx(nullptr, aAptType)) {
28+
: mInitResult(::CoInitializeEx(nullptr, aAptType)) {
2829
// If this fires then we're probably mixing apartments on the same thread
2930
MOZ_ASSERT(IsValid());
3031
}
3132

3233
~ApartmentRegion() {
3334
if (IsValid()) {
34-
wrapped::CoUninitialize();
35+
::CoUninitialize();
3536
}
3637
}
3738

@@ -43,7 +44,7 @@ class MOZ_NON_TEMPORARY_CLASS ApartmentRegion final {
4344

4445
bool Init(COINIT aAptType) {
4546
MOZ_ASSERT(mInitResult == CO_E_NOTINITIALIZED);
46-
mInitResult = wrapped::CoInitializeEx(nullptr, aAptType);
47+
mInitResult = ::CoInitializeEx(nullptr, aAptType);
4748
MOZ_ASSERT(IsValid());
4849
return IsValid();
4950
}

0 commit comments

Comments
 (0)