Home | History | Annotate | Download | only in socket

Lines Matching refs:group

216     const RequestQueue::iterator& it, Group* group) {
218 group->mutable_pending_requests()->erase(it);
220 if (group->pending_requests().empty())
221 group->CleanupBackupJob();
236 Group* group = GetOrCreateGroup(group_name);
244 InsertRequestIntoQueue(request, group->mutable_pending_requests());
269 Group* group = GetOrCreateGroup(group_name);
271 // RequestSocketsInternal() may delete the group.
276 group->NumActiveSocketSlots() < num_sockets &&
286 // Unexpected. The group should only be getting deleted on synchronous
294 if (!deleted_group && group->IsEmpty())
309 Group* group = GetOrCreateGroup(group_name);
313 if (AssignIdleSocketToGroup(request, group))
317 if (!preconnecting && group->TryToUsePreconnectConnectJob())
321 if (!group->HasAvailableSocketSlot(max_sockets_per_group_) &&
330 bool closed = CloseOneIdleSocketExceptInGroup(group);
334 // We could check if we really have a stalled group here, but it requires
352 handle, base::TimeDelta(), group, request->net_log());
354 AddIdleSocket(connect_job->ReleaseSocket(), group);
357 // If we don't have any sockets in this group, set a timer for potentially
361 group->IsEmpty() && !group->HasBackupJob() &&
363 group->StartBackupSocketTimer(group_name, this);
368 group->AddJob(connect_job.release());
379 base::TimeDelta(), group, request->net_log());
380 } else if (group->IsEmpty()) {
389 const Request* request, Group* group) {
390 std::list<IdleSocket>* idle_sockets = group->mutable_idle_sockets();
431 group,
465 Group* group = GetOrCreateGroup(group_name);
468 RequestQueue::iterator it = group->mutable_pending_requests()->begin();
469 for (; it != group->pending_requests().end(); ++it) {
471 scoped_ptr<const Request> req(RemoveRequestFromQueue(it, group));
476 if (group->jobs().size() && ReachedMaxSocketsLimit()) {
477 RemoveConnectJob(*group->jobs().begin(), group);
509 NOTREACHED() << "ClientSocketPool does not contain group: " << group_name
515 Group& group = *group_map_.find(group_name)->second;
518 RequestQueue::const_iterator it = group.pending_requests().begin();
519 for (size_t i = 0; it != group.pending_requests().end(); ++it, ++i) {
521 if (i < group.jobs().size()) {
523 for (ConnectJobSet::const_iterator job_it = group.jobs().begin();
524 job_it != group.jobs().end(); ++job_it) {
558 const Group* group = it->second;
562 group->pending_requests().size());
563 if (!group->pending_requests().empty()) {
565 group->TopPendingPriority());
568 group_dict->SetInteger("active_socket_count", group->active_socket_count());
572 for (idle_socket = group->idle_sockets().begin();
573 idle_socket != group->idle_sockets().end();
581 std::set<ConnectJob*>::const_iterator job = group->jobs().begin();
582 for (job = group->jobs().begin(); job != group->jobs().end(); job++) {
589 group->IsStalled(max_sockets_per_group_));
590 group_dict->SetBoolean("has_backup_job", group->HasBackupJob());
619 Group* group = i->second;
621 std::list<IdleSocket>::iterator j = group->mutable_idle_sockets()->begin();
622 while (j != group->idle_sockets().end()) {
628 j = group->mutable_idle_sockets()->erase(j);
635 // Delete group if no longer needed.
636 if (group->IsEmpty()) {
644 ClientSocketPoolBaseHelper::Group* ClientSocketPoolBaseHelper::GetOrCreateGroup(
649 Group* group = new Group;
650 group_map_[group_name] = group;
651 return group;
715 Group* group = i->second;
720 CHECK_GT(group->active_socket_count(), 0);
721 group->DecrementActiveSocketCount();
727 AddIdleSocket(socket, group);
728 OnAvailableSocketSlot(group_name, group);
737 // If we have idle sockets, see if we can give one to the top-stalled group.
739 Group* top_group = NULL;
753 // Note: we don't loop on waking stalled groups. If the stalled group is at
762 // the same priority, the winner is based on group hash ordering (and not
764 bool ClientSocketPoolBaseHelper::FindTopStalledGroup(Group** group,
766 Group* top_group = NULL;
771 Group* curr_group = i->second;
787 *group = top_group;
799 Group* group = group_it->second;
807 RemoveConnectJob(job, group);
808 if (!group->pending_requests().empty()) {
810 group->mutable_pending_requests()->begin(), group));
814 base::TimeDelta(), group, r->net_log());
818 AddIdleSocket(socket.release(), group);
819 OnAvailableSocketSlot(group_name, group);
826 if (!group->pending_requests().empty()) {
828 group->mutable_pending_requests()->begin(), group));
831 RemoveConnectJob(job, group);
835 base::TimeDelta(), group, r->net_log());
841 RemoveConnectJob(job, group);
844 OnAvailableSocketSlot(group_name, group);
862 Group* group) {
866 DCHECK(group);
867 DCHECK(ContainsKey(group->jobs(), job));
868 group->RemoveJob(job);
870 // If we've got no more jobs for this group, then we no longer need a
872 if (group->jobs().empty())
873 group->CleanupBackupJob();
880 const std::string& group_name, Group* group) {
882 if (group->IsEmpty())
884 else if (!group->pending_requests().empty())
885 ProcessPendingRequest(group_name, group);
889 const std::string& group_name, Group* group) {
891 *group->pending_requests().begin());
894 group->mutable_pending_requests()->begin(), group));
895 if (group->IsEmpty())
908 Group* group,
928 group->IncrementActiveSocketCount();
932 ClientSocket* socket, Group* group) {
938 group->mutable_idle_sockets()->push_back(idle_socket);
944 Group* group = i->second;
945 connecting_socket_count_ -= group->jobs().size();
946 group->RemoveAllJobs();
948 // Delete group if no longer needed.
949 if (group->IsEmpty()) {
963 Group* group = i->second;
966 pending_requests.swap(*group->mutable_pending_requests());
974 // Delete group if no longer needed.
975 if (group->IsEmpty()) {
1002 const Group* exception_group) {
1006 Group* group = i->second;
1007 if (exception_group == group)
1009 group->mutable_idle_sockets();
1015 if (group->IsEmpty())
1054 ClientSocketPoolBaseHelper::Group::Group()
1058 ClientSocketPoolBaseHelper::Group::~Group() {
1062 void ClientSocketPoolBaseHelper::Group::StartBackupSocketTimer(
1072 &Group::OnBackupSocketTimerFired, group_name, pool),
1076 bool ClientSocketPoolBaseHelper::Group::TryToUsePreconnectConnectJob() {
1088 void ClientSocketPoolBaseHelper::Group::OnBackupSocketTimerFired(
1123 void ClientSocketPoolBaseHelper::Group::RemoveAllJobs() {