Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: trunk/src/content/browser/aura/image_transport_factory.cc

Issue 22648006: Revert 216780 "Clean up compositor initialization/destruction." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/content/browser/aura/image_transport_factory.cc
===================================================================
--- trunk/src/content/browser/aura/image_transport_factory.cc (revision 216906)
+++ trunk/src/content/browser/aura/image_transport_factory.cc (working copy)
@@ -8,45 +8,23 @@
#include "content/browser/aura/gpu_process_transport_factory.h"
#include "content/browser/aura/no_transport_image_transport_factory.h"
#include "content/public/common/content_switches.h"
-#include "ui/compositor/compositor.h"
-#include "ui/compositor/compositor_switches.h"
+#include "ui/compositor/compositor_setup.h"
-#if defined(OS_CHROMEOS)
-#include "base/chromeos/chromeos_version.h"
-#endif
-
namespace content {
namespace {
ImageTransportFactory* g_factory;
}
-
-static bool UseTestContextAndTransportFactory() {
-#if defined(OS_CHROMEOS)
- // If the test is running on the chromeos envrionment (such as
- // device or vm bots), always use real contexts.
- if (base::chromeos::IsRunningOnChromeOS())
- return false;
-#endif
-
- // Only used if the enable command line flag is used.
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (!command_line->HasSwitch(switches::kTestCompositor))
- return false;
-
- // The disable command line flag preempts the enable flag.
- if (!command_line->HasSwitch(switches::kDisableTestCompositor))
- return true;
-
- return false;
-}
-
// static
void ImageTransportFactory::Initialize() {
- if (UseTestContextAndTransportFactory()) {
- g_factory =
- new NoTransportImageTransportFactory(new ui::TestContextFactory);
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kTestCompositor)) {
+ ui::SetupTestCompositor();
+ }
+ if (ui::IsTestCompositorEnabled()) {
+ g_factory = new NoTransportImageTransportFactory(
+ new ui::TestContextFactory);
} else {
g_factory = new GpuProcessTransportFactory;
}

Powered by Google App Engine
This is Rietveld 408576698