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

Side by Side Diff: Source/core/loader/PingLoader.cpp

Issue 123003002: Make calls to AtomicString(const String&) explicit in loader/ and fetch/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 request.setHTTPBody(FormData::create("PING")); 78 request.setHTTPBody(FormData::create("PING"));
79 request.setHTTPHeaderField("Cache-Control", "max-age=0"); 79 request.setHTTPHeaderField("Cache-Control", "max-age=0");
80 frame->loader().fetchContext().addAdditionalRequestHeaders(frame->document() , request, FetchSubresource); 80 frame->loader().fetchContext().addAdditionalRequestHeaders(frame->document() , request, FetchSubresource);
81 81
82 RefPtr<SecurityOrigin> pingOrigin = SecurityOrigin::create(pingURL); 82 RefPtr<SecurityOrigin> pingOrigin = SecurityOrigin::create(pingURL);
83 // addAdditionalRequestHeaders() will have added a referrer for same origin requests, 83 // addAdditionalRequestHeaders() will have added a referrer for same origin requests,
84 // but the spec omits the referrer for same origin. 84 // but the spec omits the referrer for same origin.
85 if (frame->document()->securityOrigin()->isSameSchemeHostPort(pingOrigin.get ())) 85 if (frame->document()->securityOrigin()->isSameSchemeHostPort(pingOrigin.get ()))
86 request.clearHTTPReferrer(); 86 request.clearHTTPReferrer();
87 87
88 request.setHTTPHeaderField("Ping-To", destinationURL.string()); 88 request.setHTTPHeaderField("Ping-To", AtomicString(destinationURL.string())) ;
89 89
90 // Ping-From follows the same rules as the default referrer beahavior for su bresource requests. 90 // Ping-From follows the same rules as the default referrer beahavior for su bresource requests.
91 // FIXME: Should Ping-From obey ReferrerPolicy? 91 // FIXME: Should Ping-From obey ReferrerPolicy?
92 if (!SecurityPolicy::shouldHideReferrer(pingURL, frame->document()->url().st ring())) 92 if (!SecurityPolicy::shouldHideReferrer(pingURL, frame->document()->url().st ring()))
93 request.setHTTPHeaderField("Ping-From", frame->document()->url().string( )); 93 request.setHTTPHeaderField("Ping-From", AtomicString(frame->document()-> url().string()));
94 OwnPtr<PingLoader> pingLoader = adoptPtr(new PingLoader(frame, request)); 94 OwnPtr<PingLoader> pingLoader = adoptPtr(new PingLoader(frame, request));
95 95
96 // Leak the ping loader, since it will kill itself as soon as it receives a response. 96 // Leak the ping loader, since it will kill itself as soon as it receives a response.
97 PingLoader* ALLOW_UNUSED leakedPingLoader = pingLoader.leakPtr(); 97 PingLoader* ALLOW_UNUSED leakedPingLoader = pingLoader.leakPtr();
98 } 98 }
99 99
100 void PingLoader::sendViolationReport(Frame* frame, const KURL& reportURL, PassRe fPtr<FormData> report, ViolationReportType type) 100 void PingLoader::sendViolationReport(Frame* frame, const KURL& reportURL, PassRe fPtr<FormData> report, ViolationReportType type)
101 { 101 {
102 ResourceRequest request(reportURL); 102 ResourceRequest request(reportURL);
103 request.setTargetType(ResourceRequest::TargetIsSubresource); 103 request.setTargetType(ResourceRequest::TargetIsSubresource);
(...skipping 26 matching lines...) Expand all
130 m_timeout.startOneShot(60000); 130 m_timeout.startOneShot(60000);
131 } 131 }
132 132
133 PingLoader::~PingLoader() 133 PingLoader::~PingLoader()
134 { 134 {
135 if (m_loader) 135 if (m_loader)
136 m_loader->cancel(); 136 m_loader->cancel();
137 } 137 }
138 138
139 } 139 }
OLDNEW
« no previous file with comments | « Source/core/loader/NavigationScheduler.cpp ('k') | Source/core/loader/WorkerThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698