| 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 // if the browser_context parameter is NULL. This does not work for hosted | 522 // if the browser_context parameter is NULL. This does not work for hosted |
| 523 // apps, but should be fine for prototyping. | 523 // apps, but should be fine for prototyping. |
| 524 // TODO(nasko): Once the SiteInstance check is fixed, ensure we do the | 524 // TODO(nasko): Once the SiteInstance check is fixed, ensure we do the |
| 525 // right thing here. http://crbug.com/160576 | 525 // right thing here. http://crbug.com/160576 |
| 526 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 526 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 527 if (command_line.HasSwitch(switches::kSitePerProcess) && | 527 if (command_line.HasSwitch(switches::kSitePerProcess) && |
| 528 GetRequestInfo()->GetResourceType() == ResourceType::SUB_FRAME && | 528 GetRequestInfo()->GetResourceType() == ResourceType::SUB_FRAME && |
| 529 response->head.mime_type == "text/html" && | 529 response->head.mime_type == "text/html" && |
| 530 !request_->url().SchemeIs(chrome::kChromeUIScheme) && | 530 !request_->url().SchemeIs(chrome::kChromeUIScheme) && |
| 531 !SiteInstance::IsSameWebSite(NULL, request_->url(), | 531 !SiteInstance::IsSameWebSite(NULL, request_->url(), |
| 532 request_->GetSanitizedReferrer())) { | 532 GURL(request_->referrer()))) { |
| 533 response->head.mime_type = "application/browser-plugin"; | 533 response->head.mime_type = "application/browser-plugin"; |
| 534 } | 534 } |
| 535 | 535 |
| 536 if (request_->ssl_info().cert) { | 536 if (request_->ssl_info().cert) { |
| 537 int cert_id = | 537 int cert_id = |
| 538 CertStore::GetInstance()->StoreCert(request_->ssl_info().cert, | 538 CertStore::GetInstance()->StoreCert(request_->ssl_info().cert, |
| 539 info->GetChildID()); | 539 info->GetChildID()); |
| 540 response->head.security_info = SerializeSecurityInfo( | 540 response->head.security_info = SerializeSecurityInfo( |
| 541 cert_id, | 541 cert_id, |
| 542 request_->ssl_info().cert_status, | 542 request_->ssl_info().cert_status, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 // we resume. | 647 // we resume. |
| 648 deferred_stage_ = DEFERRED_FINISH; | 648 deferred_stage_ = DEFERRED_FINISH; |
| 649 } | 649 } |
| 650 } | 650 } |
| 651 | 651 |
| 652 void ResourceLoader::CallDidFinishLoading() { | 652 void ResourceLoader::CallDidFinishLoading() { |
| 653 delegate_->DidFinishLoading(this); | 653 delegate_->DidFinishLoading(this); |
| 654 } | 654 } |
| 655 | 655 |
| 656 } // namespace content | 656 } // namespace content |
| OLD | NEW |