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

Side by Side Diff: ui/views/mus/aura_init.cc

Issue 1871253002: aura: Require explicit ownership of the Env instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot.merge Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « ui/views/mus/aura_init.h ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/mus/aura_init.h" 5 #include "ui/views/mus/aura_init.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 Widget::InitParams* params, 45 Widget::InitParams* params,
46 internal::NativeWidgetDelegate* delegate) override {} 46 internal::NativeWidgetDelegate* delegate) override {}
47 47
48 DISALLOW_COPY_AND_ASSIGN(MusViewsDelegate); 48 DISALLOW_COPY_AND_ASSIGN(MusViewsDelegate);
49 }; 49 };
50 50
51 } // namespace 51 } // namespace
52 52
53 AuraInit::AuraInit(mojo::Connector* connector, const std::string& resource_file) 53 AuraInit::AuraInit(mojo::Connector* connector, const std::string& resource_file)
54 : resource_file_(resource_file), 54 : resource_file_(resource_file),
55 env_(aura::Env::CreateInstance()),
55 views_delegate_(new MusViewsDelegate) { 56 views_delegate_(new MusViewsDelegate) {
56 aura::Env::CreateInstance(false);
57
58 InitializeResources(connector); 57 InitializeResources(connector);
59 58
60 ui::InitializeInputMethodForTesting(); 59 ui::InitializeInputMethodForTesting();
61 } 60 }
62 61
63 AuraInit::~AuraInit() { 62 AuraInit::~AuraInit() {
64 #if defined(OS_LINUX) && !defined(OS_ANDROID) 63 #if defined(OS_LINUX) && !defined(OS_ANDROID)
65 if (font_loader_.get()) { 64 if (font_loader_.get()) {
66 SkFontConfigInterface::SetGlobal(nullptr); 65 SkFontConfigInterface::SetGlobal(nullptr);
67 // FontLoader is ref counted. We need to explicitly shutdown the background 66 // FontLoader is ref counted. We need to explicitly shutdown the background
(...skipping 24 matching lines...) Expand all
92 font_loader_ = skia::AdoptRef(new font_service::FontLoader(connector)); 91 font_loader_ = skia::AdoptRef(new font_service::FontLoader(connector));
93 SkFontConfigInterface::SetGlobal(font_loader_.get()); 92 SkFontConfigInterface::SetGlobal(font_loader_.get());
94 #endif 93 #endif
95 94
96 // There is a bunch of static state in gfx::Font, by running this now, 95 // There is a bunch of static state in gfx::Font, by running this now,
97 // before any other apps load, we ensure all the state is set up. 96 // before any other apps load, we ensure all the state is set up.
98 gfx::Font(); 97 gfx::Font();
99 } 98 }
100 99
101 } // namespace views 100 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/aura_init.h ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698