| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 } | 486 } |
| 487 | 487 |
| 488 void WorkerProcessHost::UpdateTitle() { | 488 void WorkerProcessHost::UpdateTitle() { |
| 489 std::set<std::string> titles; | 489 std::set<std::string> titles; |
| 490 for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) { | 490 for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) { |
| 491 // Allow the embedder first crack at special casing the title. | 491 // Allow the embedder first crack at special casing the title. |
| 492 std::string title = GetContentClient()->browser()-> | 492 std::string title = GetContentClient()->browser()-> |
| 493 GetWorkerProcessTitle(i->url(), resource_context_); | 493 GetWorkerProcessTitle(i->url(), resource_context_); |
| 494 | 494 |
| 495 if (title.empty()) { | 495 if (title.empty()) { |
| 496 title = net::RegistryControlledDomainService::GetDomainAndRegistry( | 496 title = net::registry_controlled_domains::GetDomainAndRegistry( |
| 497 i->url()); | 497 i->url(), |
| 498 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); |
| 498 } | 499 } |
| 499 | 500 |
| 500 // Use the host name if the domain is empty, i.e. localhost or IP address. | 501 // Use the host name if the domain is empty, i.e. localhost or IP address. |
| 501 if (title.empty()) | 502 if (title.empty()) |
| 502 title = i->url().host(); | 503 title = i->url().host(); |
| 503 | 504 |
| 504 // If the host name is empty, i.e. file url, use the path. | 505 // If the host name is empty, i.e. file url, use the path. |
| 505 if (title.empty()) | 506 if (title.empty()) |
| 506 title = i->url().path(); | 507 title = i->url().path(); |
| 507 titles.insert(title); | 508 titles.insert(title); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 return false; | 691 return false; |
| 691 } | 692 } |
| 692 | 693 |
| 693 WorkerProcessHost::WorkerInstance::FilterInfo | 694 WorkerProcessHost::WorkerInstance::FilterInfo |
| 694 WorkerProcessHost::WorkerInstance::GetFilter() const { | 695 WorkerProcessHost::WorkerInstance::GetFilter() const { |
| 695 DCHECK(NumFilters() == 1); | 696 DCHECK(NumFilters() == 1); |
| 696 return *filters_.begin(); | 697 return *filters_.begin(); |
| 697 } | 698 } |
| 698 | 699 |
| 699 } // namespace content | 700 } // namespace content |
| OLD | NEW |