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

Side by Side Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 600393004: [ServiceWorker] Set FetchRequestMode and handle wasFetchedViaServiceWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add setFetchCredentialsMode in PingLoader::PingLoader() Created 6 years, 2 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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 toFontResource(resource)->setCORSFailed(); 601 toFontResource(resource)->setCORSFailed();
602 if (frame() && frame()->document()) { 602 if (frame() && frame()->document()) {
603 String resourceType = Resource::resourceTypeToString(resource->type( ), resource->options().initiatorInfo); 603 String resourceType = Resource::resourceTypeToString(resource->type( ), resource->options().initiatorInfo);
604 frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMess ageSource, ErrorMessageLevel, resourceType + " from origin '" + SecurityOrigin:: create(url)->toString() + "' has been blocked from loading by Cross-Origin Resou rce Sharing policy: " + errorDescription)); 604 frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMess ageSource, ErrorMessageLevel, resourceType + " from origin '" + SecurityOrigin:: create(url)->toString() + "' has been blocked from loading by Cross-Origin Resou rce Sharing policy: " + errorDescription));
605 } 605 }
606 return false; 606 return false;
607 } 607 }
608 return true; 608 return true;
609 } 609 }
610 610
611 bool ResourceFetcher::isControlledByServiceWorker()
612 {
613 LocalFrame* localFrame = frame();
614 if (!localFrame)
615 return false;
616 return localFrame->loader().client()->isControlledByServiceWorker(m_document Loader);
617 }
618
611 bool ResourceFetcher::shouldLoadNewResource(Resource::Type type) const 619 bool ResourceFetcher::shouldLoadNewResource(Resource::Type type) const
612 { 620 {
613 if (!frame()) 621 if (!frame())
614 return false; 622 return false;
615 if (!m_documentLoader) 623 if (!m_documentLoader)
616 return true; 624 return true;
617 if (type == Resource::MainResource) 625 if (type == Resource::MainResource)
618 return m_documentLoader == frame()->loader().provisionalDocumentLoader() ; 626 return m_documentLoader == frame()->loader().provisionalDocumentLoader() ;
619 return m_documentLoader == frame()->loader().documentLoader(); 627 return m_documentLoader == frame()->loader().documentLoader();
620 } 628 }
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 1524
1517 void ResourceFetcher::trace(Visitor* visitor) 1525 void ResourceFetcher::trace(Visitor* visitor)
1518 { 1526 {
1519 visitor->trace(m_document); 1527 visitor->trace(m_document);
1520 visitor->trace(m_loaders); 1528 visitor->trace(m_loaders);
1521 visitor->trace(m_multipartLoaders); 1529 visitor->trace(m_multipartLoaders);
1522 ResourceLoaderHost::trace(visitor); 1530 ResourceLoaderHost::trace(visitor);
1523 } 1531 }
1524 1532
1525 } 1533 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698