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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 2022783002: Skeleton of the Safe Browsing Subresource Filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "platform/HTTPNames.h" 63 #include "platform/HTTPNames.h"
64 #include "platform/Logging.h" 64 #include "platform/Logging.h"
65 #include "platform/UserGestureIndicator.h" 65 #include "platform/UserGestureIndicator.h"
66 #include "platform/mhtml/ArchiveResource.h" 66 #include "platform/mhtml/ArchiveResource.h"
67 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" 67 #include "platform/network/ContentSecurityPolicyResponseHeaders.h"
68 #include "platform/network/HTTPParsers.h" 68 #include "platform/network/HTTPParsers.h"
69 #include "platform/plugins/PluginData.h" 69 #include "platform/plugins/PluginData.h"
70 #include "platform/weborigin/SchemeRegistry.h" 70 #include "platform/weborigin/SchemeRegistry.h"
71 #include "platform/weborigin/SecurityPolicy.h" 71 #include "platform/weborigin/SecurityPolicy.h"
72 #include "public/platform/Platform.h" 72 #include "public/platform/Platform.h"
73 #include "public/platform/WebDocumentSubresourceFilter.h"
73 #include "public/platform/WebMimeRegistry.h" 74 #include "public/platform/WebMimeRegistry.h"
74 #include "wtf/Assertions.h" 75 #include "wtf/Assertions.h"
75 #include "wtf/TemporaryChange.h" 76 #include "wtf/TemporaryChange.h"
76 #include "wtf/text/WTFString.h" 77 #include "wtf/text/WTFString.h"
77 78
78 namespace blink { 79 namespace blink {
79 80
80 static bool isArchiveMIMEType(const String& mimeType) 81 static bool isArchiveMIMEType(const String& mimeType)
81 { 82 {
82 return equalIgnoringCase("multipart/related", mimeType); 83 return equalIgnoringCase("multipart/related", mimeType);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 const ResourceRequest& DocumentLoader::request() const 158 const ResourceRequest& DocumentLoader::request() const
158 { 159 {
159 return m_request; 160 return m_request;
160 } 161 }
161 162
162 const KURL& DocumentLoader::url() const 163 const KURL& DocumentLoader::url() const
163 { 164 {
164 return m_request.url(); 165 return m_request.url();
165 } 166 }
166 167
168 void DocumentLoader::setSubresourceFilter(PassOwnPtr<WebDocumentSubresourceFilte r> subresourceFilter)
169 {
170 m_subresourceFilter = std::move(subresourceFilter);
171 }
172
167 Resource* DocumentLoader::startPreload(Resource::Type type, FetchRequest& reques t) 173 Resource* DocumentLoader::startPreload(Resource::Type type, FetchRequest& reques t)
168 { 174 {
169 Resource* resource = nullptr; 175 Resource* resource = nullptr;
170 switch (type) { 176 switch (type) {
171 case Resource::Image: 177 case Resource::Image:
172 resource = ImageResource::fetch(request, fetcher()); 178 resource = ImageResource::fetch(request, fetcher());
173 break; 179 break;
174 case Resource::Script: 180 case Resource::Script:
175 resource = ScriptResource::fetch(request, fetcher()); 181 resource = ScriptResource::fetch(request, fetcher());
176 break; 182 break;
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 { 679 {
674 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing); 680 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing);
675 if (!source.isNull()) 681 if (!source.isNull())
676 m_writer->appendReplacingData(source); 682 m_writer->appendReplacingData(source);
677 endWriting(m_writer.get()); 683 endWriting(m_writer.get());
678 } 684 }
679 685
680 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 686 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
681 687
682 } // namespace blink 688 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698