Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/Resource.cpp

Issue 2689173002: Implement script MIME restrictions for X-Content-Type-Options: nosniff for Workers (Closed)
Patch Set: incorporated mkwst@'s comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
7 rights reserved. 7 rights reserved.
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 void Resource::finish(double loadFinishTime) { 426 void Resource::finish(double loadFinishTime) {
427 DCHECK(!m_isRevalidating); 427 DCHECK(!m_isRevalidating);
428 m_loadFinishTime = loadFinishTime; 428 m_loadFinishTime = loadFinishTime;
429 if (!errorOccurred()) 429 if (!errorOccurred())
430 m_status = ResourceStatus::Cached; 430 m_status = ResourceStatus::Cached;
431 m_loader = nullptr; 431 m_loader = nullptr;
432 checkNotify(); 432 checkNotify();
433 } 433 }
434 434
435 AtomicString Resource::httpContentType() const { 435 AtomicString Resource::httpContentType() const {
436 return extractMIMETypeFromMediaType( 436 return response().httpContentType();
437 response().httpHeaderField(HTTPNames::Content_Type).lower());
438 } 437 }
439 438
440 bool Resource::passesAccessControlCheck(SecurityOrigin* securityOrigin) const { 439 bool Resource::passesAccessControlCheck(SecurityOrigin* securityOrigin) const {
441 StoredCredentials storedCredentials = 440 StoredCredentials storedCredentials =
442 lastResourceRequest().allowStoredCredentials() 441 lastResourceRequest().allowStoredCredentials()
443 ? AllowStoredCredentials 442 ? AllowStoredCredentials
444 : DoNotAllowStoredCredentials; 443 : DoNotAllowStoredCredentials;
445 CrossOriginAccessControl::AccessStatus status = 444 CrossOriginAccessControl::AccessStatus status =
446 CrossOriginAccessControl::checkAccess(response(), storedCredentials, 445 CrossOriginAccessControl::checkAccess(response(), storedCredentials,
447 securityOrigin); 446 securityOrigin);
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 case Resource::Media: 1122 case Resource::Media:
1124 case Resource::Manifest: 1123 case Resource::Manifest:
1125 case Resource::Mock: 1124 case Resource::Mock:
1126 return false; 1125 return false;
1127 } 1126 }
1128 NOTREACHED(); 1127 NOTREACHED();
1129 return false; 1128 return false;
1130 } 1129 }
1131 1130
1132 } // namespace blink 1131 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698