Chromium Code Reviews| 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/loader/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 519 // | 519 // |
| 520 // The usage of SiteInstance::IsSameWebSite is safe on the IO thread, | 520 // The usage of SiteInstance::IsSameWebSite is safe on the IO thread, |
| 521 // if the browser_context parameter is NULL. This does not work for hosted | 521 // if the browser_context parameter is NULL. This does not work for hosted |
| 522 // apps, but should be fine for prototyping. | 522 // apps, but should be fine for prototyping. |
| 523 // TODO(nasko): Once the SiteInstance check is fixed, ensure we do the | 523 // TODO(nasko): Once the SiteInstance check is fixed, ensure we do the |
| 524 // right thing here. http://crbug.com/160576 | 524 // right thing here. http://crbug.com/160576 |
| 525 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 525 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 526 if (command_line.HasSwitch(switches::kSitePerProcess) && | 526 if (command_line.HasSwitch(switches::kSitePerProcess) && |
| 527 GetRequestInfo()->GetResourceType() == ResourceType::SUB_FRAME && | 527 GetRequestInfo()->GetResourceType() == ResourceType::SUB_FRAME && |
| 528 response->head.mime_type == "text/html" && | 528 response->head.mime_type == "text/html" && |
| 529 !request_->url().SchemeIs(chrome::kChromeUIScheme) && | 529 !request_->url().SchemeIs(chrome::kChromeUIScheme)) { |
| 530 !SiteInstance::IsSameWebSite(NULL, request_->url(), | 530 GURL referrer(request_->referrer()); |
|
pauljensen
2013/03/15 13:37:45
Can we just go back to the old code but use GURL(r
mef
2013/03/15 16:36:42
Done.
mef
2013/03/15 16:36:42
Done.
| |
| 531 request_->GetSanitizedReferrer())) { | 531 if (!SiteInstance::IsSameWebSite(NULL, request_->url(), referrer)) { |
| 532 response->head.mime_type = "application/browser-plugin"; | 532 response->head.mime_type = "application/browser-plugin"; |
| 533 } | |
| 533 } | 534 } |
| 534 | 535 |
| 535 if (request_->ssl_info().cert) { | 536 if (request_->ssl_info().cert) { |
| 536 int cert_id = | 537 int cert_id = |
| 537 CertStore::GetInstance()->StoreCert(request_->ssl_info().cert, | 538 CertStore::GetInstance()->StoreCert(request_->ssl_info().cert, |
| 538 info->GetChildID()); | 539 info->GetChildID()); |
| 539 response->head.security_info = SerializeSecurityInfo( | 540 response->head.security_info = SerializeSecurityInfo( |
| 540 cert_id, | 541 cert_id, |
| 541 request_->ssl_info().cert_status, | 542 request_->ssl_info().cert_status, |
| 542 request_->ssl_info().security_bits, | 543 request_->ssl_info().security_bits, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 646 // we resume. | 647 // we resume. |
| 647 deferred_stage_ = DEFERRED_FINISH; | 648 deferred_stage_ = DEFERRED_FINISH; |
| 648 } | 649 } |
| 649 } | 650 } |
| 650 | 651 |
| 651 void ResourceLoader::CallDidFinishLoading() { | 652 void ResourceLoader::CallDidFinishLoading() { |
| 652 delegate_->DidFinishLoading(this); | 653 delegate_->DidFinishLoading(this); |
| 653 } | 654 } |
| 654 | 655 |
| 655 } // namespace content | 656 } // namespace content |
| OLD | NEW |