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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 103 } |
104 | 104 |
105 private: | 105 private: |
106 const String m_data; | 106 const String m_data; |
107 }; | 107 }; |
108 | 108 |
109 class BeaconBlob final : public Beacon { | 109 class BeaconBlob final : public Beacon { |
110 public: | 110 public: |
111 explicit BeaconBlob(Blob* data) : m_data(data) { | 111 explicit BeaconBlob(Blob* data) : m_data(data) { |
112 const String& blobType = m_data->type(); | 112 const String& blobType = m_data->type(); |
113 if (!blobType.isEmpty() && isValidContentType(blobType)) | 113 if (!blobType.isEmpty() && ParsedContentType(blobType).isValid()) |
114 m_contentType = AtomicString(blobType); | 114 m_contentType = AtomicString(blobType); |
115 } | 115 } |
116 | 116 |
117 unsigned long long size() const override { return m_data->size(); } | 117 unsigned long long size() const override { return m_data->size(); } |
118 | 118 |
119 void serialize(ResourceRequest& request) const override { | 119 void serialize(ResourceRequest& request) const override { |
120 DCHECK(m_data); | 120 DCHECK(m_data); |
121 | 121 |
122 RefPtr<EncodedFormData> entityBody = EncodedFormData::create(); | 122 RefPtr<EncodedFormData> entityBody = EncodedFormData::create(); |
123 if (m_data->hasBackingFile()) | 123 if (m_data->hasBackingFile()) |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 bool PingLoader::sendBeacon(LocalFrame* frame, | 569 bool PingLoader::sendBeacon(LocalFrame* frame, |
570 int allowance, | 570 int allowance, |
571 const KURL& beaconURL, | 571 const KURL& beaconURL, |
572 Blob* data, | 572 Blob* data, |
573 int& payloadLength) { | 573 int& payloadLength) { |
574 BeaconBlob beacon(data); | 574 BeaconBlob beacon(data); |
575 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); | 575 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); |
576 } | 576 } |
577 | 577 |
578 } // namespace blink | 578 } // namespace blink |
OLD | NEW |