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

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

Issue 27694002: Ability to block <audio> and <video> media. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased. Created 6 years, 6 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 } 571 }
572 case Resource::MainResource: 572 case Resource::MainResource:
573 case Resource::Raw: 573 case Resource::Raw:
574 case Resource::LinkPrefetch: 574 case Resource::LinkPrefetch:
575 case Resource::LinkSubresource: 575 case Resource::LinkSubresource:
576 break; 576 break;
577 case Resource::Media: 577 case Resource::Media:
578 case Resource::TextTrack: 578 case Resource::TextTrack:
579 if (!shouldBypassMainWorldContentSecurityPolicy && !m_document->contentS ecurityPolicy()->allowMediaFromSource(url, cspReporting)) 579 if (!shouldBypassMainWorldContentSecurityPolicy && !m_document->contentS ecurityPolicy()->allowMediaFromSource(url, cspReporting))
580 return false; 580 return false;
581
582 if (frame()) {
583 if (!frame()->loader().client()->allowMedia(url))
584 return false;
585 }
581 break; 586 break;
582 } 587 }
583 588
584 // SVG Images have unique security rules that prevent all subresource reques ts 589 // SVG Images have unique security rules that prevent all subresource reques ts
585 // except for data urls. 590 // except for data urls.
586 if (type != Resource::MainResource) { 591 if (type != Resource::MainResource) {
587 if (frame() && frame()->chromeClient().isSVGImageChromeClient() && !url. protocolIsData()) 592 if (frame() && frame()->chromeClient().isSVGImageChromeClient() && !url. protocolIsData())
588 return false; 593 return false;
589 } 594 }
590 595
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 } 1490 }
1486 } 1491 }
1487 1492
1488 void ResourceFetcher::trace(Visitor* visitor) 1493 void ResourceFetcher::trace(Visitor* visitor)
1489 { 1494 {
1490 visitor->trace(m_document); 1495 visitor->trace(m_document);
1491 ResourceLoaderHost::trace(visitor); 1496 ResourceLoaderHost::trace(visitor);
1492 } 1497 }
1493 1498
1494 } 1499 }
OLDNEW
« no previous file with comments | « LayoutTests/permissionclient/video-permissions-expected.txt ('k') | Source/core/html/MediaDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698