forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a base::Feature for Mojo dispatch change
Adds a new base::Feature to control whether or not Mojo uses the more granular task-per-message dispatch policy as opposed to the old batch dispatch behavior. This is disabled by default until M73 branch. TBR=jam@chromium.org Bug: 866708 Change-Id: I138a66c0d65106f44f153e02c1cf92d71c27d14d Reviewed-on: https://chromium-review.googlesource.com/c/1433139 Reviewed-by: Ken Rockot <rockot@google.com> Reviewed-by: John Abd-El-Malek <jam@chromium.org> Commit-Queue: Ken Rockot <rockot@google.com> Cr-Commit-Position: refs/heads/master@{#625514}
- Loading branch information
Showing
5 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2019 The 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 "mojo/public/cpp/bindings/features.h" | ||
|
||
namespace mojo { | ||
namespace features { | ||
|
||
// Enables a task to be scheduled for each individual message dispatched to a | ||
// Mojo binding endpoint (or reply to an InterfacePtr). | ||
// | ||
// When disabled, dispatch happens eagerly in batch, so when a binding is | ||
// scheduled to dispatch messages, it fully flushes and dispatches all queued | ||
// messages within the extent of a single scheduler task. | ||
// | ||
// Enabling this feature allows for more fine-grained performance control | ||
// through the scheduler, but may initially cause some important edge cases to | ||
// regress in performance due to high-priority messages seeing increased | ||
// latency. Ideally we'd address these cases by giving the affected bindings | ||
// higher-priority TaskRunners. | ||
// | ||
// TODO(https://crbug.com/866708): Enable this by default after M73 branch. | ||
const base::Feature kTaskPerMessage{"MojoTaskPerMessage", | ||
base::FEATURE_DISABLED_BY_DEFAULT}; | ||
|
||
} // namespace features | ||
} // namespace mojo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2019 The 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. | ||
|
||
#ifndef MOJO_PUBLIC_CPP_BINDINGS_FEATURES_H_ | ||
#define MOJO_PUBLIC_CPP_BINDINGS_FEATURES_H_ | ||
|
||
#include "base/component_export.h" | ||
#include "base/feature_list.h" | ||
|
||
namespace mojo { | ||
namespace features { | ||
|
||
COMPONENT_EXPORT(MOJO_CPP_BINDINGS_BASE) | ||
extern const base::Feature kTaskPerMessage; | ||
|
||
} // namespace features | ||
} // namespace mojo | ||
|
||
#endif // MOJO_PUBLIC_CPP_BINDINGS_FEATURES_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters