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

Unified Diff: mojo/edk/embedder/embedder.cc

Issue 898623002: Make mojo::system::Core not own the PlatformSupport. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: foo Created 5 years, 11 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
« no previous file with comments | « no previous file | mojo/edk/embedder/embedder_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/embedder.cc
diff --git a/mojo/edk/embedder/embedder.cc b/mojo/edk/embedder/embedder.cc
index ed1e8e9d8473630c6d820a2dd5dd4241af103bf8..f62951f5517e566c297fe9c5a19d2ccd351f7bca 100644
--- a/mojo/edk/embedder/embedder.cc
+++ b/mojo/edk/embedder/embedder.cc
@@ -33,9 +33,9 @@ system::ChannelId MakeChannel(
DCHECK(platform_handle.is_valid());
// Create and initialize a |system::Channel|.
- DCHECK(internal::g_core);
+ DCHECK(internal::g_platform_support);
scoped_refptr<system::Channel> channel =
- new system::Channel(internal::g_core->platform_support());
+ new system::Channel(internal::g_platform_support);
channel->Init(system::RawChannel::Create(platform_handle.Pass()));
channel->SetBootstrapEndpoint(channel_endpoint);
@@ -74,14 +74,21 @@ void CreateChannelHelper(
namespace internal {
// Declared in embedder_internal.h.
+PlatformSupport* g_platform_support = nullptr;
system::Core* g_core = nullptr;
system::ChannelManager* g_channel_manager = nullptr;
} // namespace internal
void Init(scoped_ptr<PlatformSupport> platform_support) {
+ DCHECK(platform_support);
+
+ DCHECK(!internal::g_platform_support);
+ internal::g_platform_support = platform_support.release();
+
DCHECK(!internal::g_core);
- internal::g_core = new system::Core(platform_support.Pass());
+ internal::g_core = new system::Core(internal::g_platform_support);
+
DCHECK(!internal::g_channel_manager);
internal::g_channel_manager = new system::ChannelManager();
}
« no previous file with comments | « no previous file | mojo/edk/embedder/embedder_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698