OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/worker_host/worker_process_host.h" | 5 #include "content/browser/worker_host/worker_process_host.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 } | 504 } |
505 | 505 |
506 std::string display_title; | 506 std::string display_title; |
507 for (std::set<std::string>::iterator i = titles.begin(); | 507 for (std::set<std::string>::iterator i = titles.begin(); |
508 i != titles.end(); ++i) { | 508 i != titles.end(); ++i) { |
509 if (!display_title.empty()) | 509 if (!display_title.empty()) |
510 display_title += ", "; | 510 display_title += ", "; |
511 display_title += *i; | 511 display_title += *i; |
512 } | 512 } |
513 | 513 |
514 process_->SetName(UTF8ToUTF16(display_title)); | 514 process_->SetName(base::UTF8ToUTF16(display_title)); |
515 } | 515 } |
516 | 516 |
517 void WorkerProcessHost::DocumentDetached(WorkerMessageFilter* filter, | 517 void WorkerProcessHost::DocumentDetached(WorkerMessageFilter* filter, |
518 unsigned long long document_id) { | 518 unsigned long long document_id) { |
519 // Walk all instances and remove the document from their document set. | 519 // Walk all instances and remove the document from their document set. |
520 for (Instances::iterator i = instances_.begin(); i != instances_.end();) { | 520 for (Instances::iterator i = instances_.begin(); i != instances_.end();) { |
521 i->worker_document_set()->Remove(filter, document_id); | 521 i->worker_document_set()->Remove(filter, document_id); |
522 if (i->worker_document_set()->IsEmpty()) { | 522 if (i->worker_document_set()->IsEmpty()) { |
523 // This worker has no more associated documents - shut it down. | 523 // This worker has no more associated documents - shut it down. |
524 Send(new WorkerMsg_TerminateWorkerContext(i->worker_route_id())); | 524 Send(new WorkerMsg_TerminateWorkerContext(i->worker_route_id())); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 return false; | 703 return false; |
704 } | 704 } |
705 | 705 |
706 WorkerProcessHost::WorkerInstance::FilterInfo | 706 WorkerProcessHost::WorkerInstance::FilterInfo |
707 WorkerProcessHost::WorkerInstance::GetFilter() const { | 707 WorkerProcessHost::WorkerInstance::GetFilter() const { |
708 DCHECK(NumFilters() == 1); | 708 DCHECK(NumFilters() == 1); |
709 return *filters_.begin(); | 709 return *filters_.begin(); |
710 } | 710 } |
711 | 711 |
712 } // namespace content | 712 } // namespace content |
OLD | NEW |