summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsudarsana.nagineni@intel.com <sudarsana.nagineni@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-11 22:59:14 +0000
committersudarsana.nagineni@intel.com <sudarsana.nagineni@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-11 22:59:14 +0000
commitf321f80be63d4b6460ada992334155acba7739b5 (patch)
tree9ee8b1b44fd0d7e6b5480ed012ab6742af5cf33e
parent3aab01bbe55a067a3e46c071c9af9dff3449cd30 (diff)
downloadchromium_src-f321f80be63d4b6460ada992334155acba7739b5.zip
chromium_src-f321f80be63d4b6460ada992334155acba7739b5.tar.gz
chromium_src-f321f80be63d4b6460ada992334155acba7739b5.tar.bz2
Fix crash on aura_demo and aura_bench startup.
Initialize the ContextFactory before any Compositors are created to avoid crash on startup. BUG=288556 Review URL: https://chromiumcodereview.appspot.com/23903038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222656 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ui/aura/bench/bench_main.cc4
-rw-r--r--ui/aura/demo/demo_main.cc6
2 files changed, 10 insertions, 0 deletions
diff --git a/ui/aura/bench/bench_main.cc b/ui/aura/bench/bench_main.cc
index 912216a..f344854 100644
--- a/ui/aura/bench/bench_main.cc
+++ b/ui/aura/bench/bench_main.cc
@@ -300,6 +300,10 @@ int main(int argc, char** argv) {
base::AtExitManager exit_manager;
+ // The ContextFactory must exist before any Compositors are created.
+ bool allow_test_contexts = false;
+ ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts);
+
ui::RegisterPathProvider();
base::i18n::InitializeICU();
ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc
index b2fd97e..0697a6e7 100644
--- a/ui/aura/demo/demo_main.cc
+++ b/ui/aura/demo/demo_main.cc
@@ -20,6 +20,7 @@
#include "ui/base/hit_test.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
+#include "ui/compositor/compositor.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/rect.h"
@@ -110,6 +111,11 @@ class DemoStackingClient : public aura::client::StackingClient {
int DemoMain() {
// Create the message-loop here before creating the root window.
base::MessageLoop message_loop(base::MessageLoop::TYPE_UI);
+
+ // The ContextFactory must exist before any Compositors are created.
+ bool allow_test_contexts = false;
+ ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts);
+
aura::Env::GetInstance();
scoped_ptr<aura::TestScreen> test_screen(aura::TestScreen::Create());
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get());