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

Side by Side Diff: third_party/WebKit/Source/platform/exported/Platform.cpp

Issue 2646003003: Avoid checking for WTFThreadData::staticData in wtfThreadData() (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 23 matching lines...) Expand all
34 #include "platform/MemoryCoordinator.h" 34 #include "platform/MemoryCoordinator.h"
35 #include "platform/PartitionAllocMemoryDumpProvider.h" 35 #include "platform/PartitionAllocMemoryDumpProvider.h"
36 #include "platform/fonts/FontCacheMemoryDumpProvider.h" 36 #include "platform/fonts/FontCacheMemoryDumpProvider.h"
37 #include "platform/heap/BlinkGCMemoryDumpProvider.h" 37 #include "platform/heap/BlinkGCMemoryDumpProvider.h"
38 #include "platform/heap/GCTaskRunner.h" 38 #include "platform/heap/GCTaskRunner.h"
39 #include "platform/instrumentation/tracing/MemoryCacheDumpProvider.h" 39 #include "platform/instrumentation/tracing/MemoryCacheDumpProvider.h"
40 #include "public/platform/InterfaceProvider.h" 40 #include "public/platform/InterfaceProvider.h"
41 #include "public/platform/Platform.h" 41 #include "public/platform/Platform.h"
42 #include "public/platform/WebPrerenderingSupport.h" 42 #include "public/platform/WebPrerenderingSupport.h"
43 #include "wtf/HashMap.h" 43 #include "wtf/HashMap.h"
44 #include "wtf/WTFThreadData.h"
44 45
45 namespace blink { 46 namespace blink {
46 47
47 static Platform* s_platform = nullptr; 48 static Platform* s_platform = nullptr;
48 49
49 static GCTaskRunner* s_gcTaskRunner = nullptr; 50 static GCTaskRunner* s_gcTaskRunner = nullptr;
50 51
51 static void maxObservedSizeFunction(size_t sizeInMB) { 52 static void maxObservedSizeFunction(size_t sizeInMB) {
52 const size_t supportedMaxSizeInMB = 4 * 1024; 53 const size_t supportedMaxSizeInMB = 4 * 1024;
53 if (sizeInMB >= supportedMaxSizeInMB) 54 if (sizeInMB >= supportedMaxSizeInMB)
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 base::ThreadTaskRunnerHandle::Get()); 98 base::ThreadTaskRunnerHandle::Get());
98 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 99 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
99 FontCacheMemoryDumpProvider::instance(), "FontCaches", 100 FontCacheMemoryDumpProvider::instance(), "FontCaches",
100 base::ThreadTaskRunnerHandle::Get()); 101 base::ThreadTaskRunnerHandle::Get());
101 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 102 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
102 MemoryCacheDumpProvider::instance(), "MemoryCache", 103 MemoryCacheDumpProvider::instance(), "MemoryCache",
103 base::ThreadTaskRunnerHandle::Get()); 104 base::ThreadTaskRunnerHandle::Get());
104 } 105 }
105 } 106 }
106 107
108 void Platform::initializeThread() {
109 WTFThreadData::initializeOnOffThread();
110 }
111
107 void Platform::shutdown() { 112 void Platform::shutdown() {
108 ASSERT(isMainThread()); 113 ASSERT(isMainThread());
109 if (s_platform->m_mainThread) { 114 if (s_platform->m_mainThread) {
110 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( 115 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
111 FontCacheMemoryDumpProvider::instance()); 116 FontCacheMemoryDumpProvider::instance());
112 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( 117 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
113 PartitionAllocMemoryDumpProvider::instance()); 118 PartitionAllocMemoryDumpProvider::instance());
114 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( 119 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
115 BlinkGCMemoryDumpProvider::instance()); 120 BlinkGCMemoryDumpProvider::instance());
116 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( 121 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 153 }
149 154
150 InterfaceProvider* Platform::interfaceProvider() { 155 InterfaceProvider* Platform::interfaceProvider() {
151 return InterfaceProvider::getEmptyInterfaceProvider(); 156 return InterfaceProvider::getEmptyInterfaceProvider();
152 } 157 }
153 158
154 void Platform::bindServiceConnector( 159 void Platform::bindServiceConnector(
155 mojo::ScopedMessagePipeHandle remoteHandle) {} 160 mojo::ScopedMessagePipeHandle remoteHandle) {}
156 161
157 } // namespace blink 162 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698