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

Unified Diff: Source/core/html/MediaDocument.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/loader/FrameLoaderClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/MediaDocument.cpp
diff --git a/Source/core/html/MediaDocument.cpp b/Source/core/html/MediaDocument.cpp
index 1a9235d654672765ab2c7c3486aec5b571e8b29d..fffbf503020df4d6d32ffc7ce4fbcf7dfaedf8ef 100644
--- a/Source/core/html/MediaDocument.cpp
+++ b/Source/core/html/MediaDocument.cpp
@@ -41,6 +41,7 @@
#include "core/html/HTMLVideoElement.h"
#include "core/loader/DocumentLoader.h"
#include "core/loader/FrameLoader.h"
+#include "core/loader/FrameLoaderClient.h"
#include "platform/KeyboardCodes.h"
namespace WebCore {
@@ -112,6 +113,10 @@ void MediaDocumentParser::appendBytes(const char*, size_t)
if (m_didBuildDocumentStructure)
return;
+ LocalFrame* frame = document()->frame();
+ if (!frame->loader().client()->allowMedia(document()->url()))
+ return;
+
createDocumentStructure();
finish();
}
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/loader/FrameLoaderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698