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

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

Issue 2704153002: ParsedContentType refactoring (Closed)
Patch Set: fix Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698