Fix auto raw pointer deduction on linux
This patch fixes all of the places where the auto raw pointer deduction is happening on linux R=danakj@chromium.org BUG=554600 Review-Url: https://codereview.chromium.org/2691393002 Cr-Commit-Position: refs/heads/master@{#452312}
This commit is contained in:
components
autofill
core
bookmarks
browser
component_updater
cryptauth
ntp_snippets
ntp_tiles
omnibox
password_manager
policy
core
common
precache
search_engines
subresource_filter
content
core
toolbar
tracing
update_client
content
browser
accessibility
indexed_db
loader
media
session
memory
renderer_host
media
render_widget_host_input_event_router.ccrender_widget_host_unittest.ccrender_widget_host_view_aura_unittest.ccservice_worker
web_contents
websockets
common
renderer
shell
test_runner
device
extensions
browser
renderer
gin
headless/lib/browser
mash/simple_wm
media
capture
filters
remoting
mojo/public/cpp/bindings/lib
net
cookies
http
http2
decoder
payload_decoders
hpack
proxy
quic
spdy
tools
remoting
sandbox/linux/seccomp-bpf-helpers
services/ui
tools/gn
ui
aura
compositor
events
gestures
gfx
message_center
views
controls
examples
layout
test
url
@ -628,7 +628,7 @@ void FormStructure::UpdateFromCache(const FormStructure& cached_form) {
|
||||
// Map from field signatures to cached fields.
|
||||
std::map<std::string, const AutofillField*> cached_fields;
|
||||
for (size_t i = 0; i < cached_form.field_count(); ++i) {
|
||||
const auto& field = cached_form.field(i);
|
||||
auto* const field = cached_form.field(i);
|
||||
cached_fields[field->FieldSignatureAsStr()] = field;
|
||||
}
|
||||
|
||||
@ -681,7 +681,7 @@ void FormStructure::LogQualityMetrics(const base::TimeTicks& load_time,
|
||||
bool did_autofill_all_possible_fields = true;
|
||||
bool did_autofill_some_possible_fields = false;
|
||||
for (size_t i = 0; i < field_count(); ++i) {
|
||||
const auto& field = this->field(i);
|
||||
auto* const field = this->field(i);
|
||||
|
||||
// No further logging for password fields. Those are primarily related to a
|
||||
// different feature code path, and so make more sense to track outside of
|
||||
|
@ -1815,7 +1815,7 @@ void PersonalDataManager::UpdateCardsBillingAddressReference(
|
||||
C -> D
|
||||
*/
|
||||
|
||||
for (auto& credit_card : GetCreditCards()) {
|
||||
for (auto* credit_card : GetCreditCards()) {
|
||||
// If the credit card is not associated with a billing address, skip it.
|
||||
if (credit_card->billing_address_id().empty())
|
||||
break;
|
||||
|
@ -56,7 +56,7 @@ void TypedCountSorter::SortMatches(const TitledUrlNodeSet& matches,
|
||||
if (client_->SupportsTypedCountForUrls()) {
|
||||
UrlNodeMap url_node_map;
|
||||
UrlTypedCountMap url_typed_count_map;
|
||||
for (auto node : matches) {
|
||||
for (auto* node : matches) {
|
||||
const GURL& url = node->GetTitledUrlNodeUrl();
|
||||
url_node_map.insert(std::make_pair(&url, node));
|
||||
url_typed_count_map.insert(std::make_pair(&url, 0));
|
||||
|
@ -200,7 +200,7 @@ std::unique_ptr<ComponentInfo> CrxUpdateService::GetComponentForMimeType(
|
||||
const auto it = component_ids_by_mime_type_.find(mime_type);
|
||||
if (it == component_ids_by_mime_type_.end())
|
||||
return nullptr;
|
||||
const auto component = GetComponent(it->second);
|
||||
auto* const component = GetComponent(it->second);
|
||||
if (!component)
|
||||
return nullptr;
|
||||
return base::MakeUnique<ComponentInfo>(GetCrxComponentID(*component),
|
||||
|
@ -610,7 +610,7 @@ BluetoothLowEnergyWeaveClientConnection::GetRemoteService() {
|
||||
if (remote_service_.id.empty()) {
|
||||
std::vector<device::BluetoothRemoteGattService*> services =
|
||||
bluetooth_device->GetGattServices();
|
||||
for (const auto& service : services)
|
||||
for (auto* service : services)
|
||||
if (service->GetUUID() == remote_service_.uuid) {
|
||||
remote_service_.id = service->GetIdentifier();
|
||||
break;
|
||||
|
@ -433,7 +433,7 @@ TEST(RemoteSuggestionTest, CreateFromProtoIgnoreMissingFetchDate) {
|
||||
proto.set_score(0.1f);
|
||||
proto.set_dismissed(false);
|
||||
proto.set_remote_category_id(1);
|
||||
auto source = proto.add_sources();
|
||||
auto* source = proto.add_sources();
|
||||
source->set_url("http://cool-suggestions.com/");
|
||||
source->set_publisher_name("Great Suggestions Inc.");
|
||||
source->set_amp_url("http://cdn.ampproject.org/c/foo/");
|
||||
|
@ -539,8 +539,8 @@ SchedulingRemoteSuggestionsProvider::GetEnabledTriggerTypes() {
|
||||
|
||||
std::set<TriggerType> enabled_types;
|
||||
for (const auto& token : tokens) {
|
||||
auto it = std::find(std::begin(kTriggerTypeNames),
|
||||
std::end(kTriggerTypeNames), token);
|
||||
auto** it = std::find(std::begin(kTriggerTypeNames),
|
||||
std::end(kTriggerTypeNames), token);
|
||||
if (it == std::end(kTriggerTypeNames)) {
|
||||
DLOG(WARNING) << "Failed to parse variation param "
|
||||
<< kTriggerTypesParamName << " with string value "
|
||||
|
@ -177,7 +177,7 @@ void NTPTilesInternalsMessageHandler::SendSourceInfo() {
|
||||
}
|
||||
|
||||
if (most_visited_sites_->DoesSourceExist(NTPTileSource::POPULAR)) {
|
||||
auto popular_sites = most_visited_sites_->popular_sites();
|
||||
auto* popular_sites = most_visited_sites_->popular_sites();
|
||||
value.SetString("popular.url", popular_sites->GetURLToFetch().spec());
|
||||
value.SetString("popular.country", popular_sites->GetCountryToFetch());
|
||||
value.SetString("popular.version", popular_sites->GetVersionToFetch());
|
||||
|
@ -148,7 +148,7 @@ void HQPPerfTestOnePopularURL::PrepareData() {
|
||||
void HQPPerfTestOnePopularURL::PrintMeasurements(
|
||||
const std::string& trace_name,
|
||||
const std::vector<base::TimeDelta>& measurements) {
|
||||
auto test_info = ::testing::UnitTest::GetInstance()->current_test_info();
|
||||
auto* test_info = ::testing::UnitTest::GetInstance()->current_test_info();
|
||||
|
||||
std::string durations;
|
||||
for (const auto& measurement : measurements)
|
||||
|
@ -104,8 +104,7 @@ void CredentialManagerImpl::OnProvisionalSaveComplete() {
|
||||
// If this is a federated credential, check it against the federated matches
|
||||
// produced by the PasswordFormManager. If a match is found, update it and
|
||||
// return.
|
||||
for (const auto& match :
|
||||
form_manager_->form_fetcher()->GetFederatedMatches()) {
|
||||
for (auto* match : form_manager_->form_fetcher()->GetFederatedMatches()) {
|
||||
if (match->username_value == form.username_value &&
|
||||
match->federation_origin.IsSameOriginWith(form.federation_origin)) {
|
||||
form_manager_->Update(*match);
|
||||
|
@ -1288,7 +1288,7 @@ base::Optional<PasswordForm> PasswordFormManager::UpdatePendingAndGetOldKey(
|
||||
DCHECK(best_matches_.end() != updated_password_it);
|
||||
const base::string16& old_password =
|
||||
updated_password_it->second->password_value;
|
||||
for (const auto& not_best_match : not_best_matches_) {
|
||||
for (auto* not_best_match : not_best_matches_) {
|
||||
if (not_best_match->username_value ==
|
||||
pending_credentials_.username_value &&
|
||||
not_best_match->password_value == old_password) {
|
||||
|
@ -78,7 +78,7 @@ PolicyServiceImpl::PolicyServiceImpl(const Providers& providers)
|
||||
for (int domain = 0; domain < POLICY_DOMAIN_SIZE; ++domain)
|
||||
initialization_complete_[domain] = true;
|
||||
providers_ = providers;
|
||||
for (auto provider : providers) {
|
||||
for (auto* provider : providers) {
|
||||
provider->AddObserver(this);
|
||||
for (int domain = 0; domain < POLICY_DOMAIN_SIZE; ++domain) {
|
||||
initialization_complete_[domain] &=
|
||||
@ -92,7 +92,7 @@ PolicyServiceImpl::PolicyServiceImpl(const Providers& providers)
|
||||
|
||||
PolicyServiceImpl::~PolicyServiceImpl() {
|
||||
DCHECK(thread_checker_.CalledOnValidThread());
|
||||
for (auto provider : providers_)
|
||||
for (auto* provider : providers_)
|
||||
provider->RemoveObserver(this);
|
||||
}
|
||||
|
||||
@ -147,9 +147,9 @@ void PolicyServiceImpl::RefreshPolicies(const base::Closure& callback) {
|
||||
} else {
|
||||
// Some providers might invoke OnUpdatePolicy synchronously while handling
|
||||
// RefreshPolicies. Mark all as pending before refreshing.
|
||||
for (auto provider : providers_)
|
||||
for (auto* provider : providers_)
|
||||
refresh_pending_.insert(provider);
|
||||
for (auto provider : providers_)
|
||||
for (auto* provider : providers_)
|
||||
provider->RefreshPolicies();
|
||||
}
|
||||
}
|
||||
@ -188,7 +188,7 @@ void PolicyServiceImpl::MergeAndTriggerUpdates() {
|
||||
// Merge from each provider in their order of priority.
|
||||
const PolicyNamespace chrome_namespace(POLICY_DOMAIN_CHROME, std::string());
|
||||
PolicyBundle bundle;
|
||||
for (auto provider : providers_) {
|
||||
for (auto* provider : providers_) {
|
||||
PolicyBundle provided_bundle;
|
||||
provided_bundle.CopyFrom(provider->policies());
|
||||
RemapProxyPolicies(&provided_bundle.Get(chrome_namespace));
|
||||
@ -248,7 +248,7 @@ void PolicyServiceImpl::CheckInitializationComplete() {
|
||||
PolicyDomain policy_domain = static_cast<PolicyDomain>(domain);
|
||||
|
||||
bool all_complete = true;
|
||||
for (auto provider : providers_) {
|
||||
for (auto* provider : providers_) {
|
||||
if (!provider->IsInitializationComplete(policy_domain)) {
|
||||
all_complete = false;
|
||||
break;
|
||||
|
@ -486,12 +486,12 @@ std::unique_ptr<PrecacheUnfinishedWork> PrecacheFetcher::CancelPrecaching() {
|
||||
unfinished_work_->add_top_host()->set_hostname(top_host.hostname);
|
||||
}
|
||||
for (const auto& resource : resources_fetching_) {
|
||||
auto new_resource = unfinished_work_->add_resource();
|
||||
auto* new_resource = unfinished_work_->add_resource();
|
||||
new_resource->set_url(resource.url.spec());
|
||||
new_resource->set_top_host_name(resource.referrer);
|
||||
}
|
||||
for (const auto& resource : resources_to_fetch_) {
|
||||
auto new_resource = unfinished_work_->add_resource();
|
||||
auto* new_resource = unfinished_work_->add_resource();
|
||||
new_resource->set_url(resource.url.spec());
|
||||
new_resource->set_top_host_name(resource.referrer);
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ TEST_F(DefaultSearchPolicyHandlerTest, InvalidType) {
|
||||
PolicyMap policy;
|
||||
BuildDefaultSearchPolicy(&policy);
|
||||
|
||||
for (auto policy_name : kPolicyNamesToCheck) {
|
||||
for (auto* policy_name : kPolicyNamesToCheck) {
|
||||
// Check that policy can be successfully applied first.
|
||||
UpdateProviderPolicy(policy);
|
||||
const base::Value* temp = nullptr;
|
||||
|
4
components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc
4
components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc
@ -733,7 +733,7 @@ TEST_P(ContentSubresourceFilterDriverFactoryActivationScopeTest,
|
||||
"chrome-extension://some-extension", "file:///var/www/index.html"};
|
||||
const char* supported_urls[] = {"http://example.test",
|
||||
"https://example.test"};
|
||||
for (const auto url : unsupported_urls) {
|
||||
for (auto* url : unsupported_urls) {
|
||||
SCOPED_TRACE(url);
|
||||
RedirectChainMatchPattern expected_pattern = EMPTY;
|
||||
NavigateAndExpectActivation(
|
||||
@ -742,7 +742,7 @@ TEST_P(ContentSubresourceFilterDriverFactoryActivationScopeTest,
|
||||
? ActivationDecision::ACTIVATION_DISABLED
|
||||
: ActivationDecision::UNSUPPORTED_SCHEME);
|
||||
}
|
||||
for (const auto url : supported_urls) {
|
||||
for (auto* url : supported_urls) {
|
||||
SCOPED_TRACE(url);
|
||||
RedirectChainMatchPattern expected_pattern =
|
||||
test_data.url_matches_activation_list ? NO_REDIRECTS_HIT : EMPTY;
|
||||
|
@ -72,7 +72,7 @@ TEST(FirstPartyOriginTest, EmptyHostUrls) {
|
||||
};
|
||||
|
||||
FirstPartyOrigin first_party(url::Origin(GURL("https://example.com")));
|
||||
for (const auto& url_string : kUrls) {
|
||||
for (auto* url_string : kUrls) {
|
||||
GURL url(url_string);
|
||||
EXPECT_TRUE(FirstPartyOrigin::IsThirdParty(url, first_party.origin()));
|
||||
EXPECT_TRUE(first_party.IsThirdParty(url));
|
||||
|
@ -41,7 +41,7 @@ std::vector<uint8_t> SerializeUnindexedRulesetWithMultipleRules(
|
||||
ruleset_writer.AddUrlRule(rule);
|
||||
ruleset_writer.Finish();
|
||||
|
||||
auto data = reinterpret_cast<const uint8_t*>(ruleset_contents.data());
|
||||
auto* data = reinterpret_cast<const uint8_t*>(ruleset_contents.data());
|
||||
return std::vector<uint8_t>(data, data + ruleset_contents.size());
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ security_state::SecurityLevel ToolbarModelImpl::GetSecurityLevel(
|
||||
|
||||
const gfx::VectorIcon& ToolbarModelImpl::GetVectorIcon() const {
|
||||
#if !defined(OS_ANDROID) && !defined(OS_IOS)
|
||||
const auto icon_override = delegate_->GetVectorIconOverride();
|
||||
auto* const icon_override = delegate_->GetVectorIconOverride();
|
||||
if (icon_override)
|
||||
return *icon_override;
|
||||
|
||||
|
@ -67,7 +67,7 @@ class ProtoZeroConformanceTest : public ::testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(ProtoZeroConformanceTest, SimpleFieldsNoNesting) {
|
||||
auto msg = CreateMessage<pbtest::EveryField>();
|
||||
auto* msg = CreateMessage<pbtest::EveryField>();
|
||||
|
||||
msg->set_field_int32(-1);
|
||||
msg->set_field_int64(-333123456789ll);
|
||||
@ -126,7 +126,7 @@ TEST_F(ProtoZeroConformanceTest, SimpleFieldsNoNesting) {
|
||||
}
|
||||
|
||||
TEST_F(ProtoZeroConformanceTest, NestedMessages) {
|
||||
auto msg_a = CreateMessage<pbtest::NestedA>();
|
||||
auto* msg_a = CreateMessage<pbtest::NestedA>();
|
||||
|
||||
pbtest::NestedA::NestedB* msg_b = msg_a->add_repeated_a();
|
||||
pbtest::NestedA::NestedB::NestedC* msg_c = msg_b->set_value_b();
|
||||
|
@ -302,7 +302,7 @@ bool ParseAppTag(xmlNode* app,
|
||||
static const char* attrs[] = {UpdateResponse::Result::kCohort,
|
||||
UpdateResponse::Result::kCohortHint,
|
||||
UpdateResponse::Result::kCohortName};
|
||||
for (const auto& attr : attrs) {
|
||||
for (auto* attr : attrs) {
|
||||
auto value = GetAttributePtr(app, attr);
|
||||
if (value)
|
||||
result->cohort_attrs.insert({attr, *value});
|
||||
|
@ -87,7 +87,7 @@ BrowserAccessibility* AXPlatformPosition::GetNodeInTree(AXTreeID tree_id,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto manager = BrowserAccessibilityManager::FromID(tree_id);
|
||||
auto* manager = BrowserAccessibilityManager::FromID(tree_id);
|
||||
if (!manager)
|
||||
return nullptr;
|
||||
return manager->GetFromID(node_id);
|
||||
|
@ -106,7 +106,7 @@ void IndexedDBTransactionCoordinator::ProcessQueuedTransactions() {
|
||||
// data. ("Version change" transactions are exclusive, but handled by the
|
||||
// connection sequencing in IndexedDBDatabase.)
|
||||
std::set<int64_t> locked_scope;
|
||||
for (const auto& transaction : started_transactions_) {
|
||||
for (auto* transaction : started_transactions_) {
|
||||
if (transaction->mode() == blink::WebIDBTransactionModeReadWrite) {
|
||||
// Started read/write transactions have exclusive access to the object
|
||||
// stores within their scopes.
|
||||
|
@ -113,8 +113,8 @@ void PopulateResourceResponse(ResourceRequestInfoImpl* info,
|
||||
request->ssl_info().cert->os_cert_handle(), &encoded);
|
||||
DCHECK(rv);
|
||||
response->head.certificate.push_back(encoded);
|
||||
for (auto& cert :
|
||||
request->ssl_info().cert->GetIntermediateCertificates()) {
|
||||
for (auto* cert :
|
||||
request->ssl_info().cert->GetIntermediateCertificates()) {
|
||||
rv = net::X509Certificate::GetDEREncoded(cert, &encoded);
|
||||
DCHECK(rv);
|
||||
response->head.certificate.push_back(encoded);
|
||||
|
@ -34,11 +34,11 @@ void AudioFocusManager::RequestAudioFocus(MediaSessionImpl* media_session,
|
||||
// up the relation between AudioFocusManager and MediaSessionImpl.
|
||||
// See https://crbug.com/651069
|
||||
if (type == AudioFocusType::GainTransientMayDuck) {
|
||||
for (const auto old_session : audio_focus_stack_) {
|
||||
for (auto* old_session : audio_focus_stack_) {
|
||||
old_session->StartDucking();
|
||||
}
|
||||
} else {
|
||||
for (const auto old_session : audio_focus_stack_) {
|
||||
for (auto* old_session : audio_focus_stack_) {
|
||||
if (old_session->IsActive()) {
|
||||
if (old_session->HasPepper())
|
||||
old_session->StartDucking();
|
||||
|
@ -199,7 +199,7 @@ TEST_F(MemoryCoordinatorImplTest, ChildRemovedOnConnectionError) {
|
||||
}
|
||||
|
||||
TEST_F(MemoryCoordinatorImplTest, SetMemoryStateFailsInvalidState) {
|
||||
auto cmc1 = coordinator_->CreateChildMemoryCoordinator(1);
|
||||
auto* cmc1 = coordinator_->CreateChildMemoryCoordinator(1);
|
||||
|
||||
EXPECT_FALSE(
|
||||
coordinator_->SetChildMemoryState(1, MemoryState::UNKNOWN));
|
||||
@ -207,7 +207,7 @@ TEST_F(MemoryCoordinatorImplTest, SetMemoryStateFailsInvalidState) {
|
||||
}
|
||||
|
||||
TEST_F(MemoryCoordinatorImplTest, SetMemoryStateFailsInvalidRenderer) {
|
||||
auto cmc1 = coordinator_->CreateChildMemoryCoordinator(1);
|
||||
auto* cmc1 = coordinator_->CreateChildMemoryCoordinator(1);
|
||||
|
||||
EXPECT_FALSE(
|
||||
coordinator_->SetChildMemoryState(2, MemoryState::THROTTLED));
|
||||
@ -215,7 +215,7 @@ TEST_F(MemoryCoordinatorImplTest, SetMemoryStateFailsInvalidRenderer) {
|
||||
}
|
||||
|
||||
TEST_F(MemoryCoordinatorImplTest, SetMemoryStateNotDeliveredNop) {
|
||||
auto cmc1 = coordinator_->CreateChildMemoryCoordinator(1);
|
||||
auto* cmc1 = coordinator_->CreateChildMemoryCoordinator(1);
|
||||
|
||||
EXPECT_FALSE(
|
||||
coordinator_->SetChildMemoryState(2, MemoryState::NORMAL));
|
||||
@ -223,8 +223,8 @@ TEST_F(MemoryCoordinatorImplTest, SetMemoryStateNotDeliveredNop) {
|
||||
}
|
||||
|
||||
TEST_F(MemoryCoordinatorImplTest, SetMemoryStateDelivered) {
|
||||
auto cmc1 = coordinator_->CreateChildMemoryCoordinator(1);
|
||||
auto cmc2 = coordinator_->CreateChildMemoryCoordinator(2);
|
||||
auto* cmc1 = coordinator_->CreateChildMemoryCoordinator(1);
|
||||
auto* cmc2 = coordinator_->CreateChildMemoryCoordinator(2);
|
||||
|
||||
EXPECT_TRUE(
|
||||
coordinator_->SetChildMemoryState(1, MemoryState::THROTTLED));
|
||||
@ -248,7 +248,7 @@ TEST_F(MemoryCoordinatorImplTest, PurgeMemoryChild) {
|
||||
}
|
||||
|
||||
TEST_F(MemoryCoordinatorImplTest, SetChildMemoryState) {
|
||||
auto cmc = coordinator_->CreateChildMemoryCoordinator(1);
|
||||
auto* cmc = coordinator_->CreateChildMemoryCoordinator(1);
|
||||
auto iter = coordinator_->children().find(1);
|
||||
auto* render_process_host = coordinator_->GetMockRenderProcessHost(1);
|
||||
ASSERT_TRUE(iter != coordinator_->children().end());
|
||||
|
@ -520,7 +520,7 @@ void MediaDevicesManager::NotifyDeviceChangeSubscribers(
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
DCHECK(IsValidMediaDeviceType(type));
|
||||
|
||||
for (const auto& subscriber : device_change_subscribers_[type]) {
|
||||
for (auto* subscriber : device_change_subscribers_[type]) {
|
||||
subscriber->OnDevicesChanged(type, snapshot);
|
||||
}
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ void RenderWidgetHostInputEventRouter::SendMouseEnterOrLeaveEvents(
|
||||
|
||||
gfx::Point transformed_point;
|
||||
// Send MouseLeaves.
|
||||
for (auto view : exited_views) {
|
||||
for (auto* view : exited_views) {
|
||||
blink::WebMouseEvent mouse_leave(*event);
|
||||
mouse_leave.setType(blink::WebInputEvent::MouseLeave);
|
||||
// There is a chance of a race if the last target has recently created a
|
||||
@ -512,7 +512,7 @@ void RenderWidgetHostInputEventRouter::SendMouseEnterOrLeaveEvents(
|
||||
}
|
||||
|
||||
// Send MouseMoves to trigger MouseEnter handlers.
|
||||
for (auto view : entered_views) {
|
||||
for (auto* view : entered_views) {
|
||||
if (view == target)
|
||||
continue;
|
||||
blink::WebMouseEvent mouse_enter(*event);
|
||||
@ -702,7 +702,7 @@ void RenderWidgetHostInputEventRouter::RouteTouchscreenGestureEvent(
|
||||
// TODO(wjmaclean,kenrb,tdresser): When scroll latching lands, we can
|
||||
// revisit how this code should work.
|
||||
// https://crbug.com/526463
|
||||
auto rwhi =
|
||||
auto* rwhi =
|
||||
static_cast<RenderWidgetHostImpl*>(root_view->GetRenderWidgetHost());
|
||||
// If the root view is the current gesture target, then we explicitly don't
|
||||
// send a GestureScrollBegin, as by the time we see GesturePinchBegin there
|
||||
@ -720,7 +720,7 @@ void RenderWidgetHostInputEventRouter::RouteTouchscreenGestureEvent(
|
||||
in_touchscreen_gesture_pinch_ = false;
|
||||
// If the root view wasn't already receiving the gesture stream, then we
|
||||
// need to wrap the diverted pinch events in a GestureScrollBegin/End.
|
||||
auto rwhi =
|
||||
auto* rwhi =
|
||||
static_cast<RenderWidgetHostImpl*>(root_view->GetRenderWidgetHost());
|
||||
if (root_view != touchscreen_gesture_target_.target &&
|
||||
gesture_pinch_did_send_scroll_begin_ &&
|
||||
|
@ -814,7 +814,7 @@ TEST_F(RenderWidgetHostTest, ResizeScreenInfo) {
|
||||
screen_info.orientation_angle = 0;
|
||||
screen_info.orientation_type = SCREEN_ORIENTATION_VALUES_PORTRAIT_PRIMARY;
|
||||
|
||||
auto host_delegate =
|
||||
auto* host_delegate =
|
||||
static_cast<MockRenderWidgetHostDelegate*>(host_->delegate());
|
||||
|
||||
host_delegate->SetScreenInfo(screen_info);
|
||||
|
@ -1593,7 +1593,7 @@ TEST_F(RenderWidgetHostViewAuraTest, PhysicalBackingSizeWithScale) {
|
||||
// which sends a ViewMsg_Resize::ID message to the renderer.
|
||||
EXPECT_EQ(1u, sink_->message_count());
|
||||
EXPECT_EQ(ViewMsg_Resize::ID, sink_->GetMessageAt(0)->type());
|
||||
auto view_delegate = static_cast<MockRenderWidgetHostDelegate*>(
|
||||
auto* view_delegate = static_cast<MockRenderWidgetHostDelegate*>(
|
||||
static_cast<RenderWidgetHostImpl*>(view_->GetRenderWidgetHost())
|
||||
->delegate());
|
||||
EXPECT_EQ(2.0f, view_delegate->get_last_device_scale_factor());
|
||||
|
@ -259,7 +259,7 @@ void ForeignFetchRequestHandler::DidFindRegistration(
|
||||
return;
|
||||
}
|
||||
|
||||
auto request_info = ResourceRequestInfo::ForRequest(job->request());
|
||||
auto* request_info = ResourceRequestInfo::ForRequest(job->request());
|
||||
base::Callback<WebContents*(void)> web_contents_getter;
|
||||
if (request_info)
|
||||
web_contents_getter = request_info->GetWebContentsGetterForRequest();
|
||||
|
@ -930,7 +930,7 @@ RenderWidgetHostView* WebContentsImpl::GetTopLevelRenderWidgetHostView() {
|
||||
|
||||
RenderWidgetHostView* WebContentsImpl::GetFullscreenRenderWidgetHostView()
|
||||
const {
|
||||
if (auto widget_host = GetFullscreenRenderWidgetHost())
|
||||
if (auto* widget_host = GetFullscreenRenderWidgetHost())
|
||||
return widget_host->GetView();
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ DropData* WebContentsViewChildFrame::GetDropData() const {
|
||||
}
|
||||
|
||||
void WebContentsViewChildFrame::UpdateDragCursor(WebDragOperation operation) {
|
||||
if (auto view = GetOuterDelegateView())
|
||||
if (auto* view = GetOuterDelegateView())
|
||||
view->UpdateDragCursor(operation);
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ void WebContentsViewChildFrame::StartDragging(
|
||||
const gfx::Vector2d& image_offset,
|
||||
const DragEventSourceInfo& event_info,
|
||||
RenderWidgetHostImpl* source_rwh) {
|
||||
if (auto view = GetOuterDelegateView()) {
|
||||
if (auto* view = GetOuterDelegateView()) {
|
||||
view->StartDragging(
|
||||
drop_data, ops, image, image_offset, event_info, source_rwh);
|
||||
} else {
|
||||
|
@ -115,7 +115,7 @@ WebSocketManager::~WebSocketManager() {
|
||||
if (!context_destroyed_ && url_request_context_getter_)
|
||||
url_request_context_getter_->RemoveObserver(this);
|
||||
|
||||
for (auto impl : impls_) {
|
||||
for (auto* impl : impls_) {
|
||||
impl->GoAway();
|
||||
delete impl;
|
||||
}
|
||||
@ -225,7 +225,7 @@ void WebSocketManager::OnLostConnectionToClient(WebSocketImpl* impl) {
|
||||
void WebSocketManager::OnContextShuttingDown() {
|
||||
context_destroyed_ = true;
|
||||
url_request_context_getter_ = nullptr;
|
||||
for (const auto& impl : impls_) {
|
||||
for (auto* impl : impls_) {
|
||||
impl->GoAway();
|
||||
delete impl;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ void RegisterContentSchemes(bool lock_schemes) {
|
||||
// Combine the default savable schemes with the additional ones given.
|
||||
delete savable_schemes;
|
||||
savable_schemes = new std::vector<std::string>;
|
||||
for (auto& default_scheme : kDefaultSavableSchemes)
|
||||
for (auto* default_scheme : kDefaultSavableSchemes)
|
||||
savable_schemes->push_back(default_scheme);
|
||||
savable_schemes->insert(savable_schemes->end(),
|
||||
schemes.savable_schemes.begin(),
|
||||
|
@ -123,7 +123,7 @@ void ImageDownloaderBase::DidFetchImage(
|
||||
}
|
||||
|
||||
void ImageDownloaderBase::OnDestruct() {
|
||||
for (auto fetchers : image_fetchers_) {
|
||||
for (auto* fetchers : image_fetchers_) {
|
||||
// Will run callbacks with an empty image vector.
|
||||
fetchers->OnRenderFrameDestruct();
|
||||
}
|
||||
|
@ -716,7 +716,7 @@ TEST_F(PresentationDispatcherTest,
|
||||
|
||||
// Set up |availability_set_| and |listening_status_|
|
||||
base::RunLoop run_loop;
|
||||
for (auto& mock_observer : mock_observers_) {
|
||||
for (auto* mock_observer : mock_observers_) {
|
||||
client()->getAvailability(
|
||||
mock_observer->urls(),
|
||||
base::MakeUnique<WebPresentationAvailabilityCallbacks>());
|
||||
|
@ -319,7 +319,7 @@ void MockWebSpeechRecognizer::RunTaskFromQueue() {
|
||||
}
|
||||
|
||||
bool MockWebSpeechRecognizer::HasPendingNewContextTasks() const {
|
||||
for (const auto& task : task_queue_) {
|
||||
for (auto* task : task_queue_) {
|
||||
if (task->isNewContextTask())
|
||||
return true;
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ void MockBatteryObject::AppendAllPropertiesToWriter(
|
||||
dbus::MessageWriter array_writer(nullptr);
|
||||
dbus::MessageWriter dict_entry_writer(nullptr);
|
||||
writer->OpenArray("{sv}", &array_writer);
|
||||
for (auto property_name :
|
||||
for (auto* property_name :
|
||||
{kUPowerDevicePropertyIsPresent, kUPowerDevicePropertyState,
|
||||
kUPowerDevicePropertyTimeToEmpty, kUPowerDevicePropertyTimeToFull,
|
||||
kUPowerDevicePropertyType}) {
|
||||
|
@ -53,7 +53,7 @@ void GamepadDataFetcherManager::InitializeProvider(GamepadProvider* provider) {
|
||||
DCHECK(!provider_);
|
||||
|
||||
provider_ = provider;
|
||||
for (const auto& it : factories_) {
|
||||
for (auto* it : factories_) {
|
||||
provider_->AddGamepadDataFetcher(it->CreateDataFetcher());
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ OverscanTracker::OverscanWebObserver* OverscanTracker::GetObserver(
|
||||
if (!create)
|
||||
return nullptr;
|
||||
auto owned_observer = base::MakeUnique<OverscanWebObserver>(web_contents);
|
||||
auto observer_ptr = owned_observer.get();
|
||||
auto* observer_ptr = owned_observer.get();
|
||||
observers_[web_contents] = std::move(owned_observer);
|
||||
return observer_ptr;
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ void ImageLoader::LoadImageAtEveryScaleFactorAsync(
|
||||
scales.insert(ui::GetScaleForScaleFactor(scale));
|
||||
|
||||
// There may not be a screen in unit tests.
|
||||
auto screen = display::Screen::GetScreen();
|
||||
auto* screen = display::Screen::GetScreen();
|
||||
if (screen) {
|
||||
for (const auto& display : screen->GetAllDisplays())
|
||||
scales.insert(display.device_scale_factor());
|
||||
|
@ -99,7 +99,7 @@ class NativeExtensionBindingsSystemUnittest : public APIBindingTest {
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
for (const auto& context : raw_script_contexts_)
|
||||
for (auto* context : raw_script_contexts_)
|
||||
script_context_set_->Remove(context);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
script_context_set_.reset();
|
||||
|
@ -204,14 +204,14 @@ class EnabledStateObserverImpl final
|
||||
|
||||
void OnTraceLogEnabled() final {
|
||||
base::AutoLock lock(mutex_);
|
||||
for (auto o : observers_) {
|
||||
for (auto* o : observers_) {
|
||||
o->OnTraceEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
void OnTraceLogDisabled() final {
|
||||
base::AutoLock lock(mutex_);
|
||||
for (auto o : observers_) {
|
||||
for (auto* o : observers_) {
|
||||
o->OnTraceDisabled();
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ content::BrowserMainParts* HeadlessContentBrowserClient::CreateBrowserMainParts(
|
||||
void HeadlessContentBrowserClient::OverrideWebkitPrefs(
|
||||
content::RenderViewHost* render_view_host,
|
||||
content::WebPreferences* prefs) {
|
||||
auto browser_context = HeadlessBrowserContextImpl::From(
|
||||
auto* browser_context = HeadlessBrowserContextImpl::From(
|
||||
render_view_host->GetProcess()->GetBrowserContext());
|
||||
const base::Callback<void(headless::WebPreferences*)>& callback =
|
||||
browser_context->options()->override_web_preferences_callback();
|
||||
|
@ -46,7 +46,7 @@ class SimpleWM::WindowListModel : public aura::WindowObserver {
|
||||
}
|
||||
~WindowListModel() override {
|
||||
window_container_->RemoveObserver(this);
|
||||
for (auto window : windows_)
|
||||
for (auto* window : windows_)
|
||||
window->RemoveObserver(this);
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ class StubReadWritePermission
|
||||
|
||||
VideoCaptureDevice::Client::Buffer CreateStubBuffer(int buffer_id,
|
||||
size_t mapped_size) {
|
||||
auto buffer = new uint8_t[mapped_size];
|
||||
auto* buffer = new uint8_t[mapped_size];
|
||||
const int arbitrary_frame_feedback_id = 0;
|
||||
return VideoCaptureDevice::Client::Buffer(
|
||||
buffer_id, arbitrary_frame_feedback_id,
|
||||
|
@ -711,7 +711,7 @@ void ChunkDemuxer::OnEnabledAudioTracksChanged(
|
||||
stream->set_enabled(false, currTime);
|
||||
}
|
||||
}
|
||||
for (const auto& stream : enabled_streams) {
|
||||
for (auto* stream : enabled_streams) {
|
||||
DVLOG(1) << __func__ << ": enabling stream " << stream;
|
||||
stream->set_enabled(true, currTime);
|
||||
}
|
||||
|
@ -1654,7 +1654,7 @@ void FFmpegDemuxer::OnEnabledAudioTracksChanged(
|
||||
stream->set_enabled(false, currTime);
|
||||
}
|
||||
}
|
||||
for (const auto& stream : enabled_streams) {
|
||||
for (auto* stream : enabled_streams) {
|
||||
DCHECK(stream);
|
||||
DVLOG(1) << __func__ << ": enabling stream " << stream;
|
||||
stream->set_enabled(true, currTime);
|
||||
|
@ -795,7 +795,7 @@ bool SourceBufferState::OnNewConfigs(
|
||||
}
|
||||
|
||||
void SourceBufferState::SetStreamMemoryLimits() {
|
||||
auto cmd_line = base::CommandLine::ForCurrentProcess();
|
||||
auto* cmd_line = base::CommandLine::ForCurrentProcess();
|
||||
|
||||
std::string audio_buf_limit_switch =
|
||||
cmd_line->GetSwitchValueASCII(switches::kMSEAudioBufferSizeLimit);
|
||||
|
@ -358,7 +358,7 @@ void ConvertProtoToPipelineStatistics(
|
||||
void ConvertCdmKeyInfoToProto(
|
||||
const CdmKeysInfo& keys_information,
|
||||
pb::CdmClientOnSessionKeysChange* key_change_message) {
|
||||
for (const auto& info : keys_information) {
|
||||
for (auto* info : keys_information) {
|
||||
pb::CdmKeyInformation* key = key_change_message->add_key_information();
|
||||
key->set_key_id(info->key_id.data(), info->key_id.size());
|
||||
key->set_status(ToProtoCdmKeyInformation(info->status).value());
|
||||
|
@ -106,13 +106,13 @@ uint32_t Message::payload_num_bytes() const {
|
||||
}
|
||||
|
||||
uint32_t Message::payload_num_interface_ids() const {
|
||||
auto array_pointer =
|
||||
auto* array_pointer =
|
||||
version() < 2 ? nullptr : header_v2()->payload_interface_ids.Get();
|
||||
return array_pointer ? static_cast<uint32_t>(array_pointer->size()) : 0;
|
||||
}
|
||||
|
||||
const uint32_t* Message::payload_interface_ids() const {
|
||||
auto array_pointer =
|
||||
auto* array_pointer =
|
||||
version() < 2 ? nullptr : header_v2()->payload_interface_ids.Get();
|
||||
return array_pointer ? array_pointer->storage() : nullptr;
|
||||
}
|
||||
@ -174,7 +174,7 @@ void Message::SerializeAssociatedEndpointHandles(
|
||||
DCHECK(header_v2()->payload_interface_ids.is_null());
|
||||
|
||||
size_t size = associated_endpoint_handles_.size();
|
||||
auto data = internal::Array_Data<uint32_t>::New(size, buffer());
|
||||
auto* data = internal::Array_Data<uint32_t>::New(size, buffer());
|
||||
header_v2()->payload_interface_ids.Set(data);
|
||||
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
|
@ -64,7 +64,7 @@ bool IsValidMessageHeader(const internal::MessageHeader* header,
|
||||
if (header->version < 2)
|
||||
return true;
|
||||
|
||||
auto header_v2 = static_cast<const internal::MessageHeaderV2*>(header);
|
||||
auto* header_v2 = static_cast<const internal::MessageHeaderV2*>(header);
|
||||
// For the payload pointer:
|
||||
// - Check that the pointer can be safely decoded.
|
||||
// - Claim one byte that the pointer points to. It makes sure not only the
|
||||
|
@ -1099,7 +1099,7 @@ CookieList CookieMonster::GetAllCookies() {
|
||||
|
||||
CookieList cookie_list;
|
||||
cookie_list.reserve(cookie_ptrs.size());
|
||||
for (const auto& cookie_ptr : cookie_ptrs)
|
||||
for (auto* cookie_ptr : cookie_ptrs)
|
||||
cookie_list.push_back(*cookie_ptr);
|
||||
|
||||
return cookie_list;
|
||||
|
@ -158,7 +158,7 @@ TEST(CookieUtilTest, ParseCookieExpirationTimeBeyond2038) {
|
||||
"2039 April 15 21:01:22", "2038 April 15 21:01:22",
|
||||
};
|
||||
|
||||
for (const auto& test : kTests) {
|
||||
for (auto* test : kTests) {
|
||||
base::Time parsed_time = cookie_util::ParseCookieExpirationTime(test);
|
||||
EXPECT_FALSE(parsed_time.is_null());
|
||||
|
||||
@ -183,7 +183,7 @@ TEST(CookieUtilTest, ParseCookieExpirationTimeBefore1970) {
|
||||
"1969 March 3 21:01:22", "1600 April 15 21:01:22",
|
||||
};
|
||||
|
||||
for (const auto& test : kTests) {
|
||||
for (auto* test : kTests) {
|
||||
base::Time parsed_time = cookie_util::ParseCookieExpirationTime(test);
|
||||
EXPECT_FALSE(parsed_time.is_null());
|
||||
|
||||
|
@ -136,7 +136,7 @@ class TestNetworkStreamThrottler : public NetworkThrottleManager {
|
||||
|
||||
void UnthrottleAllRequests() {
|
||||
std::set<TestThrottle*> outstanding_throttles_copy(outstanding_throttles_);
|
||||
for (auto& throttle : outstanding_throttles_copy) {
|
||||
for (auto* throttle : outstanding_throttles_copy) {
|
||||
if (throttle->IsBlocked())
|
||||
throttle->Unthrottle();
|
||||
}
|
||||
|
@ -1819,7 +1819,7 @@ TEST_P(RemoveHeadersTest, RemoveHeaders) {
|
||||
new HttpResponseHeaders(orig_headers));
|
||||
|
||||
std::unordered_set<std::string> to_remove;
|
||||
for (const auto& header : test.to_remove) {
|
||||
for (auto* header : test.to_remove) {
|
||||
if (header)
|
||||
to_remove.insert(header);
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ DecodeStatus PingPayloadDecoder::StartDecodingPayload(FrameDecoderState* state,
|
||||
// This supports the claim that this decoder is (mostly) non-buffering.
|
||||
static_assert(sizeof(Http2PingFields) == kOpaqueSize,
|
||||
"If not, then can't enter this block!");
|
||||
auto ping = reinterpret_cast<const Http2PingFields*>(db->cursor());
|
||||
auto* ping = reinterpret_cast<const Http2PingFields*>(db->cursor());
|
||||
if (frame_header.IsAck()) {
|
||||
state->listener()->OnPingAck(frame_header, *ping);
|
||||
} else {
|
||||
|
@ -10,7 +10,7 @@ namespace net {
|
||||
namespace {
|
||||
|
||||
std::vector<HpackStringPair>* MakeStaticTable() {
|
||||
auto ptr = new std::vector<HpackStringPair>();
|
||||
auto* ptr = new std::vector<HpackStringPair>();
|
||||
ptr->reserve(kFirstDynamicTableIndex);
|
||||
ptr->emplace_back("", "");
|
||||
|
||||
|
@ -368,7 +368,7 @@ size_t HuffmanBitBuffer::AppendBytes(StringPiece input) {
|
||||
|
||||
// Top up |accumulator_| until there isn't room for a whole byte.
|
||||
size_t bytes_used = 0;
|
||||
auto ptr = reinterpret_cast<const uint8_t*>(input.data());
|
||||
auto* ptr = reinterpret_cast<const uint8_t*>(input.data());
|
||||
do {
|
||||
auto b = static_cast<HuffmanAccumulator>(*ptr++);
|
||||
free_cnt -= 8;
|
||||
|
@ -170,7 +170,7 @@ void MockProxyResolverV8Tracing::GetProxyForURL(
|
||||
std::unique_ptr<ProxyResolver::Request>* request,
|
||||
std::unique_ptr<Bindings> bindings) {
|
||||
pending_jobs_.push_back(base::WrapUnique(new Job()));
|
||||
auto pending_job = pending_jobs_.back().get();
|
||||
auto* pending_job = pending_jobs_.back().get();
|
||||
pending_job->url = url;
|
||||
pending_job->results = results;
|
||||
pending_job->SetCallback(callback);
|
||||
|
@ -128,7 +128,7 @@ TEST_F(QuicStreamSequencerBufferTest, OnStreamDataWithinBlock) {
|
||||
std::list<Gap> gaps = helper_->GetGaps();
|
||||
EXPECT_EQ(800u, gaps.front().end_offset);
|
||||
EXPECT_EQ(1824u, gaps.back().begin_offset);
|
||||
auto frame_map = helper_->frame_arrival_time_map();
|
||||
auto* frame_map = helper_->frame_arrival_time_map();
|
||||
EXPECT_EQ(1u, frame_map->size());
|
||||
EXPECT_EQ(800u, frame_map->begin()->first);
|
||||
EXPECT_EQ(t, (*frame_map)[800].timestamp);
|
||||
@ -167,7 +167,7 @@ TEST_F(QuicStreamSequencerBufferTest, OnStreamDataWithOverlap) {
|
||||
buffer_->OnStreamData(0, source, t2, &written, &error_details_));
|
||||
EXPECT_EQ(QUIC_OVERLAPPING_STREAM_DATA,
|
||||
buffer_->OnStreamData(1024, source, t2, &written, &error_details_));
|
||||
auto frame_map = helper_->frame_arrival_time_map();
|
||||
auto* frame_map = helper_->frame_arrival_time_map();
|
||||
EXPECT_EQ(1u, frame_map->size());
|
||||
EXPECT_EQ(t1, (*frame_map)[800].timestamp);
|
||||
}
|
||||
@ -198,7 +198,7 @@ TEST_F(QuicStreamSequencerBufferTest,
|
||||
EXPECT_EQ(QUIC_NO_ERROR,
|
||||
buffer_->OnStreamData(1824, one_byte, clock_.ApproximateNow(),
|
||||
&written, &error_details_));
|
||||
auto frame_map = helper_->frame_arrival_time_map();
|
||||
auto* frame_map = helper_->frame_arrival_time_map();
|
||||
EXPECT_EQ(3u, frame_map->size());
|
||||
EXPECT_TRUE(helper_->CheckBufferInvariants());
|
||||
}
|
||||
|
@ -43,8 +43,8 @@ TEST(QuicTextUtilsText, ToLower) {
|
||||
TEST(QuicTextUtilsText, RemoveLeadingAndTrailingWhitespace) {
|
||||
string input;
|
||||
|
||||
for (auto input : {"text", " text", " text", "text ", "text ", " text ",
|
||||
" text ", "\r\n\ttext", "text\n\r\t"}) {
|
||||
for (auto* input : {"text", " text", " text", "text ", "text ", " text ",
|
||||
" text ", "\r\n\ttext", "text\n\r\t"}) {
|
||||
StringPiece piece(input);
|
||||
QuicTextUtils::RemoveLeadingAndTrailingWhitespace(&piece);
|
||||
EXPECT_EQ("text", piece);
|
||||
|
@ -248,7 +248,7 @@ class SpdyFramerPeer {
|
||||
SpdySerializedFrame serialized_headers_old_version =
|
||||
framer->SerializeHeaders(headers);
|
||||
framer->hpack_encoder_.reset(nullptr);
|
||||
auto saved_debug_visitor = framer->debug_visitor_;
|
||||
auto* saved_debug_visitor = framer->debug_visitor_;
|
||||
framer->debug_visitor_ = nullptr;
|
||||
|
||||
std::vector<SpdySerializedFrame> frame_list;
|
||||
|
@ -270,7 +270,7 @@ void SpdyHeaderBlock::insert(const SpdyHeaderBlock::value_type& value) {
|
||||
} else {
|
||||
DVLOG(1) << "Updating key: " << iter->first
|
||||
<< " with value: " << value.second;
|
||||
auto storage = GetStorage();
|
||||
auto* storage = GetStorage();
|
||||
iter->second =
|
||||
HeaderValue(storage, iter->first, storage->Write(value.second));
|
||||
}
|
||||
@ -313,7 +313,7 @@ size_t SpdyHeaderBlock::EstimateMemoryUsage() const {
|
||||
|
||||
void SpdyHeaderBlock::AppendHeader(const StringPiece key,
|
||||
const StringPiece value) {
|
||||
auto storage = GetStorage();
|
||||
auto* storage = GetStorage();
|
||||
auto backed_key = storage->Write(key);
|
||||
block_.emplace(make_pair(
|
||||
backed_key, HeaderValue(storage, backed_key, storage->Write(value))));
|
||||
@ -382,7 +382,7 @@ size_t Join(char* dst,
|
||||
if (fragments.empty()) {
|
||||
return 0;
|
||||
}
|
||||
auto original_dst = dst;
|
||||
auto* original_dst = dst;
|
||||
auto it = fragments.begin();
|
||||
memcpy(dst, it->data(), it->size());
|
||||
dst += it->size();
|
||||
|
@ -382,7 +382,7 @@ void SpdySessionPool::DumpMemoryStats(
|
||||
size_t cert_count = 0;
|
||||
size_t serialized_cert_size = 0;
|
||||
size_t num_active_sessions = 0;
|
||||
for (const auto& session : sessions_) {
|
||||
for (auto* session : sessions_) {
|
||||
StreamSocket::SocketMemoryStats stats;
|
||||
bool is_session_active = false;
|
||||
total_size += session->DumpMemoryStats(&stats, &is_session_active);
|
||||
|
@ -439,7 +439,7 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
|
||||
FLAGS_quic_reloadable_flag_quic_use_cheap_stateless_rejects =
|
||||
GetParam().use_cheap_stateless_reject;
|
||||
|
||||
auto test_server = new QuicTestServer(
|
||||
auto* test_server = new QuicTestServer(
|
||||
crypto_test_utils::ProofSourceForTesting(), server_config_,
|
||||
server_supported_versions_, &response_cache_);
|
||||
server_thread_.reset(new ServerThread(test_server, server_address_));
|
||||
@ -1824,7 +1824,7 @@ TEST_P(EndToEndTest, FlowControlsSynced) {
|
||||
QuicSpdySession* const client_session = client_->client()->session();
|
||||
QuicDispatcher* dispatcher =
|
||||
QuicServerPeer::GetDispatcher(server_thread_->server());
|
||||
auto server_session = static_cast<QuicSpdySession*>(
|
||||
auto* server_session = static_cast<QuicSpdySession*>(
|
||||
dispatcher->session_map().begin()->second.get());
|
||||
ExpectFlowControlsSynced(client_session->flow_controller(),
|
||||
server_session->flow_controller());
|
||||
|
@ -23,7 +23,7 @@ HostExtensionSessionManager::~HostExtensionSessionManager() {}
|
||||
|
||||
std::string HostExtensionSessionManager::GetCapabilities() const {
|
||||
std::string capabilities;
|
||||
for (const auto& extension : extensions_) {
|
||||
for (auto* extension : extensions_) {
|
||||
const std::string& capability = extension->capability();
|
||||
if (capability.empty()) {
|
||||
continue;
|
||||
@ -44,7 +44,7 @@ void HostExtensionSessionManager::OnNegotiatedCapabilities(
|
||||
|
||||
client_stub_ = client_stub;
|
||||
|
||||
for (const auto& extension : extensions_) {
|
||||
for (auto* extension : extensions_) {
|
||||
// If the extension requires a capability that was not negotiated then do
|
||||
// not instantiate it.
|
||||
if (!extension->capability().empty() &&
|
||||
|
@ -769,14 +769,14 @@ void JingleSession::ProcessIncomingPluginMessage(
|
||||
if (!message.attachments) {
|
||||
return;
|
||||
}
|
||||
for (const auto& plugin : plugins_) {
|
||||
for (auto* plugin : plugins_) {
|
||||
plugin->OnIncomingMessage(*(message.attachments));
|
||||
}
|
||||
}
|
||||
|
||||
void JingleSession::AddPluginAttachments(JingleMessage* message) {
|
||||
DCHECK(message);
|
||||
for (const auto& plugin : plugins_) {
|
||||
for (auto* plugin : plugins_) {
|
||||
std::unique_ptr<XmlElement> attachment = plugin->GetNextMessage();
|
||||
if (attachment) {
|
||||
message->AddAttachment(std::move(attachment));
|
||||
|
@ -167,7 +167,7 @@ void SetSeccompCrashKey(const struct sandbox::arch_seccomp_data& args) {
|
||||
|
||||
size_t crash_key_length = nr.length() + arg1.length() + arg2.length() +
|
||||
arg3.length() + arg4.length();
|
||||
for (const auto& prefix : prefixes) {
|
||||
for (auto* prefix : prefixes) {
|
||||
crash_key_length += strlen(prefix);
|
||||
}
|
||||
++crash_key_length; // For the trailing NUL byte.
|
||||
@ -178,7 +178,7 @@ void SetSeccompCrashKey(const struct sandbox::arch_seccomp_data& args) {
|
||||
size_t offset = 0;
|
||||
for (size_t i = 0; i < arraysize(values); ++i) {
|
||||
const char* strings[2] = { prefixes[i], values[i] };
|
||||
for (const auto& string : strings) {
|
||||
for (auto* string : strings) {
|
||||
size_t string_len = strlen(string);
|
||||
memmove(&crash_key[offset], string, string_len);
|
||||
offset += string_len;
|
||||
|
@ -66,7 +66,7 @@ void ClientGpuMemoryBufferManager::DisconnectGpuOnThread() {
|
||||
if (!gpu_.is_bound())
|
||||
return;
|
||||
gpu_.reset();
|
||||
for (auto& waiter : pending_allocation_waiters_)
|
||||
for (auto* waiter : pending_allocation_waiters_)
|
||||
waiter->Signal();
|
||||
pending_allocation_waiters_.clear();
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ ServerWindow::~ServerWindow() {
|
||||
// parent, as destroying an active transient child may otherwise attempt to
|
||||
// refocus us.
|
||||
Windows transient_children(transient_children_);
|
||||
for (auto window : transient_children)
|
||||
for (auto* window : transient_children)
|
||||
delete window;
|
||||
DCHECK(transient_children_.empty());
|
||||
|
||||
|
@ -782,7 +782,7 @@ void WindowServer::OnSurfaceCreated(const cc::SurfaceInfo& surface_info) {
|
||||
|
||||
// FrameGenerator will add an appropriate reference for the new surface.
|
||||
DCHECK(display_manager_->GetDisplayContaining(window));
|
||||
auto display = display_manager_->GetDisplayContaining(window);
|
||||
auto* display = display_manager_->GetDisplayContaining(window);
|
||||
if (window == display->GetActiveRootWindow()) {
|
||||
display->platform_display()->GetFrameGenerator()->OnSurfaceCreated(
|
||||
surface_info);
|
||||
|
@ -51,13 +51,13 @@ struct Outputs {
|
||||
|
||||
LabelSet LabelsFor(const TargetSet& targets) {
|
||||
LabelSet labels;
|
||||
for (const auto& target : targets)
|
||||
for (auto* target : targets)
|
||||
labels.insert(target->label());
|
||||
return labels;
|
||||
}
|
||||
|
||||
bool AnyBuildFilesWereModified(const SourceFileSet& source_files) {
|
||||
for (const auto& file : source_files) {
|
||||
for (auto* file : source_files) {
|
||||
if (base::EndsWith(file->value(), ".gn", base::CompareCase::SENSITIVE) ||
|
||||
base::EndsWith(file->value(), ".gni", base::CompareCase::SENSITIVE))
|
||||
return true;
|
||||
@ -287,7 +287,7 @@ std::string Analyzer::Analyze(const std::string& input, Err* err) const {
|
||||
|
||||
TargetSet compile_targets = TargetsFor(inputs.compile_labels);
|
||||
if (inputs.compile_included_all) {
|
||||
for (auto& root : roots_)
|
||||
for (auto* root : roots_)
|
||||
compile_targets.insert(root);
|
||||
}
|
||||
TargetSet filtered_targets = Filter(compile_targets);
|
||||
@ -307,10 +307,10 @@ std::string Analyzer::Analyze(const std::string& input, Err* err) const {
|
||||
TargetSet Analyzer::AllAffectedTargets(
|
||||
const SourceFileSet& source_files) const {
|
||||
TargetSet direct_matches;
|
||||
for (const auto& source_file : source_files)
|
||||
for (auto* source_file : source_files)
|
||||
AddTargetsDirectlyReferringToFileTo(source_file, &direct_matches);
|
||||
TargetSet all_matches;
|
||||
for (const auto& match : direct_matches)
|
||||
for (auto* match : direct_matches)
|
||||
AddAllRefsTo(match, &all_matches);
|
||||
return all_matches;
|
||||
}
|
||||
@ -392,7 +392,7 @@ bool Analyzer::TargetRefersToFile(const Target* target,
|
||||
|
||||
void Analyzer::AddTargetsDirectlyReferringToFileTo(const SourceFile* file,
|
||||
TargetSet* matches) const {
|
||||
for (const auto& target : all_targets_) {
|
||||
for (auto* target : all_targets_) {
|
||||
// Only handles targets in the default toolchain.
|
||||
if ((target->label().GetToolchainLabel() == default_toolchain_) &&
|
||||
TargetRefersToFile(target, file))
|
||||
|
@ -111,7 +111,7 @@ bool ImportManager::DoImport(const SourceFile& file,
|
||||
base::TimeDelta::FromMilliseconds(20);
|
||||
if (TracingEnabled() &&
|
||||
import_block_end - import_block_begin > kImportBlockTraceThreshold) {
|
||||
auto import_block_trace =
|
||||
auto* import_block_trace =
|
||||
new TraceItem(TraceItem::TRACE_IMPORT_BLOCK, file.value(),
|
||||
base::PlatformThread::CurrentId());
|
||||
import_block_trace->set_begin(import_block_begin);
|
||||
|
@ -70,7 +70,7 @@ bool PropertyConverter::ConvertPropertyForTransport(
|
||||
if (transport_name->empty())
|
||||
return false;
|
||||
|
||||
auto image_key = static_cast<const WindowProperty<gfx::ImageSkia*>*>(key);
|
||||
auto* image_key = static_cast<const WindowProperty<gfx::ImageSkia*>*>(key);
|
||||
if (image_properties_.count(image_key) > 0) {
|
||||
const gfx::ImageSkia* value = window->GetProperty(image_key);
|
||||
if (value) {
|
||||
@ -84,25 +84,25 @@ bool PropertyConverter::ConvertPropertyForTransport(
|
||||
return true;
|
||||
}
|
||||
|
||||
auto rect_key = static_cast<const WindowProperty<gfx::Rect*>*>(key);
|
||||
auto* rect_key = static_cast<const WindowProperty<gfx::Rect*>*>(key);
|
||||
if (rect_properties_.count(rect_key) > 0) {
|
||||
*transport_value = GetArray(window, rect_key);
|
||||
return true;
|
||||
}
|
||||
|
||||
auto size_key = static_cast<const WindowProperty<gfx::Size*>*>(key);
|
||||
auto* size_key = static_cast<const WindowProperty<gfx::Size*>*>(key);
|
||||
if (size_properties_.count(size_key) > 0) {
|
||||
*transport_value = GetArray(window, size_key);
|
||||
return true;
|
||||
}
|
||||
|
||||
auto string_key = static_cast<const WindowProperty<std::string*>*>(key);
|
||||
auto* string_key = static_cast<const WindowProperty<std::string*>*>(key);
|
||||
if (string_properties_.count(string_key) > 0) {
|
||||
*transport_value = GetArray(window, string_key);
|
||||
return true;
|
||||
}
|
||||
|
||||
auto string16_key = static_cast<const WindowProperty<base::string16*>*>(key);
|
||||
auto* string16_key = static_cast<const WindowProperty<base::string16*>*>(key);
|
||||
if (string16_properties_.count(string16_key) > 0) {
|
||||
*transport_value = GetArray(window, string16_key);
|
||||
return true;
|
||||
@ -122,23 +122,23 @@ std::string PropertyConverter::GetTransportNameForPropertyKey(const void* key) {
|
||||
if (primitive_properties_.count(key) > 0)
|
||||
return primitive_properties_[key].transport_name;
|
||||
|
||||
auto image_key = static_cast<const WindowProperty<gfx::ImageSkia*>*>(key);
|
||||
auto* image_key = static_cast<const WindowProperty<gfx::ImageSkia*>*>(key);
|
||||
if (image_properties_.count(image_key) > 0)
|
||||
return image_properties_[image_key];
|
||||
|
||||
auto rect_key = static_cast<const WindowProperty<gfx::Rect*>*>(key);
|
||||
auto* rect_key = static_cast<const WindowProperty<gfx::Rect*>*>(key);
|
||||
if (rect_properties_.count(rect_key) > 0)
|
||||
return rect_properties_[rect_key];
|
||||
|
||||
auto size_key = static_cast<const WindowProperty<gfx::Size*>*>(key);
|
||||
auto* size_key = static_cast<const WindowProperty<gfx::Size*>*>(key);
|
||||
if (size_properties_.count(size_key) > 0)
|
||||
return size_properties_[size_key];
|
||||
|
||||
auto string_key = static_cast<const WindowProperty<std::string*>*>(key);
|
||||
auto* string_key = static_cast<const WindowProperty<std::string*>*>(key);
|
||||
if (string_properties_.count(string_key) > 0)
|
||||
return string_properties_[string_key];
|
||||
|
||||
auto string16_key = static_cast<const WindowProperty<base::string16*>*>(key);
|
||||
auto* string16_key = static_cast<const WindowProperty<base::string16*>*>(key);
|
||||
if (string16_properties_.count(string16_key) > 0)
|
||||
return string16_properties_[string16_key];
|
||||
|
||||
|
@ -1895,8 +1895,8 @@ TEST_F(LayerWithRealCompositorTest, AddRemoveThreadedAnimations) {
|
||||
l1->SetAnimator(LayerAnimator::CreateImplicitAnimator());
|
||||
l2->SetAnimator(LayerAnimator::CreateImplicitAnimator());
|
||||
|
||||
auto player1 = l1->GetAnimator()->GetAnimationPlayerForTesting();
|
||||
auto player2 = l2->GetAnimator()->GetAnimationPlayerForTesting();
|
||||
auto* player1 = l1->GetAnimator()->GetAnimationPlayerForTesting();
|
||||
auto* player2 = l2->GetAnimator()->GetAnimationPlayerForTesting();
|
||||
|
||||
EXPECT_FALSE(player1->has_any_animation());
|
||||
|
||||
|
@ -114,7 +114,7 @@ void GestureRecognizerImpl::CancelActiveTouchesExcept(
|
||||
consumers.push_back(entry.first);
|
||||
}
|
||||
|
||||
for (auto consumer : consumers)
|
||||
for (auto* consumer : consumers)
|
||||
CancelActiveTouches(consumer);
|
||||
}
|
||||
|
||||
|
@ -594,7 +594,7 @@ ImageSkia ImageSkiaOperations::CreateImageWithDropShadow(
|
||||
ImageSkia ImageSkiaOperations::CreateHorizontalShadow(
|
||||
const std::vector<ShadowValue>& shadows,
|
||||
bool fades_down) {
|
||||
auto source = new HorizontalShadowSource(shadows, fades_down);
|
||||
auto* source = new HorizontalShadowSource(shadows, fades_down);
|
||||
return ImageSkia(source, source->size());
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ const ShadowDetails& ShadowDetails::Get(int elevation, int corner_radius) {
|
||||
// To see what this looks like for elevation 24, try this CSS:
|
||||
// box-shadow: 0 24px 48px rgba(0, 0, 0, .24),
|
||||
// 0 0 24px rgba(0, 0, 0, .12);
|
||||
auto source = new ShadowNineboxSource(shadow->values, corner_radius);
|
||||
auto* source = new ShadowNineboxSource(shadow->values, corner_radius);
|
||||
shadow->ninebox_image = ImageSkia(source, source->size());
|
||||
return *shadow;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace {
|
||||
bool ShouldShowNotificationAsPopup(
|
||||
const Notification& notification,
|
||||
const NotificationBlockers& blockers) {
|
||||
for (const auto& blocker : blockers) {
|
||||
for (auto* blocker : blockers) {
|
||||
if (!blocker->ShouldShowNotificationAsPopup(notification))
|
||||
return false;
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ void MessageListView::ResetRepositionSession() {
|
||||
has_deferred_task_ = false;
|
||||
// cancel cause OnBoundsAnimatorDone which deletes |deleted_when_done_|.
|
||||
animator_.Cancel();
|
||||
for (auto view : deleting_views_)
|
||||
for (auto* view : deleting_views_)
|
||||
delete view;
|
||||
deleting_views_.clear();
|
||||
adding_views_.clear();
|
||||
@ -230,7 +230,7 @@ void MessageListView::RemoveObserver(MessageListView::Observer* observer) {
|
||||
void MessageListView::OnBoundsAnimatorProgressed(
|
||||
views::BoundsAnimator* animator) {
|
||||
DCHECK_EQ(&animator_, animator);
|
||||
for (auto view : deleted_when_done_) {
|
||||
for (auto* view : deleted_when_done_) {
|
||||
const gfx::SlideAnimation* animation = animator->GetAnimationForView(view);
|
||||
if (animation)
|
||||
view->layer()->SetOpacity(animation->CurrentValueBetween(1.0, 0.0));
|
||||
@ -238,7 +238,7 @@ void MessageListView::OnBoundsAnimatorProgressed(
|
||||
}
|
||||
|
||||
void MessageListView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) {
|
||||
for (auto view : deleted_when_done_)
|
||||
for (auto* view : deleted_when_done_)
|
||||
delete view;
|
||||
deleted_when_done_.clear();
|
||||
|
||||
|
@ -187,7 +187,7 @@ void MessageListViewTest::UpdateNotificationSize(
|
||||
|
||||
TEST_F(MessageListViewTest, AddNotification) {
|
||||
// Create a dummy notification.
|
||||
auto notification_view = CreateNotificationView(
|
||||
auto* notification_view = CreateNotificationView(
|
||||
Notification(NOTIFICATION_TYPE_SIMPLE, std::string(kNotificationId1),
|
||||
base::UTF8ToUTF16("title"), base::UTF8ToUTF16("message1"),
|
||||
gfx::Image(), base::UTF8ToUTF16("display source"), GURL(),
|
||||
|
@ -542,7 +542,7 @@ void NotificationView::CreateOrUpdateProgressBarView(
|
||||
|
||||
void NotificationView::CreateOrUpdateListItemViews(
|
||||
const Notification& notification) {
|
||||
for (auto item_view : item_views_)
|
||||
for (auto* item_view : item_views_)
|
||||
delete item_view;
|
||||
item_views_.clear();
|
||||
|
||||
@ -623,10 +623,10 @@ void NotificationView::CreateOrUpdateActionButtonViews(
|
||||
bool new_buttons = action_buttons_.size() != buttons.size();
|
||||
|
||||
if (new_buttons || buttons.size() == 0) {
|
||||
for (auto item : separators_)
|
||||
for (auto* item : separators_)
|
||||
delete item;
|
||||
separators_.clear();
|
||||
for (auto item : action_buttons_)
|
||||
for (auto* item : action_buttons_)
|
||||
delete item;
|
||||
action_buttons_.clear();
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ void MenuItemView::ChildrenChanged() {
|
||||
}
|
||||
}
|
||||
|
||||
for (auto item : removed_items_)
|
||||
for (auto* item : removed_items_)
|
||||
delete item;
|
||||
removed_items_.clear();
|
||||
}
|
||||
@ -599,7 +599,7 @@ MenuItemView::MenuItemView(MenuItemView* parent,
|
||||
|
||||
MenuItemView::~MenuItemView() {
|
||||
delete submenu_;
|
||||
for (auto item : removed_items_)
|
||||
for (auto* item : removed_items_)
|
||||
delete item;
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ void OverlayScrollBar::Thumb::OnStateChanged() {
|
||||
|
||||
OverlayScrollBar::OverlayScrollBar(bool horizontal)
|
||||
: BaseScrollBar(horizontal), hide_timer_(false, false) {
|
||||
auto thumb = new Thumb(this);
|
||||
auto* thumb = new Thumb(this);
|
||||
SetThumb(thumb);
|
||||
thumb->Init();
|
||||
set_notify_enter_exit_on_child(true);
|
||||
|
@ -56,7 +56,7 @@ void AddLabelledRowToGridLayout(GridLayout* layout,
|
||||
const int kPaddingRowHeight = 8;
|
||||
layout->StartRow(kRowDoesNotResizeVertically, kStretchyGridColumnSetId);
|
||||
layout->AddView(MakePlainLabel(label_text));
|
||||
for (const auto& view : views)
|
||||
for (auto* view : views)
|
||||
layout->AddView(view);
|
||||
// This gets added extraneously after the last row, but it doesn't hurt and
|
||||
// means there's no need to keep track of whether to add it or not.
|
||||
|
@ -236,11 +236,11 @@ void Column::UnifySameSizedColumnSizes() {
|
||||
|
||||
// Accumulate the size first.
|
||||
int size = 0;
|
||||
for (auto column : same_size_columns_)
|
||||
for (auto* column : same_size_columns_)
|
||||
size = std::max(size, column->Size());
|
||||
|
||||
// Then apply it.
|
||||
for (auto column : same_size_columns_)
|
||||
for (auto* column : same_size_columns_)
|
||||
column->SetSize(size);
|
||||
}
|
||||
|
||||
@ -496,7 +496,7 @@ void ColumnSet::AccumulateMasterColumns() {
|
||||
}
|
||||
|
||||
void ColumnSet::UnifySameSizedColumnSizes() {
|
||||
for (auto column : master_columns_)
|
||||
for (auto* column : master_columns_)
|
||||
column->UnifySameSizedColumnSizes();
|
||||
}
|
||||
|
||||
@ -583,7 +583,7 @@ void ColumnSet::ResetColumnXCoordinates() {
|
||||
void ColumnSet::CalculateSize() {
|
||||
gfx::Size pref;
|
||||
// Reset the preferred and remaining sizes.
|
||||
for (const auto& view_state : view_states_) {
|
||||
for (auto* view_state : view_states_) {
|
||||
if (!view_state->pref_width_fixed || !view_state->pref_height_fixed) {
|
||||
pref = view_state->view->GetPreferredSize();
|
||||
if (!view_state->pref_width_fixed)
|
||||
|
@ -146,7 +146,7 @@ class UIControlsDesktopX11 : public UIControlsAura {
|
||||
aura::test::QueryLatestMousePositionRequestInHost(host);
|
||||
host->ConvertPixelsToDIP(&root_current_location);
|
||||
|
||||
auto screen = views::test::TestDesktopScreenX11::GetInstance();
|
||||
auto* screen = views::test::TestDesktopScreenX11::GetInstance();
|
||||
DCHECK_EQ(screen, display::Screen::GetScreen());
|
||||
screen->set_cursor_screen_point(gfx::Point(screen_x, screen_y));
|
||||
|
||||
|
@ -262,7 +262,7 @@ TEST(OriginTest, SuboriginSerialization) {
|
||||
"https-so://.", "https-so://foo", "https-so://.foo", "https-so://foo.",
|
||||
};
|
||||
|
||||
for (const auto& test_case : failure_cases) {
|
||||
for (auto* test_case : failure_cases) {
|
||||
SCOPED_TRACE(test_case);
|
||||
GURL url(test_case);
|
||||
EXPECT_TRUE(url.is_valid());
|
||||
|
Reference in New Issue
Block a user