OLD | NEW |
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 ContentSecurityPolicyViolationReport, | 69 ContentSecurityPolicyViolationReport, |
70 XSSAuditorViolationReport | 70 XSSAuditorViolationReport |
71 }; | 71 }; |
72 | 72 |
73 static void loadImage(LocalFrame*, const KURL&); | 73 static void loadImage(LocalFrame*, const KURL&); |
74 static void sendLinkAuditPing(LocalFrame*, const KURL& pingURL, const KURL&
destinationURL); | 74 static void sendLinkAuditPing(LocalFrame*, const KURL& pingURL, const KURL&
destinationURL); |
75 static void sendViolationReport(LocalFrame*, const KURL& reportURL, PassRefP
tr<EncodedFormData> report, ViolationReportType); | 75 static void sendViolationReport(LocalFrame*, const KURL& reportURL, PassRefP
tr<EncodedFormData> report, ViolationReportType); |
76 | 76 |
77 DECLARE_VIRTUAL_TRACE(); | 77 DECLARE_VIRTUAL_TRACE(); |
78 | 78 |
79 // Promptly finalize m_loader. | |
80 EAGERLY_FINALIZE(); | |
81 | |
82 protected: | 79 protected: |
83 PingLoader(LocalFrame*, ResourceRequest&, const FetchInitiatorInfo&, StoredC
redentials); | 80 PingLoader(LocalFrame*, ResourceRequest&, const FetchInitiatorInfo&, StoredC
redentials); |
84 | 81 |
85 static void start(LocalFrame*, ResourceRequest&, const FetchInitiatorInfo&,
StoredCredentials = AllowStoredCredentials); | 82 static void start(LocalFrame*, ResourceRequest&, const FetchInitiatorInfo&,
StoredCredentials = AllowStoredCredentials); |
86 | 83 |
87 void dispose(); | 84 void dispose(); |
88 | 85 |
89 private: | 86 private: |
90 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) final; | 87 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) final; |
91 void didReceiveData(WebURLLoader*, const char*, int, int, int) final; | 88 void didReceiveData(WebURLLoader*, const char*, int, int, int) final; |
92 void didFinishLoading(WebURLLoader*, double, int64_t) final; | 89 void didFinishLoading(WebURLLoader*, double, int64_t) final; |
93 void didFail(WebURLLoader*, const WebURLError&) final; | 90 void didFail(WebURLLoader*, const WebURLError&) final; |
94 | 91 |
95 void timeout(Timer<PingLoader>*); | 92 void timeout(Timer<PingLoader>*); |
96 | 93 |
97 void didFailLoading(LocalFrame*); | 94 void didFailLoading(LocalFrame*); |
98 | 95 |
99 std::unique_ptr<WebURLLoader> m_loader; | 96 std::unique_ptr<WebURLLoader> m_loader; |
100 Timer<PingLoader> m_timeout; | 97 Timer<PingLoader> m_timeout; |
101 String m_url; | 98 String m_url; |
102 unsigned long m_identifier; | 99 unsigned long m_identifier; |
103 SelfKeepAlive<PingLoader> m_keepAlive; | 100 SelfKeepAlive<PingLoader> m_keepAlive; |
104 }; | 101 }; |
105 | 102 |
106 } // namespace blink | 103 } // namespace blink |
107 | 104 |
108 #endif // PingLoader_h | 105 #endif // PingLoader_h |
OLD | NEW |