Lines Matching refs:Group
222 // limit. To find such a request, look for a group that has more requests
225 // |max_sockets_per_group_|, then the request is stalled on the group limit,
268 Group* group = GetOrCreateGroup(group_name);
276 group->InsertPendingRequest(request.Pass());
281 if (group->IsStalledOnPoolMaxSockets(max_sockets_per_group_)) {
311 Group* group = GetOrCreateGroup(group_name);
313 // RequestSocketsInternal() may delete the group.
318 group->NumActiveSocketSlots() < num_sockets &&
328 // Unexpected. The group should only be getting deleted on synchronous
336 if (!deleted_group && group->IsEmpty())
350 Group* group = GetOrCreateGroup(group_name);
354 if (AssignIdleSocketToRequest(request, group))
361 if (!preconnecting && group->TryToUseUnassignedConnectJob())
365 if (!group->HasAvailableSocketSlot(max_sockets_per_group_) &&
368 // higher layered group. I don't think this makes sense since we would just
381 // still one in this group, but we got here due to preconnecting bypassing
382 // idle sockets, or because there's an idle socket in another group.
383 bool closed = CloseOneIdleSocketExceptInGroup(group);
387 // We could check if we really have a stalled group here, but it requires
405 group, request.net_log());
407 AddIdleSocket(connect_job->PassSocket(), group);
410 // If we don't have any sockets in this group, set a timer for potentially
413 if (connect_backup_jobs_enabled_ && group->IsEmpty()) {
414 group->StartBackupJobTimer(group_name, this);
419 group->AddJob(connect_job.Pass(), preconnecting);
431 group, request.net_log());
432 } else if (group->IsEmpty()) {
441 const Request& request, Group* group) {
442 std::list<IdleSocket>* idle_sockets = group->mutable_idle_sockets();
491 group,
523 Group* group = GetOrCreateGroup(group_name);
527 group->FindAndRemovePendingRequest(handle);
534 if (group->jobs().size() > group->pending_request_count() &&
536 RemoveConnectJob(*group->jobs().begin(), group);
566 NOTREACHED() << "ClientSocketPool does not contain group: " << group_name
572 const Group& group = *group_map_.find(group_name)->second;
574 if (group.HasConnectJobForHandle(handle)) {
576 // group.jobs().size() pending requests.
578 for (ConnectJobSet::const_iterator job_it = group.jobs().begin();
579 job_it != group.jobs().end(); ++job_it) {
585 if (group.IsStalledOnPoolMaxSockets(max_sockets_per_group_))
608 const Group* group = it->second;
612 group->pending_request_count());
613 if (group->has_pending_requests()) {
616 RequestPriorityToString(group->TopPendingPriority()));
619 group_dict->SetInteger("active_socket_count", group->active_socket_count());
623 for (idle_socket = group->idle_sockets().begin();
624 idle_socket != group->idle_sockets().end();
632 std::set<ConnectJob*>::const_iterator job = group->jobs().begin();
633 for (job = group->jobs().begin(); job != group->jobs().end(); job++) {
640 group->IsStalledOnPoolMaxSockets(
643 group->BackupJobTimerIsRunning());
676 Group* group = i->second;
678 std::list<IdleSocket>::iterator j = group->mutable_idle_sockets()->begin();
679 while (j != group->idle_sockets().end()) {
685 j = group->mutable_idle_sockets()->erase(j);
692 // Delete group if no longer needed.
693 if (group->IsEmpty()) {
701 ClientSocketPoolBaseHelper::Group* ClientSocketPoolBaseHelper::GetOrCreateGroup(
706 Group* group = new Group;
707 group_map_[group_name] = group;
708 return group;
772 Group* group = i->second;
777 CHECK_GT(group->active_socket_count(), 0);
778 group->DecrementActiveSocketCount();
784 AddIdleSocket(socket.Pass(), group);
785 OnAvailableSocketSlot(group_name, group);
794 // If we have idle sockets, see if we can give one to the top-stalled group.
796 Group* top_group = NULL;
798 // There may still be a stalled group in a lower level pool.
820 // Note: we don't loop on waking stalled groups. If the stalled group is at
829 // the same priority, the winner is based on group hash ordering (and not
832 Group** group,
834 CHECK((group && group_name) || (!group && !group_name));
835 Group* top_group = NULL;
840 Group* curr_group = i->second;
844 if (!group)
857 CHECK(group);
858 *group = top_group;
872 Group* group = group_it->second;
886 RemoveConnectJob(job, group);
887 scoped_ptr<const Request> request = group->PopNextPendingRequest();
892 request->handle(), base::TimeDelta(), group, request->net_log());
896 AddIdleSocket(socket.Pass(), group);
897 OnAvailableSocketSlot(group_name, group);
904 scoped_ptr<const Request> request = group->PopNextPendingRequest();
908 RemoveConnectJob(job, group);
913 group, request->net_log());
919 RemoveConnectJob(job, group);
922 OnAvailableSocketSlot(group_name, group);
940 Group* group) {
944 DCHECK(group);
945 group->RemoveJob(job);
949 const std::string& group_name, Group* group) {
951 if (group->IsEmpty()) {
953 } else if (group->has_pending_requests()) {
954 ProcessPendingRequest(group_name, group);
959 const std::string& group_name, Group* group) {
960 const Request* next_request = group->GetNextPendingRequest();
964 scoped_ptr<const Request> request = group->PopNextPendingRequest();
966 if (group->IsEmpty())
980 Group* group,
1001 group->IncrementActiveSocketCount();
1006 Group* group) {
1012 group->mutable_idle_sockets()->push_back(idle_socket);
1018 Group* group = i->second;
1019 connecting_socket_count_ -= group->jobs().size();
1020 group->RemoveAllJobs();
1022 // Delete group if no longer needed.
1023 if (group->IsEmpty()) {
1037 Group* group = i->second;
1040 scoped_ptr<const Request> request = group->PopNextPendingRequest();
1046 // Delete group if no longer needed.
1047 if (group->IsEmpty()) {
1076 const Group* exception_group) {
1080 Group* group = i->second;
1081 if (exception_group == group)
1083 std::list<IdleSocket>* idle_sockets = group->mutable_idle_sockets();
1089 if (group->IsEmpty())
1145 ClientSocketPoolBaseHelper::Group::Group()
1150 ClientSocketPoolBaseHelper::Group::~Group() {
1154 void ClientSocketPoolBaseHelper::Group::StartBackupJobTimer(
1165 base::Bind(&Group::OnBackupJobTimerFired, base::Unretained(this),
1169 bool ClientSocketPoolBaseHelper::Group::BackupJobTimerIsRunning() const {
1173 bool ClientSocketPoolBaseHelper::Group::TryToUseUnassignedConnectJob() {
1182 void ClientSocketPoolBaseHelper::Group::AddJob(scoped_ptr<ConnectJob> job,
1191 void ClientSocketPoolBaseHelper::Group::RemoveJob(ConnectJob* job) {
1205 // If we've got no more jobs for this group, then we no longer need a
1211 void ClientSocketPoolBaseHelper::Group::OnBackupJobTimerFired(
1246 void ClientSocketPoolBaseHelper::Group::SanityCheck() {
1250 void ClientSocketPoolBaseHelper::Group::RemoveAllJobs() {
1262 ClientSocketPoolBaseHelper::Group::GetNextPendingRequest() const {
1267 bool ClientSocketPoolBaseHelper::Group::HasConnectJobForHandle(
1282 void ClientSocketPoolBaseHelper::Group::InsertPendingRequest(
1298 ClientSocketPoolBaseHelper::Group::PopNextPendingRequest() {
1305 ClientSocketPoolBaseHelper::Group::FindAndRemovePendingRequest(
1319 ClientSocketPoolBaseHelper::Group::RemovePendingRequest(