Skip to content

Commit cc10c00

Browse files
motiz88facebook-github-bot
authored andcommitted
Remove const qualifier from side-effectful methods of Agents and Targets (facebook#55314)
Summary: TSIA - minor refactor for correctness and clarity before making changes to some of these methods up the stack. Changelog: [Internal] Reviewed By: hoxyq Differential Revision: D91140491
1 parent 36f07a1 commit cc10c00

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

packages/react-native/ReactCommon/jsinspector-modern/HostAgent.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ class HostAgent::Impl final {
385385
return fuseboxClientType_ == FuseboxClientType::Fusebox;
386386
}
387387

388-
void emitExternalTracingProfile(
389-
tracing::HostTracingProfile tracingProfile) const {
388+
void emitExternalTracingProfile(tracing::HostTracingProfile tracingProfile) {
390389
assert(
391390
hasFuseboxClientConnected() &&
392391
"Attempted to emit a trace recording to a non-Fusebox client");
@@ -543,11 +542,11 @@ bool HostAgent::hasFuseboxClientConnected() const {
543542
}
544543

545544
void HostAgent::emitExternalTracingProfile(
546-
tracing::HostTracingProfile tracingProfile) const {
545+
tracing::HostTracingProfile tracingProfile) {
547546
impl_->emitExternalTracingProfile(std::move(tracingProfile));
548547
}
549548

550-
void HostAgent::emitSystemStateChanged(bool isSingleHost) const {
549+
void HostAgent::emitSystemStateChanged(bool isSingleHost) {
551550
impl_->emitSystemStateChanged(isSingleHost);
552551
}
553552

packages/react-native/ReactCommon/jsinspector-modern/HostAgent.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ class HostAgent final {
7777
* Emits the HostTracingProfile that was captured externally, not via the
7878
* CDP-initiated request.
7979
*/
80-
void emitExternalTracingProfile(tracing::HostTracingProfile tracingProfile) const;
80+
void emitExternalTracingProfile(tracing::HostTracingProfile tracingProfile);
8181

8282
/**
8383
* Emits a system state changed event when the number of ReactHost instances
8484
* changes.
8585
*/
86-
void emitSystemStateChanged(bool isSingleHost) const;
86+
void emitSystemStateChanged(bool isSingleHost);
8787

8888
private:
8989
// We use the private implementation idiom to ensure this class has the same

packages/react-native/ReactCommon/jsinspector-modern/HostTarget.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ class HostTargetSession {
111111
return hostAgent_.hasFuseboxClientConnected();
112112
}
113113

114-
void emitHostTracingProfile(
115-
tracing::HostTracingProfile tracingProfile) const {
114+
void emitHostTracingProfile(tracing::HostTracingProfile tracingProfile) {
116115
hostAgent_.emitExternalTracingProfile(std::move(tracingProfile));
117116
}
118117

@@ -384,7 +383,7 @@ bool HostTarget::hasActiveSessionWithFuseboxClient() const {
384383
}
385384

386385
void HostTarget::emitTracingProfileForFirstFuseboxClient(
387-
tracing::HostTracingProfile tracingProfile) const {
386+
tracing::HostTracingProfile tracingProfile) {
388387
bool emitted = false;
389388
sessions_.forEach([&](HostTargetSession& session) {
390389
if (emitted) {

packages/react-native/ReactCommon/jsinspector-modern/HostTarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ class JSINSPECTOR_EXPORT HostTarget : public EnableExecutorFromThis<HostTarget>
363363
*
364364
* @see \c hasActiveFrontendSession
365365
*/
366-
void emitTracingProfileForFirstFuseboxClient(tracing::HostTracingProfile tracingProfile) const;
366+
void emitTracingProfileForFirstFuseboxClient(tracing::HostTracingProfile tracingProfile);
367367

368368
/**
369369
* An endpoint for the Host to report frame timings that will be recorded if and only if there is currently an active

packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ bool TracingAgent::handleRequest(const cdp::PreparsedRequest& req) {
120120
}
121121

122122
void TracingAgent::emitExternalHostTracingProfile(
123-
tracing::HostTracingProfile tracingProfile) const {
123+
tracing::HostTracingProfile tracingProfile) {
124124
frontendChannel_(
125125
cdp::jsonNotification("ReactNativeApplication.traceRequested"));
126126
emitHostTracingProfile(std::move(tracingProfile));
127127
}
128128

129129
void TracingAgent::emitHostTracingProfile(
130-
tracing::HostTracingProfile tracingProfile) const {
130+
tracing::HostTracingProfile tracingProfile) {
131131
auto dataCollectedCallback = [this](folly::dynamic&& eventsChunk) {
132132
frontendChannel_(
133133
cdp::jsonNotification(

packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class TracingAgent {
4444
/**
4545
* Emits the HostTracingProfile that was stashed externally by the HostTarget.
4646
*/
47-
void emitExternalHostTracingProfile(tracing::HostTracingProfile tracingProfile) const;
47+
void emitExternalHostTracingProfile(tracing::HostTracingProfile tracingProfile);
4848

4949
private:
5050
/**
@@ -60,7 +60,7 @@ class TracingAgent {
6060
* Emits captured HostTracingProfile in a series of
6161
* Tracing.dataCollected events, followed by a Tracing.tracingComplete event.
6262
*/
63-
void emitHostTracingProfile(tracing::HostTracingProfile tracingProfile) const;
63+
void emitHostTracingProfile(tracing::HostTracingProfile tracingProfile);
6464
};
6565

6666
} // namespace facebook::react::jsinspector_modern

0 commit comments

Comments
 (0)