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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp

Issue 2780533002: Use Referrer-Policy headers for CSS stylesheets (Closed)
Patch Set: updates Created 3 years, 8 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/inspector/InspectorResourceContentLoader.h" 5 #include "core/inspector/InspectorResourceContentLoader.h"
6 6
7 #include "core/css/CSSStyleSheet.h" 7 #include "core/css/CSSStyleSheet.h"
8 #include "core/css/StyleSheetContents.h" 8 #include "core/css/StyleSheetContents.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 visitor->trace(m_loader); 45 visitor->trace(m_loader);
46 StyleSheetResourceClient::trace(visitor); 46 StyleSheetResourceClient::trace(visitor);
47 RawResourceClient::trace(visitor); 47 RawResourceClient::trace(visitor);
48 } 48 }
49 49
50 private: 50 private:
51 Member<InspectorResourceContentLoader> m_loader; 51 Member<InspectorResourceContentLoader> m_loader;
52 52
53 void setCSSStyleSheet(const String&, 53 void setCSSStyleSheet(const String&,
54 const KURL&, 54 const KURL&,
55 ReferrerPolicy,
55 const String&, 56 const String&,
56 const CSSStyleSheetResource*) override; 57 const CSSStyleSheetResource*) override;
57 void notifyFinished(Resource*) override; 58 void notifyFinished(Resource*) override;
58 String debugName() const override { 59 String debugName() const override {
59 return "InspectorResourceContentLoader::ResourceClient"; 60 return "InspectorResourceContentLoader::ResourceClient";
60 } 61 }
61 void resourceFinished(Resource*); 62 void resourceFinished(Resource*);
62 63
63 friend class InspectorResourceContentLoader; 64 friend class InspectorResourceContentLoader;
64 }; 65 };
65 66
66 void InspectorResourceContentLoader::ResourceClient::resourceFinished( 67 void InspectorResourceContentLoader::ResourceClient::resourceFinished(
67 Resource* resource) { 68 Resource* resource) {
68 if (m_loader) 69 if (m_loader)
69 m_loader->resourceFinished(this); 70 m_loader->resourceFinished(this);
70 71
71 if (resource->getType() == Resource::Raw) 72 if (resource->getType() == Resource::Raw)
72 resource->removeClient(static_cast<RawResourceClient*>(this)); 73 resource->removeClient(static_cast<RawResourceClient*>(this));
73 else 74 else
74 resource->removeClient(static_cast<StyleSheetResourceClient*>(this)); 75 resource->removeClient(static_cast<StyleSheetResourceClient*>(this));
75 } 76 }
76 77
77 void InspectorResourceContentLoader::ResourceClient::setCSSStyleSheet( 78 void InspectorResourceContentLoader::ResourceClient::setCSSStyleSheet(
78 const String&, 79 const String&,
79 const KURL& url, 80 const KURL& url,
81 ReferrerPolicy,
80 const String&, 82 const String&,
81 const CSSStyleSheetResource* resource) { 83 const CSSStyleSheetResource* resource) {
82 resourceFinished(const_cast<CSSStyleSheetResource*>(resource)); 84 resourceFinished(const_cast<CSSStyleSheetResource*>(resource));
83 } 85 }
84 86
85 void InspectorResourceContentLoader::ResourceClient::notifyFinished( 87 void InspectorResourceContentLoader::ResourceClient::notifyFinished(
86 Resource* resource) { 88 Resource* resource) {
87 if (resource->getType() == Resource::CSSStyleSheet) 89 if (resource->getType() == Resource::CSSStyleSheet)
88 return; 90 return;
89 resourceFinished(resource); 91 resourceFinished(resource);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 (*callback)(); 226 (*callback)();
225 } 227 }
226 } 228 }
227 229
228 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client) { 230 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client) {
229 m_pendingResourceClients.erase(client); 231 m_pendingResourceClients.erase(client);
230 checkDone(); 232 checkDone();
231 } 233 }
232 234
233 } // namespace blink 235 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698