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

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: Better rebase. 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
Index: Source/core/html/MediaDocument.cpp
diff --git a/Source/core/html/MediaDocument.cpp b/Source/core/html/MediaDocument.cpp
index cb6cd82dc89eead81c336d803698a49f733cc607..d44f9a80dff6d250ef55cd5fb6d29ef9e1c52a89 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();
}

Powered by Google App Engine
This is Rietveld 408576698