Commit b7e9d419 authored by Alice Boxhall's avatar Alice Boxhall Committed by Commit Bot

Revert "Disable COM Initialization on SchedulerWorkers When COM_INIT_CHECK_HOOK_ENABLED()"

This reverts commit 06f34ffd.

Reason for revert: Seems to have caused a test failure: https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.win%2FWin7_Tests__dbg__1_%2F61641%2F%2B%2Frecipes%2Fsteps%2Fbrowser_tests%2F0%2Flogs%2FPDFExtensionTest.DisablePlugin%2F0 in https://uberchromegw.corp.google.com/i/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29/builds/61641

Original change's description:
> Disable COM Initialization on SchedulerWorkers When COM_INIT_CHECK_HOOK_ENABLED()
> 
> This change will allow for the detection of tasks running in
> TaskScheduler that fail to post their task in a COM STA Task Runner
> instead.
> 
> BUG=706512
> 
> Change-Id: If8ea9df63cface0dc48aa11b5254ab3e6d87dc4f
> Reviewed-on: https://chromium-review.googlesource.com/549223
> Commit-Queue: Robert Liao <robliao@chromium.org>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#487269}

TBR=gab@chromium.org,robliao@chromium.org

Change-Id: Ie490ffab894364493a8b79fdb517e360d36ea4ee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 706512
Reviewed-on: https://chromium-review.googlesource.com/574894Reviewed-by: default avatarAlice Boxhall <aboxhall@chromium.org>
Commit-Queue: Alice Boxhall <aboxhall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487330}
parent cdfc35fe
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h" #include "base/mac/scoped_nsautorelease_pool.h"
#elif defined(OS_WIN) #elif defined(OS_WIN)
#include "base/win/com_init_check_hook.h"
#include "base/win/scoped_com_initializer.h" #include "base/win/scoped_com_initializer.h"
#endif #endif
...@@ -44,10 +43,7 @@ class SchedulerWorker::Thread : public PlatformThread::Delegate { ...@@ -44,10 +43,7 @@ class SchedulerWorker::Thread : public PlatformThread::Delegate {
// A SchedulerWorker starts out waiting for work. // A SchedulerWorker starts out waiting for work.
outer_->delegate_->WaitForWork(&wake_up_event_); outer_->delegate_->WaitForWork(&wake_up_event_);
// When defined(COM_INIT_CHECK_HOOK_ENABLED), ignore #if defined(OS_WIN)
// SchedulerBackwardCompatibility::INIT_COM_STA to find incorrect uses of
// COM that should be running in a COM STA Task Runner.
#if defined(OS_WIN) && !defined(COM_INIT_CHECK_HOOK_ENABLED)
std::unique_ptr<win::ScopedCOMInitializer> com_initializer; std::unique_ptr<win::ScopedCOMInitializer> com_initializer;
if (outer_->backward_compatibility_ == if (outer_->backward_compatibility_ ==
SchedulerBackwardCompatibility::INIT_COM_STA) { SchedulerBackwardCompatibility::INIT_COM_STA) {
......
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include <objbase.h> #include <objbase.h>
#include "base/win/com_init_check_hook.h"
#endif #endif
using testing::_; using testing::_;
...@@ -933,13 +931,7 @@ TEST(TaskSchedulerWorkerTest, BackwardCompatibilityEnabled) { ...@@ -933,13 +931,7 @@ TEST(TaskSchedulerWorkerTest, BackwardCompatibilityEnabled) {
// The call to CoInitializeEx() should have returned S_FALSE to indicate that // The call to CoInitializeEx() should have returned S_FALSE to indicate that
// the COM library was already initialized on the thread. // the COM library was already initialized on the thread.
// See SchedulerWorker::Thread::ThreadMain for why we expect two different
// results here.
#if defined(COM_INIT_CHECK_HOOK_ENABLED)
EXPECT_EQ(S_OK, delegate_raw->coinitialize_hresult());
#else
EXPECT_EQ(S_FALSE, delegate_raw->coinitialize_hresult()); EXPECT_EQ(S_FALSE, delegate_raw->coinitialize_hresult());
#endif
worker->JoinForTesting(); worker->JoinForTesting();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment