Commit 95a01c2a authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Add Location annotation ScopedBlockingCall

This CL is adding the FROM_HERE location of the call sites to each
ScopedBlockingCall. This modification will provide the
detailed location to the trace events and allow developpers do
understand cause of janks of long tasks.

This CL is adding manually the cases not caught by the previous CL:
  https://chromium-review.googlesource.com/c/chromium/src/+/1483834


TBR=gab@chromium.org (skipping owners for side-effects after //base review)

Bug: 934302
Change-Id: I04dc84ddc0b8824f91d7409bb06c74397ec7bf32
Reviewed-on: https://chromium-review.googlesource.com/c/1489110Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635701}
parent 3c0ba22f
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
namespace { namespace {
// Limit of memory segment size. It has to fit in an unsigned 32-bit number // Limit of memory segment size. It has to fit in an unsigned 32-bit number
// and should be a power of 2 in order to accomodate almost any page size. // and should be a power of 2 in order to accommodate almost any page size.
const uint32_t kSegmentMaxSize = 1 << 30; // 1 GiB const uint32_t kSegmentMaxSize = 1 << 30; // 1 GiB
// A constant (random) value placed in the shared metadata to identify // A constant (random) value placed in the shared metadata to identify
...@@ -1122,11 +1122,11 @@ void FilePersistentMemoryAllocator::FlushPartial(size_t length, bool sync) { ...@@ -1122,11 +1122,11 @@ void FilePersistentMemoryAllocator::FlushPartial(size_t length, bool sync) {
base::Optional<base::ScopedBlockingCall> scoped_blocking_call; base::Optional<base::ScopedBlockingCall> scoped_blocking_call;
if (sync) if (sync)
scoped_blocking_call.emplace(base::BlockingType::MAY_BLOCK); scoped_blocking_call.emplace(FROM_HERE, base::BlockingType::MAY_BLOCK);
#if defined(OS_WIN) #if defined(OS_WIN)
// Windows doesn't support asynchronous flush. // Windows doesn't support asynchronous flush.
scoped_blocking_call.emplace(base::BlockingType::MAY_BLOCK); scoped_blocking_call.emplace(FROM_HERE, base::BlockingType::MAY_BLOCK);
BOOL success = ::FlushViewOfFile(data(), length); BOOL success = ::FlushViewOfFile(data(), length);
DPCHECK(success); DPCHECK(success);
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
......
...@@ -983,13 +983,15 @@ struct NestedBlockingType { ...@@ -983,13 +983,15 @@ struct NestedBlockingType {
class NestedScopedBlockingCall { class NestedScopedBlockingCall {
public: public:
NestedScopedBlockingCall(const NestedBlockingType& nested_blocking_type) NestedScopedBlockingCall(const NestedBlockingType& nested_blocking_type)
: first_scoped_blocking_call_(nested_blocking_type.first), : first_scoped_blocking_call_(FROM_HERE, nested_blocking_type.first),
second_scoped_blocking_call_( second_scoped_blocking_call_(
nested_blocking_type.second == OptionalBlockingType::WILL_BLOCK nested_blocking_type.second == OptionalBlockingType::WILL_BLOCK
? std::make_unique<ScopedBlockingCall>(BlockingType::WILL_BLOCK) ? std::make_unique<ScopedBlockingCall>(FROM_HERE,
BlockingType::WILL_BLOCK)
: (nested_blocking_type.second == : (nested_blocking_type.second ==
OptionalBlockingType::MAY_BLOCK OptionalBlockingType::MAY_BLOCK
? std::make_unique<ScopedBlockingCall>( ? std::make_unique<ScopedBlockingCall>(
FROM_HERE,
BlockingType::MAY_BLOCK) BlockingType::MAY_BLOCK)
: nullptr)) {} : nullptr)) {}
...@@ -1479,7 +1481,7 @@ TEST_F(TaskSchedulerWorkerPoolBlockingTest, MaximumWorkersTest) { ...@@ -1479,7 +1481,7 @@ TEST_F(TaskSchedulerWorkerPoolBlockingTest, MaximumWorkersTest) {
Closure* early_threads_finished) { Closure* early_threads_finished) {
{ {
ScopedBlockingCall scoped_blocking_call( ScopedBlockingCall scoped_blocking_call(
BlockingType::WILL_BLOCK); FROM_HERE, BlockingType::WILL_BLOCK);
early_threads_barrier_closure->Run(); early_threads_barrier_closure->Run();
test::WaitWithoutBlockingObserver( test::WaitWithoutBlockingObserver(
early_release_threads_continue); early_release_threads_continue);
...@@ -1761,7 +1763,7 @@ TEST_P(TaskSchedulerWorkerPoolBlockingCallAndMaxBestEffortTasksTest, ...@@ -1761,7 +1763,7 @@ TEST_P(TaskSchedulerWorkerPoolBlockingCallAndMaxBestEffortTasksTest,
background_runner->PostTask( background_runner->PostTask(
FROM_HERE, base::BindLambdaForTesting([&]() { FROM_HERE, base::BindLambdaForTesting([&]() {
blocking_best_effort_tasks_running_barrier.Run(); blocking_best_effort_tasks_running_barrier.Run();
ScopedBlockingCall scoped_blocking_call(GetParam()); ScopedBlockingCall scoped_blocking_call(FROM_HERE, GetParam());
test::WaitWithoutBlockingObserver( test::WaitWithoutBlockingObserver(
&unblock_blocking_best_effort_tasks); &unblock_blocking_best_effort_tasks);
})); }));
...@@ -1803,7 +1805,7 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -1803,7 +1805,7 @@ INSTANTIATE_TEST_SUITE_P(
TaskSchedulerWorkerPoolBlockingCallAndMaxBestEffortTasksTest, TaskSchedulerWorkerPoolBlockingCallAndMaxBestEffortTasksTest,
::testing::Values(BlockingType::WILL_BLOCK)); ::testing::Values(BlockingType::WILL_BLOCK));
// Verify that worker detachement doesn't race with worker cleanup, regression // Verify that worker detachment doesn't race with worker cleanup, regression
// test for https://crbug.com/810464. // test for https://crbug.com/810464.
TEST_F(TaskSchedulerWorkerPoolImplStartInBodyTest, RacyCleanup) { TEST_F(TaskSchedulerWorkerPoolImplStartInBodyTest, RacyCleanup) {
#if defined(OS_FUCHSIA) #if defined(OS_FUCHSIA)
......
...@@ -486,7 +486,7 @@ TEST_P(TaskSchedulerTaskTrackerTest, IOAllowed) { ...@@ -486,7 +486,7 @@ TEST_P(TaskSchedulerTaskTrackerTest, IOAllowed) {
Task task_with_may_block(FROM_HERE, Bind([]() { Task task_with_may_block(FROM_HERE, Bind([]() {
// Shouldn't fail. // Shouldn't fail.
ScopedBlockingCall scope_blocking_call( ScopedBlockingCall scope_blocking_call(
BlockingType::WILL_BLOCK); FROM_HERE, BlockingType::WILL_BLOCK);
}), }),
TimeDelta()); TimeDelta());
TaskTraits traits_with_may_block = TaskTraits(MayBlock(), GetParam()); TaskTraits traits_with_may_block = TaskTraits(MayBlock(), GetParam());
......
...@@ -80,7 +80,10 @@ TEST_F(ScopedBlockingCallTest, WillBlockMayBlock) { ...@@ -80,7 +80,10 @@ TEST_F(ScopedBlockingCallTest, WillBlockMayBlock) {
BlockingType::WILL_BLOCK); BlockingType::WILL_BLOCK);
testing::Mock::VerifyAndClear(&observer_); testing::Mock::VerifyAndClear(&observer_);
{ ScopedBlockingCall scoped_blocking_call_b(BlockingType::MAY_BLOCK); } {
ScopedBlockingCall scoped_blocking_call_b(FROM_HERE,
BlockingType::MAY_BLOCK);
}
EXPECT_CALL(observer_, BlockingEnded()); EXPECT_CALL(observer_, BlockingEnded());
} }
...@@ -90,7 +93,10 @@ TEST_F(ScopedBlockingCallTest, MayBlockMayBlock) { ...@@ -90,7 +93,10 @@ TEST_F(ScopedBlockingCallTest, MayBlockMayBlock) {
ScopedBlockingCall scoped_blocking_call_a(FROM_HERE, BlockingType::MAY_BLOCK); ScopedBlockingCall scoped_blocking_call_a(FROM_HERE, BlockingType::MAY_BLOCK);
testing::Mock::VerifyAndClear(&observer_); testing::Mock::VerifyAndClear(&observer_);
{ ScopedBlockingCall scoped_blocking_call_b(BlockingType::MAY_BLOCK); } {
ScopedBlockingCall scoped_blocking_call_b(FROM_HERE,
BlockingType::MAY_BLOCK);
}
EXPECT_CALL(observer_, BlockingEnded()); EXPECT_CALL(observer_, BlockingEnded());
} }
...@@ -101,7 +107,10 @@ TEST_F(ScopedBlockingCallTest, WillBlockWillBlock) { ...@@ -101,7 +107,10 @@ TEST_F(ScopedBlockingCallTest, WillBlockWillBlock) {
BlockingType::WILL_BLOCK); BlockingType::WILL_BLOCK);
testing::Mock::VerifyAndClear(&observer_); testing::Mock::VerifyAndClear(&observer_);
{ ScopedBlockingCall scoped_blocking_call_b(BlockingType::WILL_BLOCK); } {
ScopedBlockingCall scoped_blocking_call_b(FROM_HERE,
BlockingType::WILL_BLOCK);
}
EXPECT_CALL(observer_, BlockingEnded()); EXPECT_CALL(observer_, BlockingEnded());
} }
...@@ -130,9 +139,9 @@ TEST_F(ScopedBlockingCallTest, MayBlockWillBlockTwice) { ...@@ -130,9 +139,9 @@ TEST_F(ScopedBlockingCallTest, MayBlockWillBlockTwice) {
TEST(ScopedBlockingCallDestructionOrderTest, InvalidDestructionOrder) { TEST(ScopedBlockingCallDestructionOrderTest, InvalidDestructionOrder) {
auto scoped_blocking_call_a = auto scoped_blocking_call_a =
std::make_unique<ScopedBlockingCall>(BlockingType::WILL_BLOCK); std::make_unique<ScopedBlockingCall>(FROM_HERE, BlockingType::WILL_BLOCK);
auto scoped_blocking_call_b = auto scoped_blocking_call_b =
std::make_unique<ScopedBlockingCall>(BlockingType::WILL_BLOCK); std::make_unique<ScopedBlockingCall>(FROM_HERE, BlockingType::WILL_BLOCK);
EXPECT_DCHECK_DEATH({ scoped_blocking_call_a.reset(); }); EXPECT_DCHECK_DEATH({ scoped_blocking_call_a.reset(); });
} }
......
...@@ -88,7 +88,7 @@ void LoadSTHsFromDisk( ...@@ -88,7 +88,7 @@ void LoadSTHsFromDisk(
std::string json_sth; std::string json_sth;
{ {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
if (!base::ReadFileToString(sth_file_path, &json_sth)) { if (!base::ReadFileToString(sth_file_path, &json_sth)) {
DVLOG(1) << "Failed reading from " << sth_file_path.value(); DVLOG(1) << "Failed reading from " << sth_file_path.value();
continue; continue;
......
...@@ -64,7 +64,7 @@ class ImageClipboardCopyManager : public ImageDecoder::ImageRequest { ...@@ -64,7 +64,7 @@ class ImageClipboardCopyManager : public ImageDecoder::ImageRequest {
void StartDecoding() { void StartDecoding() {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::WILL_BLOCK); FROM_HERE, base::BlockingType::WILL_BLOCK);
// Re-check the filesize since the file may be modified after downloaded. // Re-check the filesize since the file may be modified after downloaded.
int64_t filesize; int64_t filesize;
......
...@@ -94,7 +94,8 @@ void WMIRefresher::InitializeDiskIdleTimeConfigImpl( ...@@ -94,7 +94,8 @@ void WMIRefresher::InitializeDiskIdleTimeConfigImpl(
WMIRefresher::InitStatus* res) { WMIRefresher::InitStatus* res) {
DCHECK(res); DCHECK(res);
base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK); base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
// This assumes that CoInitialize(Ex) has already been called on this thread. // This assumes that CoInitialize(Ex) has already been called on this thread.
AssertComApartmentType(base::win::ComApartmentType::MTA); AssertComApartmentType(base::win::ComApartmentType::MTA);
......
...@@ -96,7 +96,7 @@ class PlatformParentalControlsValue { ...@@ -96,7 +96,7 @@ class PlatformParentalControlsValue {
static bool IsParentalControlActivityLoggingOnImpl() { static bool IsParentalControlActivityLoggingOnImpl() {
// Since we can potentially block, make sure the thread is okay with this. // Since we can potentially block, make sure the thread is okay with this.
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
Microsoft::WRL::ComPtr<IWindowsParentalControlsCore> parent_controls; Microsoft::WRL::ComPtr<IWindowsParentalControlsCore> parent_controls;
HRESULT hr = ::CoCreateInstance(__uuidof(WindowsParentalControls), nullptr, HRESULT hr = ::CoCreateInstance(__uuidof(WindowsParentalControls), nullptr,
CLSCTX_ALL, IID_PPV_ARGS(&parent_controls)); CLSCTX_ALL, IID_PPV_ARGS(&parent_controls));
......
...@@ -228,7 +228,7 @@ LevelDBSiteCharacteristicsDatabase::AsyncHelper::ReadSiteCharacteristicsFromDB( ...@@ -228,7 +228,7 @@ LevelDBSiteCharacteristicsDatabase::AsyncHelper::ReadSiteCharacteristicsFromDB(
std::string protobuf_value; std::string protobuf_value;
{ {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
s = db_->Get(read_options_, SerializeOriginIntoDatabaseKey(origin), s = db_->Get(read_options_, SerializeOriginIntoDatabaseKey(origin),
&protobuf_value); &protobuf_value);
} }
...@@ -256,7 +256,7 @@ void LevelDBSiteCharacteristicsDatabase::AsyncHelper:: ...@@ -256,7 +256,7 @@ void LevelDBSiteCharacteristicsDatabase::AsyncHelper::
leveldb::Status s; leveldb::Status s;
{ {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
s = db_->Put(write_options_, SerializeOriginIntoDatabaseKey(origin), s = db_->Put(write_options_, SerializeOriginIntoDatabaseKey(origin),
site_characteristic_proto.SerializeAsString()); site_characteristic_proto.SerializeAsString());
} }
......
...@@ -73,7 +73,7 @@ ChecksumStatus LoadFile(const base::FilePath& file_path, ...@@ -73,7 +73,7 @@ ChecksumStatus LoadFile(const base::FilePath& file_path,
std::string contents; std::string contents;
{ {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
base::ReadFileToString(file_path, &contents); base::ReadFileToString(file_path, &contents);
} }
size_t pos = contents.rfind(CHECKSUM_PREFIX); size_t pos = contents.rfind(CHECKSUM_PREFIX);
...@@ -159,7 +159,7 @@ void SaveDictionaryFileReliably(const base::FilePath& path, ...@@ -159,7 +159,7 @@ void SaveDictionaryFileReliably(const base::FilePath& path,
content << CHECKSUM_PREFIX << checksum; content << CHECKSUM_PREFIX << checksum;
{ {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
base::CopyFile(path, path.AddExtension(BACKUP_EXTENSION)); base::CopyFile(path, path.AddExtension(BACKUP_EXTENSION));
base::ImportantFileWriter::WriteFileAtomically(path, content.str()); base::ImportantFileWriter::WriteFileAtomically(path, content.str());
} }
......
...@@ -183,7 +183,7 @@ void DWriteFontLookupTableBuilder::BuildFontUniqueNameTable() { ...@@ -183,7 +183,7 @@ void DWriteFontLookupTableBuilder::BuildFontUniqueNameTable() {
{ {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
InitializeDirectWrite(); InitializeDirectWrite();
} }
...@@ -191,14 +191,14 @@ void DWriteFontLookupTableBuilder::BuildFontUniqueNameTable() { ...@@ -191,14 +191,14 @@ void DWriteFontLookupTableBuilder::BuildFontUniqueNameTable() {
font_unique_name_table_ = std::make_unique<blink::FontUniqueNameTable>(); font_unique_name_table_ = std::make_unique<blink::FontUniqueNameTable>();
// The |stored_for_platform_version_identifier| proto field is used for // The |stored_for_platform_version_identifier| proto field is used for
// persisting the table to disk and identifiying whether an update to the // persisting the table to disk and identifying whether an update to the
// table is needed when loading it back. This functionality is not used on // table is needed when loading it back. This functionality is not used on
// Windows, hence setting it to the empty string is sufficient. // Windows, hence setting it to the empty string is sufficient.
font_unique_name_table_->set_stored_for_platform_version_identifier(""); font_unique_name_table_->set_stored_for_platform_version_identifier("");
{ {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
outstanding_family_results_ = collection_->GetFontFamilyCount(); outstanding_family_results_ = collection_->GetFontFamilyCount();
} }
...@@ -254,7 +254,7 @@ DWriteFontLookupTableBuilder::ExtractPathAndNamesFromFamily( ...@@ -254,7 +254,7 @@ DWriteFontLookupTableBuilder::ExtractPathAndNamesFromFamily(
Microsoft::WRL::ComPtr<IDWriteFont> font; Microsoft::WRL::ComPtr<IDWriteFont> font;
{ {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
hr = family->GetFont(font_index, &font); hr = family->GetFont(font_index, &font);
} }
if (FAILED(hr)) if (FAILED(hr))
...@@ -268,7 +268,7 @@ DWriteFontLookupTableBuilder::ExtractPathAndNamesFromFamily( ...@@ -268,7 +268,7 @@ DWriteFontLookupTableBuilder::ExtractPathAndNamesFromFamily(
uint32_t ttc_index = 0; uint32_t ttc_index = 0;
{ {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
if (!AddFilesForFont(font.Get(), *windows_fonts_path, &path_set, if (!AddFilesForFont(font.Get(), *windows_fonts_path, &path_set,
&custom_font_path_set, &ttc_index)) { &custom_font_path_set, &ttc_index)) {
// It's possible to not be able to retrieve a font file for a font that // It's possible to not be able to retrieve a font file for a font that
...@@ -307,7 +307,7 @@ DWriteFontLookupTableBuilder::ExtractPathAndNamesFromFamily( ...@@ -307,7 +307,7 @@ DWriteFontLookupTableBuilder::ExtractPathAndNamesFromFamily(
BOOL has_id_keyed_names; BOOL has_id_keyed_names;
{ {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
hr = font->GetInformationalStrings( hr = font->GetInformationalStrings(
font_info_string_id, &font_id_keyed_names, &has_id_keyed_names); font_info_string_id, &font_id_keyed_names, &has_id_keyed_names);
if (FAILED(hr) || !has_id_keyed_names) if (FAILED(hr) || !has_id_keyed_names)
......
...@@ -92,7 +92,7 @@ class FileTraceDataEndpoint : public TracingController::TraceDataEndpoint { ...@@ -92,7 +92,7 @@ class FileTraceDataEndpoint : public TracingController::TraceDataEndpoint {
bool OpenFileIfNeededOnBlockingThread() { bool OpenFileIfNeededOnBlockingThread() {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
if (file_ != nullptr) if (file_ != nullptr)
return true; return true;
file_ = base::OpenFile(file_path_, "w"); file_ = base::OpenFile(file_path_, "w");
......
...@@ -29,7 +29,7 @@ bool HasBluetoothStack() { ...@@ -29,7 +29,7 @@ bool HasBluetoothStack() {
if (has_bluetooth_stack == HBS_UNKNOWN) { if (has_bluetooth_stack == HBS_UNKNOWN) {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
HRESULT hr = E_FAIL; HRESULT hr = E_FAIL;
__try { __try {
hr = __HrLoadAllImportsForDll("bthprops.cpl"); hr = __HrLoadAllImportsForDll("bthprops.cpl");
......
...@@ -217,7 +217,7 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) { ...@@ -217,7 +217,7 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
{ {
// GetAdaptersAddresses() may require IO operations. // GetAdaptersAddresses() may require IO operations.
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
adapters = reinterpret_cast<IP_ADAPTER_ADDRESSES*>(&initial_buf); adapters = reinterpret_cast<IP_ADAPTER_ADDRESSES*>(&initial_buf);
ULONG result = ULONG result =
......
...@@ -701,7 +701,7 @@ class DnsConfigServiceWin::HostsReader : public SerialWorker { ...@@ -701,7 +701,7 @@ class DnsConfigServiceWin::HostsReader : public SerialWorker {
void DoWork() override { void DoWork() override {
base::TimeTicks start_time = base::TimeTicks::Now(); base::TimeTicks start_time = base::TimeTicks::Now();
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
HostsParseWinResult result = HOSTS_PARSE_WIN_UNREADABLE_HOSTS_FILE; HostsParseWinResult result = HOSTS_PARSE_WIN_UNREADABLE_HOSTS_FILE;
if (ParseHostsFile(path_, &hosts_)) if (ParseHostsFile(path_, &hosts_))
result = AddLocalhostEntries(&hosts_); result = AddLocalhostEntries(&hosts_);
......
...@@ -245,7 +245,7 @@ std::string DhcpPacFileAdapterFetcher::GetPacURLFromDhcp( ...@@ -245,7 +245,7 @@ std::string DhcpPacFileAdapterFetcher::GetPacURLFromDhcp(
// (e.g. http://support.microsoft.com/kb/885270) so we won't take any // (e.g. http://support.microsoft.com/kb/885270) so we won't take any
// chances on non-standard, poorly documented usage. // chances on non-standard, poorly documented usage.
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
res = ::DhcpRequestParams(DHCPCAPI_REQUEST_SYNCHRONOUS, res = ::DhcpRequestParams(DHCPCAPI_REQUEST_SYNCHRONOUS,
NULL, NULL,
const_cast<LPWSTR>(adapter_name_wide.c_str()), const_cast<LPWSTR>(adapter_name_wide.c_str()),
......
...@@ -564,7 +564,7 @@ bool DhcpPacFileFetcherWin::GetCandidateAdapterNames( ...@@ -564,7 +564,7 @@ bool DhcpPacFileFetcherWin::GetCandidateAdapterNames(
adapters.reset(static_cast<IP_ADAPTER_ADDRESSES*>(malloc(adapters_size))); adapters.reset(static_cast<IP_ADAPTER_ADDRESSES*>(malloc(adapters_size)));
// Return only unicast addresses, and skip information we do not need. // Return only unicast addresses, and skip information we do not need.
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
error = GetAdaptersAddresses(AF_UNSPEC, error = GetAdaptersAddresses(AF_UNSPEC,
GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_ANYCAST |
GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_MULTICAST |
......
...@@ -548,7 +548,7 @@ class COMPONENT_EXPORT(SQL) Database { ...@@ -548,7 +548,7 @@ class COMPONENT_EXPORT(SQL) Database {
void InitScopedBlockingCall( void InitScopedBlockingCall(
base::Optional<base::ScopedBlockingCall>* scoped_blocking_call) const { base::Optional<base::ScopedBlockingCall>* scoped_blocking_call) const {
if (!in_memory_) if (!in_memory_)
scoped_blocking_call->emplace(base::BlockingType::MAY_BLOCK); scoped_blocking_call->emplace(FROM_HERE, base::BlockingType::MAY_BLOCK);
} }
// Internal helper for Does*Exist() functions. // Internal helper for Does*Exist() functions.
...@@ -582,7 +582,7 @@ class COMPONENT_EXPORT(SQL) Database { ...@@ -582,7 +582,7 @@ class COMPONENT_EXPORT(SQL) Database {
// and for error handling. Set to nullptr for invalid or untracked // and for error handling. Set to nullptr for invalid or untracked
// refs. |stmt| is the actual statement, and should only be null // refs. |stmt| is the actual statement, and should only be null
// to create an invalid ref. |was_valid| indicates whether the // to create an invalid ref. |was_valid| indicates whether the
// statement should be considered valid for diagnistic purposes. // statement should be considered valid for diagnostic purposes.
// |was_valid| can be true for a null |stmt| if the Database has // |was_valid| can be true for a null |stmt| if the Database has
// been forcibly closed by an error handler. // been forcibly closed by an error handler.
StatementRef(Database* database, sqlite3_stmt* stmt, bool was_valid); StatementRef(Database* database, sqlite3_stmt* stmt, bool was_valid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment