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

Unified Diff: chromecast/net/network_change_notifier_factory_cast.cc

Issue 223143003: Initial checkin of chromecast content embedder (cast_shell) and related build scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ScreenCast code and stale comments. Created 6 years, 6 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: chromecast/net/network_change_notifier_factory_cast.cc
diff --git a/chromecast/net/network_change_notifier_factory_cast.cc b/chromecast/net/network_change_notifier_factory_cast.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4aa7566270349a3493654e3153a58b5317a6c866
--- /dev/null
+++ b/chromecast/net/network_change_notifier_factory_cast.cc
@@ -0,0 +1,34 @@
+// Copyright 2014 Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromecast/net/network_change_notifier_factory_cast.h"
+
+#include "chromecast/net/network_change_notifier_cast.h"
+
+namespace net {
+
+namespace {
+
+NetworkChangeNotifierCast* g_network_change_notifier_cast = NULL;
+
+} // namespace
+
+NetworkChangeNotifier* NetworkChangeNotifierFactoryCast::CreateInstance() {
+ DCHECK(!g_network_change_notifier_cast);
+ g_network_change_notifier_cast = new NetworkChangeNotifierCast();
+ return g_network_change_notifier_cast;
+}
+
+NetworkChangeNotifierFactoryCast::~NetworkChangeNotifierFactoryCast() {
+ // CreateInstance() gives ownership, so assume its caller has deleted it.
+ g_network_change_notifier_cast = NULL;
+}
+
+// static
+NetworkChangeNotifierCast* NetworkChangeNotifierFactoryCast::GetInstance() {
+ DCHECK(g_network_change_notifier_cast);
+ return g_network_change_notifier_cast;
Ryan Sleevi 2014/07/01 21:13:55 Use a LazyInstance/LeakyLazyInstance here, not a g
lcwu1 2014/07/02 23:30:33 Done.
+}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698