Etienne Pierre-Doray would like Simon Hatch to review this change.
[TaskScheduler]: Use ScopedBlockingCall to mark blocking tasks.
This CL uses ScopedBlockingCall to mark blocking calls in /content/browser/tracing.
This CL was created by replacing calls to AssertBlockingAllowed()
with instantiations of ScopedBlockingCall(MAY_BLOCK).
I kindly ask the reviewer to make sure of the following:
- ScopedBlockingCall is instantiated in a scope with minimal CPU usage.
If this is not the case, ScopedBlockingCall should be instantiated
closer to the blocking call. See scoped_blocking_call.h for more
info. Please let me know when/where the blocking call happens if this needs
to be changed.
- Parameter |blocking_type| matches expectation (MAY_BLOCK/WILL_BLOCK). See
BlockingType for more info. While I assumed MAY_BLOCK by default, that might
not be the best fit if we know that this callsite is guaranteed to block.
- The ScopedBlockingCall's scope covers the entirety of the blocking operation
previously asserted against by the AssertBlockingAllowed().
This CL was uploaded by git cl split.
R=simon...@chromium.org
Bug: 874080
Change-Id: I947898f0650e7a14a3133a4114c7fc30f326dedc
---
M content/browser/tracing/tracing_controller_impl_data_endpoint.cc
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/content/browser/tracing/tracing_controller_impl_data_endpoint.cc b/content/browser/tracing/tracing_controller_impl_data_endpoint.cc
index 6f3d4fa..b138d9f 100644
--- a/content/browser/tracing/tracing_controller_impl_data_endpoint.cc
+++ b/content/browser/tracing/tracing_controller_impl_data_endpoint.cc
@@ -11,6 +11,7 @@
#include "base/sequenced_task_runner.h"
#include "base/strings/pattern.h"
#include "base/task/post_task.h"
+#include "base/threading/scoped_blocking_call.h"
#include "content/browser/tracing/tracing_controller_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/tracing_controller.h"
@@ -89,7 +90,8 @@
}
bool OpenFileIfNeededOnBlockingThread() {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(
+ base::BlockingType::MAY_BLOCK);
if (file_ != nullptr)
return true;
file_ = base::OpenFile(file_path_, "w");
To view, visit change 1191806. To unsubscribe, or for help writing mail filters, visit settings.
Etienne Pierre-Doray uploaded patch set #2 to this change.
[TaskScheduler]: Use ScopedBlockingCall to mark blocking tasks.
This CL uses ScopedBlockingCall to mark blocking calls in /content/browser/tracing.
This CL was created by replacing calls to AssertBlockingAllowed()
with instantiations of ScopedBlockingCall(MAY_BLOCK).
I kindly ask the reviewer to make sure of the following:
- ScopedBlockingCall is instantiated in a scope with minimal CPU usage.
If this is not the case, ScopedBlockingCall should be instantiated
closer to the blocking call. See scoped_blocking_call.h for more
info. Please let me know when/where the blocking call happens if this needs
to be changed.
- Parameter |blocking_type| matches expectation:
MAY_BLOCK: The call might block (e.g. file I/O that might hit in memory cache).
WILL_BLOCK: The call will definitely block (e.g. cache already checked and now pinging
server synchronously).
See BlockingType for more info. While I assumed MAY_BLOCK by default, that might
not be the best fit if we know that this callsite is guaranteed to block.
- The ScopedBlockingCall's scope covers the entirety of the blocking operation
previously asserted against by the AssertBlockingAllowed().
This CL was uploaded by git cl split.
R=simon...@chromium.org
Bug: 874080
Change-Id: I947898f0650e7a14a3133a4114c7fc30f326dedc
---
M content/browser/tracing/tracing_controller_impl_data_endpoint.cc
1 file changed, 3 insertions(+), 1 deletion(-)
To view, visit change 1191806. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 2:Code-Review +1
Patch set 3:Commit-Queue +2
CQ is trying the patch.
Note: The patchset sent to CQ was uploaded after this CL was approved.
"Rebase" https://chromium-review.googlesource.com/c/1191806/3
Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/chromium-review.googlesource.com/1191806/3
Bot data: {"action": "start", "triggered_at": "2018-10-19T08:11:14.0Z", "cq_cfg_revision": "b62fa55343ae752de4c938affba0490094dda6c4", "revision": "b05f96339c27795160c4523631b6c83ca1f55529"}
Try jobs failed on following builders:
android-binary-size on luci.chromium.try (JOB_FAILED, https://ci.chromium.org/p/chromium/builders/luci.chromium.try/android-binary-size/79925)
fuchsia_x64 on luci.chromium.try (JOB_FAILED, https://ci.chromium.org/p/chromium/builders/luci.chromium.try/fuchsia_x64/131239)
Etienne Pierre-Doray uploaded patch set #4 to this change.
[TaskScheduler]: Use ScopedBlockingCall to mark blocking tasks.
This CL uses ScopedBlockingCall to mark blocking calls in /content/browser/tracing.
This CL was created by replacing calls to AssertBlockingAllowed()
with instantiations of ScopedBlockingCall(MAY_BLOCK).
I kindly ask the reviewer to make sure of the following:
- ScopedBlockingCall is instantiated in a scope with minimal CPU usage.
If this is not the case, ScopedBlockingCall should be instantiated
closer to the blocking call. See scoped_blocking_call.h for more
info. Please let me know when/where the blocking call happens if this needs
to be changed.
- Parameter |blocking_type| matches expectation:
MAY_BLOCK: The call might block (e.g. file I/O that might hit in memory cache).
WILL_BLOCK: The call will definitely block (e.g. cache already checked and now pinging
server synchronously).
See BlockingType for more info. While I assumed MAY_BLOCK by default, that might
not be the best fit if we know that this callsite is guaranteed to block.
- The ScopedBlockingCall's scope covers the entirety of the blocking operation
previously asserted against by the AssertBlockingAllowed().
This CL was uploaded by git cl split.
R=simon...@chromium.org
Bug: 874080
Change-Id: I947898f0650e7a14a3133a4114c7fc30f326dedc
---
M content/browser/tracing/tracing_controller_impl_data_endpoint.cc
1 file changed, 3 insertions(+), 1 deletion(-)
To view, visit change 1191806. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 4:Commit-Queue +2
CQ is trying the patch.
Note: The patchset sent to CQ was uploaded after this CL was approved.
"" https://chromium-review.googlesource.com/c/1191806/4
Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/chromium-review.googlesource.com/1191806/4
Bot data: {"action": "start", "triggered_at": "2018-10-19T08:20:28.0Z", "cq_cfg_revision": "b62fa55343ae752de4c938affba0490094dda6c4", "revision": "a89aaf092a44d2b323925dd4802a71ac55c17dc8"}
Commit Bot merged this change.
[TaskScheduler]: Use ScopedBlockingCall to mark blocking tasks.
This CL uses ScopedBlockingCall to mark blocking calls in /content/browser/tracing.
This CL was created by replacing calls to AssertBlockingAllowed()
with instantiations of ScopedBlockingCall(MAY_BLOCK).
I kindly ask the reviewer to make sure of the following:
- ScopedBlockingCall is instantiated in a scope with minimal CPU usage.
If this is not the case, ScopedBlockingCall should be instantiated
closer to the blocking call. See scoped_blocking_call.h for more
info. Please let me know when/where the blocking call happens if this needs
to be changed.
- Parameter |blocking_type| matches expectation:
MAY_BLOCK: The call might block (e.g. file I/O that might hit in memory cache).
WILL_BLOCK: The call will definitely block (e.g. cache already checked and now pinging
server synchronously).
See BlockingType for more info. While I assumed MAY_BLOCK by default, that might
not be the best fit if we know that this callsite is guaranteed to block.
- The ScopedBlockingCall's scope covers the entirety of the blocking operation
previously asserted against by the AssertBlockingAllowed().
This CL was uploaded by git cl split.
R=simon...@chromium.org
Bug: 874080
Change-Id: I947898f0650e7a14a3133a4114c7fc30f326dedc
Reviewed-on: https://chromium-review.googlesource.com/c/1191806
Commit-Queue: Etienne Pierre-Doray <etie...@chromium.org>
Reviewed-by: oysteine <oyst...@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601102}
---
M content/browser/tracing/tracing_controller_impl_data_endpoint.cc
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/content/browser/tracing/tracing_controller_impl_data_endpoint.cc b/content/browser/tracing/tracing_controller_impl_data_endpoint.cc
index e3179d9..25bb0ba 100644
--- a/content/browser/tracing/tracing_controller_impl_data_endpoint.cc
+++ b/content/browser/tracing/tracing_controller_impl_data_endpoint.cc
@@ -11,6 +11,7 @@
#include "base/sequenced_task_runner.h"
#include "base/strings/pattern.h"
#include "base/task/post_task.h"
+#include "base/threading/scoped_blocking_call.h"
#include "content/browser/tracing/tracing_controller_impl.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
@@ -90,7 +91,8 @@
}
bool OpenFileIfNeededOnBlockingThread() {
- base::AssertBlockingAllowedDeprecated();
+ base::ScopedBlockingCall scoped_blocking_call(
+ base::BlockingType::MAY_BLOCK);
if (file_ != nullptr)
return true;
file_ = base::OpenFile(file_path_, "w");
To view, visit change 1191806. To unsubscribe, or for help writing mail filters, visit settings.
Etienne Pierre-Doray abandoned this change.
To view, visit change 1191792. To unsubscribe, or for help writing mail filters, visit settings.