Skip to content

Commit 045c446

Browse files
committed
Rename shared() static member functions to singleton() for singleton classes.
https://bugs.webkit.org/show_bug.cgi?id=141088 Reviewed by Ryosuke Niwa and Benjamin Poulain. Rename shared() static member functions to singleton() for singleton classes as per the recent coding style change. Source/JavaScriptCore: * inspector/remote/RemoteInspector.h: * inspector/remote/RemoteInspector.mm: (Inspector::RemoteInspector::singleton): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::shared): Deleted. * inspector/remote/RemoteInspectorDebuggable.cpp: (Inspector::RemoteInspectorDebuggable::~RemoteInspectorDebuggable): (Inspector::RemoteInspectorDebuggable::init): (Inspector::RemoteInspectorDebuggable::update): (Inspector::RemoteInspectorDebuggable::setRemoteDebuggingAllowed): (Inspector::RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection): (Inspector::RemoteInspectorDebuggable::unpauseForInitializedInspector): * inspector/remote/RemoteInspectorDebuggableConnection.mm: (Inspector::RemoteInspectorDebuggableConnection::setup): (Inspector::RemoteInspectorDebuggableConnection::sendMessageToFrontend): Source/WebKit: * Storage/WebDatabaseProvider.cpp: (WebDatabaseProvider::singleton): (WebDatabaseProvider::shared): Deleted. * Storage/WebDatabaseProvider.h: Canonical link: https://commits.webkit.org/159087@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 4b024af commit 045c446

File tree

281 files changed

+1373
-1168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+1373
-1168
lines changed

Source/JavaScriptCore/ChangeLog

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
2015-01-30 Chris Dumez <[email protected]>
2+
3+
Rename shared() static member functions to singleton() for singleton classes.
4+
https://bugs.webkit.org/show_bug.cgi?id=141088
5+
6+
Reviewed by Ryosuke Niwa and Benjamin Poulain.
7+
8+
Rename shared() static member functions to singleton() for singleton
9+
classes as per the recent coding style change.
10+
11+
* inspector/remote/RemoteInspector.h:
12+
* inspector/remote/RemoteInspector.mm:
13+
(Inspector::RemoteInspector::singleton):
14+
(Inspector::RemoteInspector::start):
15+
(Inspector::RemoteInspector::shared): Deleted.
16+
* inspector/remote/RemoteInspectorDebuggable.cpp:
17+
(Inspector::RemoteInspectorDebuggable::~RemoteInspectorDebuggable):
18+
(Inspector::RemoteInspectorDebuggable::init):
19+
(Inspector::RemoteInspectorDebuggable::update):
20+
(Inspector::RemoteInspectorDebuggable::setRemoteDebuggingAllowed):
21+
(Inspector::RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection):
22+
(Inspector::RemoteInspectorDebuggable::unpauseForInitializedInspector):
23+
* inspector/remote/RemoteInspectorDebuggableConnection.mm:
24+
(Inspector::RemoteInspectorDebuggableConnection::setup):
25+
(Inspector::RemoteInspectorDebuggableConnection::sendMessageToFrontend):
26+
127
2015-01-30 Geoffrey Garen <[email protected]>
228

329
Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages

Source/JavaScriptCore/inspector/remote/RemoteInspector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct RemoteInspectorDebuggableInfo;
4646
class JS_EXPORT_PRIVATE RemoteInspector final : public RemoteInspectorXPCConnection::Client {
4747
public:
4848
static void startDisabled();
49-
static RemoteInspector& shared();
49+
static RemoteInspector& singleton();
5050
friend class NeverDestroyed<RemoteInspector>;
5151

5252
void registerDebuggable(RemoteInspectorDebuggable*);

Source/JavaScriptCore/inspector/remote/RemoteInspector.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void dispatchAsyncOnQueueSafeForAnyDebuggable(void (^block)())
9191
RemoteInspector::startEnabled = false;
9292
}
9393

94-
RemoteInspector& RemoteInspector::shared()
94+
RemoteInspector& RemoteInspector::singleton()
9595
{
9696
static NeverDestroyed<RemoteInspector> shared;
9797

@@ -309,7 +309,7 @@ static void dispatchAsyncOnQueueSafeForAnyDebuggable(void (^block)())
309309
});
310310

311311
notify_register_dispatch(WIRServiceAvailableNotification, &m_notifyToken, m_xpcQueue, ^(int) {
312-
RemoteInspector::shared().setupXPCConnectionIfNeeded();
312+
RemoteInspector::singleton().setupXPCConnectionIfNeeded();
313313
});
314314

315315
notify_post(WIRServiceAvailabilityCheckNotification);

Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ RemoteInspectorDebuggable::RemoteInspectorDebuggable()
4242

4343
RemoteInspectorDebuggable::~RemoteInspectorDebuggable()
4444
{
45-
RemoteInspector::shared().unregisterDebuggable(this);
45+
RemoteInspector::singleton().unregisterDebuggable(this);
4646
}
4747

4848
void RemoteInspectorDebuggable::init()
4949
{
50-
RemoteInspector::shared().registerDebuggable(this);
50+
RemoteInspector::singleton().registerDebuggable(this);
5151
}
5252

5353
void RemoteInspectorDebuggable::update()
5454
{
55-
RemoteInspector::shared().updateDebuggable(this);
55+
RemoteInspector::singleton().updateDebuggable(this);
5656
}
5757

5858
void RemoteInspectorDebuggable::setRemoteDebuggingAllowed(bool allowed)
@@ -63,9 +63,9 @@ void RemoteInspectorDebuggable::setRemoteDebuggingAllowed(bool allowed)
6363
m_allowed = allowed;
6464

6565
if (m_allowed && automaticInspectionAllowed())
66-
RemoteInspector::shared().updateDebuggableAutomaticInspectCandidate(this);
66+
RemoteInspector::singleton().updateDebuggableAutomaticInspectCandidate(this);
6767
else
68-
RemoteInspector::shared().updateDebuggable(this);
68+
RemoteInspector::singleton().updateDebuggable(this);
6969
}
7070

7171
RemoteInspectorDebuggableInfo RemoteInspectorDebuggable::info() const
@@ -87,13 +87,13 @@ void RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection()
8787
ASSERT(automaticInspectionAllowed());
8888

8989
EventLoop loop;
90-
while (RemoteInspector::shared().waitingForAutomaticInspection(identifier()) && !loop.ended())
90+
while (RemoteInspector::singleton().waitingForAutomaticInspection(identifier()) && !loop.ended())
9191
loop.cycle();
9292
}
9393

9494
void RemoteInspectorDebuggable::unpauseForInitializedInspector()
9595
{
96-
RemoteInspector::shared().setupCompleted(identifier());
96+
RemoteInspector::singleton().setupCompleted(identifier());
9797
}
9898

9999
} // namespace Inspector

Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static void RemoteInspectorHandleRunSourceWithInfo(void* info)
161161
{
162162
std::lock_guard<std::mutex> lock(m_debuggableMutex);
163163
if (!m_debuggable || !m_debuggable->remoteDebuggingAllowed() || m_debuggable->hasLocalDebugger()) {
164-
RemoteInspector::shared().setupFailed(identifier());
164+
RemoteInspector::singleton().setupFailed(identifier());
165165
m_debuggable = nullptr;
166166
} else {
167167
m_debuggable->connect(this, isAutomaticInspection);
@@ -220,7 +220,7 @@ static void RemoteInspectorHandleRunSourceWithInfo(void* info)
220220

221221
bool RemoteInspectorDebuggableConnection::sendMessageToFrontend(const String& message)
222222
{
223-
RemoteInspector::shared().sendMessageToRemoteFrontend(identifier(), message);
223+
RemoteInspector::singleton().sendMessageToRemoteFrontend(identifier(), message);
224224

225225
return true;
226226
}

Source/WebCore/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2015-01-30 Chris Dumez <[email protected]>
2+
3+
Rename shared() static member functions to singleton() for singleton classes.
4+
https://bugs.webkit.org/show_bug.cgi?id=141088
5+
6+
Reviewed by Ryosuke Niwa and Benjamin Poulain.
7+
8+
Rename shared() static member functions to singleton() for singleton
9+
classes as per the recent coding style change.
10+
111
2015-01-30 Matthew Mirman <[email protected]>
212

313
Added ClientRect as an interface that requires attributes

Source/WebCore/Modules/gamepad/GamepadManager.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static NavigatorGamepad* navigatorGamepadFromDOMWindow(DOMWindow* window)
4747
return NavigatorGamepad::from(navigator);
4848
}
4949

50-
GamepadManager& GamepadManager::shared()
50+
GamepadManager& GamepadManager::singleton()
5151
{
5252
static NeverDestroyed<GamepadManager> sharedManager;
5353
return sharedManager;
@@ -61,7 +61,7 @@ GamepadManager::GamepadManager()
6161
void GamepadManager::platformGamepadConnected(PlatformGamepad& platformGamepad)
6262
{
6363
// Notify blind Navigators and Windows about all gamepads except for this one.
64-
for (auto* gamepad : GamepadProvider::shared().platformGamepads()) {
64+
for (auto* gamepad : GamepadProvider::singleton().platformGamepads()) {
6565
if (!gamepad || gamepad == &platformGamepad)
6666
continue;
6767

@@ -119,7 +119,7 @@ void GamepadManager::platformGamepadInputActivity()
119119
if (m_gamepadBlindNavigators.isEmpty() && m_gamepadBlindDOMWindows.isEmpty())
120120
return;
121121

122-
for (auto* gamepad : GamepadProvider::shared().platformGamepads())
122+
for (auto* gamepad : GamepadProvider::singleton().platformGamepads())
123123
makeGamepadVisible(*gamepad, m_gamepadBlindNavigators, m_gamepadBlindDOMWindows);
124124

125125
m_gamepadBlindNavigators.clear();
@@ -218,7 +218,7 @@ void GamepadManager::maybeStartMonitoringGamepads()
218218
if (!m_navigators.isEmpty() || !m_domWindows.isEmpty()) {
219219
LOG(Gamepad, "GamepadManager has %i NavigatorGamepads and %i DOMWindows registered, is starting gamepad monitoring", m_navigators.size(), m_domWindows.size());
220220
m_isMonitoringGamepads = true;
221-
GamepadProvider::shared().startMonitoringGamepads(this);
221+
GamepadProvider::singleton().startMonitoringGamepads(this);
222222
}
223223
}
224224

@@ -230,7 +230,7 @@ void GamepadManager::maybeStopMonitoringGamepads()
230230
if (m_navigators.isEmpty() && m_domWindows.isEmpty()) {
231231
LOG(Gamepad, "GamepadManager has no NavigatorGamepads or DOMWindows registered, is stopping gamepad monitoring");
232232
m_isMonitoringGamepads = false;
233-
GamepadProvider::shared().stopMonitoringGamepads(this);
233+
GamepadProvider::singleton().stopMonitoringGamepads(this);
234234
}
235235
}
236236

Source/WebCore/Modules/gamepad/GamepadManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class GamepadManager : public GamepadProviderClient {
4444
WTF_MAKE_NONCOPYABLE(GamepadManager);
4545
friend class NeverDestroyed<GamepadManager>;
4646
public:
47-
static GamepadManager& shared();
47+
static GamepadManager& singleton();
4848

4949
virtual void platformGamepadConnected(PlatformGamepad&) override final;
5050
virtual void platformGamepadDisconnected(PlatformGamepad&) override final;

Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ namespace WebCore {
4343
NavigatorGamepad::NavigatorGamepad()
4444
: m_navigationStart(std::numeric_limits<double>::infinity())
4545
{
46-
GamepadManager::shared().registerNavigator(this);
46+
GamepadManager::singleton().registerNavigator(this);
4747
}
4848

4949
NavigatorGamepad::~NavigatorGamepad()
5050
{
51-
GamepadManager::shared().unregisterNavigator(this);
51+
GamepadManager::singleton().unregisterNavigator(this);
5252
}
5353

5454
const char* NavigatorGamepad::supplementName()
@@ -91,7 +91,7 @@ const Vector<RefPtr<Gamepad>>& NavigatorGamepad::gamepads()
9191
if (m_gamepads.isEmpty())
9292
return m_gamepads;
9393

94-
const Vector<PlatformGamepad*>& platformGamepads = GamepadProvider::shared().platformGamepads();
94+
const Vector<PlatformGamepad*>& platformGamepads = GamepadProvider::singleton().platformGamepads();
9595

9696
for (unsigned i = 0; i < platformGamepads.size(); ++i) {
9797
if (!platformGamepads[i]) {
@@ -108,7 +108,7 @@ const Vector<RefPtr<Gamepad>>& NavigatorGamepad::gamepads()
108108

109109
void NavigatorGamepad::gamepadsBecameVisible()
110110
{
111-
const Vector<PlatformGamepad*>& platformGamepads = GamepadProvider::shared().platformGamepads();
111+
const Vector<PlatformGamepad*>& platformGamepads = GamepadProvider::singleton().platformGamepads();
112112
m_gamepads.resize(platformGamepads.size());
113113

114114
for (unsigned i = 0; i < platformGamepads.size(); ++i) {
@@ -128,7 +128,7 @@ void NavigatorGamepad::gamepadConnected(PlatformGamepad& platformGamepad)
128128
}
129129

130130
unsigned index = platformGamepad.index();
131-
ASSERT(GamepadProvider::shared().platformGamepads()[index] == &platformGamepad);
131+
ASSERT(GamepadProvider::singleton().platformGamepads()[index] == &platformGamepad);
132132

133133
// The new index should already fit in the existing array, or should be exactly one past-the-end of the existing array.
134134
ASSERT(index <= m_gamepads.size());

Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const AtomicString& MediaStreamTrack::readyState() const
151151
void MediaStreamTrack::getSources(ScriptExecutionContext* context, PassRefPtr<MediaStreamTrackSourcesCallback> callback, ExceptionCode& ec)
152152
{
153153
RefPtr<MediaStreamTrackSourcesRequest> request = MediaStreamTrackSourcesRequest::create(context, callback);
154-
if (!MediaStreamCenter::shared().getMediaStreamTrackSources(request.release()))
154+
if (!MediaStreamCenter::singleton().getMediaStreamTrackSources(request.release()))
155155
ec = NOT_SUPPORTED_ERR;
156156
}
157157

0 commit comments

Comments
 (0)