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

Unified Diff: third_party/WebKit/Source/platform/exported/Platform.cpp

Issue 1785483003: Make sure that s_platform is non-null (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | third_party/WebKit/Source/platform/testing/RunAllTests.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/exported/Platform.cpp
diff --git a/third_party/WebKit/Source/platform/exported/Platform.cpp b/third_party/WebKit/Source/platform/exported/Platform.cpp
index 82b5fe76c85c63bf2911f3a1ed1db2e5aecfee94..ff4f19ed56f0c3557394c67d827752d57b02fe08 100644
--- a/third_party/WebKit/Source/platform/exported/Platform.cpp
+++ b/third_party/WebKit/Source/platform/exported/Platform.cpp
@@ -59,12 +59,12 @@ Platform::Platform()
void Platform::initialize(Platform* platform)
{
+ ASSERT(platform);
s_platform = platform;
- if (s_platform)
- s_platform->m_mainThread = platform->currentThread();
+ s_platform->m_mainThread = platform->currentThread();
// TODO(ssid): remove this check after fixing crbug.com/486782.
- if (s_platform && s_platform->m_mainThread)
+ if (s_platform->m_mainThread)
s_platform->registerMemoryDumpProvider(PartitionAllocMemoryDumpProvider::instance(), "PartitionAlloc");
CompositorFactory::initializeDefault();
@@ -77,16 +77,15 @@ void Platform::shutdown()
if (s_platform->m_mainThread)
s_platform->unregisterMemoryDumpProvider(PartitionAllocMemoryDumpProvider::instance());
- if (s_platform)
- s_platform->m_mainThread = 0;
- s_platform = 0;
+ s_platform->m_mainThread = nullptr;
+ s_platform = nullptr;
}
void Platform::setCurrentPlatformForTesting(Platform* platform)
{
+ ASSERT(platform);
s_platform = platform;
- if (s_platform)
- s_platform->m_mainThread = platform->currentThread();
+ s_platform->m_mainThread = platform->currentThread();
}
Platform* Platform::current()
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/testing/RunAllTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698