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

Side by Side Diff: third_party/WebKit/Source/platform/network/ResourceResponse.h

Issue 2674953003: Only generate suggested filenames when actually dragging an image. (Closed)
Patch Set: rebase 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 explicit ResourceResponse(CrossThreadResourceResponseData*); 132 explicit ResourceResponse(CrossThreadResourceResponseData*);
133 133
134 // Gets a copy of the data suitable for passing to another thread. 134 // Gets a copy of the data suitable for passing to another thread.
135 std::unique_ptr<CrossThreadResourceResponseData> copyData() const; 135 std::unique_ptr<CrossThreadResourceResponseData> copyData() const;
136 136
137 ResourceResponse(); 137 ResourceResponse();
138 ResourceResponse(const KURL&, 138 ResourceResponse(const KURL&,
139 const AtomicString& mimeType, 139 const AtomicString& mimeType,
140 long long expectedLength, 140 long long expectedLength,
141 const AtomicString& textEncodingName, 141 const AtomicString& textEncodingName);
142 const String& filename);
143 ResourceResponse(const ResourceResponse&); 142 ResourceResponse(const ResourceResponse&);
144 ResourceResponse& operator=(const ResourceResponse&); 143 ResourceResponse& operator=(const ResourceResponse&);
145 144
146 bool isNull() const { return m_isNull; } 145 bool isNull() const { return m_isNull; }
147 bool isHTTP() const; 146 bool isHTTP() const;
148 147
149 // The URL of the resource. Note that if a service worker responded to the 148 // The URL of the resource. Note that if a service worker responded to the
150 // request for this resource, it may have fetched an entirely different URL 149 // request for this resource, it may have fetched an entirely different URL
151 // and responded with that resource. wasFetchedViaServiceWorker() and 150 // and responded with that resource. wasFetchedViaServiceWorker() and
152 // originalURLViaServiceWorker() can be used to determine whether and how a 151 // originalURLViaServiceWorker() can be used to determine whether and how a
(...skipping 13 matching lines...) Expand all
166 165
167 const AtomicString& mimeType() const; 166 const AtomicString& mimeType() const;
168 void setMimeType(const AtomicString&); 167 void setMimeType(const AtomicString&);
169 168
170 long long expectedContentLength() const; 169 long long expectedContentLength() const;
171 void setExpectedContentLength(long long); 170 void setExpectedContentLength(long long);
172 171
173 const AtomicString& textEncodingName() const; 172 const AtomicString& textEncodingName() const;
174 void setTextEncodingName(const AtomicString&); 173 void setTextEncodingName(const AtomicString&);
175 174
176 // FIXME: Should compute this on the fly.
177 // There should not be a setter exposed, as suggested file name is determined
178 // based on other headers in a manner that WebCore does not necessarily know
179 // about.
180 const String& suggestedFilename() const;
181 void setSuggestedFilename(const String&);
182
183 int httpStatusCode() const; 175 int httpStatusCode() const;
184 void setHTTPStatusCode(int); 176 void setHTTPStatusCode(int);
185 177
186 const AtomicString& httpStatusText() const; 178 const AtomicString& httpStatusText() const;
187 void setHTTPStatusText(const AtomicString&); 179 void setHTTPStatusText(const AtomicString&);
188 180
189 const AtomicString& httpHeaderField(const AtomicString& name) const; 181 const AtomicString& httpHeaderField(const AtomicString& name) const;
190 void setHTTPHeaderField(const AtomicString& name, const AtomicString& value); 182 void setHTTPHeaderField(const AtomicString& name, const AtomicString& value);
191 void addHTTPHeaderField(const AtomicString& name, const AtomicString& value); 183 void addHTTPHeaderField(const AtomicString& name, const AtomicString& value);
192 void clearHTTPHeaderField(const AtomicString& name); 184 void clearHTTPHeaderField(const AtomicString& name);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // This method doesn't compare the all members. 382 // This method doesn't compare the all members.
391 static bool compare(const ResourceResponse&, const ResourceResponse&); 383 static bool compare(const ResourceResponse&, const ResourceResponse&);
392 384
393 private: 385 private:
394 void updateHeaderParsedState(const AtomicString& name); 386 void updateHeaderParsedState(const AtomicString& name);
395 387
396 KURL m_url; 388 KURL m_url;
397 AtomicString m_mimeType; 389 AtomicString m_mimeType;
398 long long m_expectedContentLength; 390 long long m_expectedContentLength;
399 AtomicString m_textEncodingName; 391 AtomicString m_textEncodingName;
400 String m_suggestedFilename;
401 int m_httpStatusCode; 392 int m_httpStatusCode;
402 AtomicString m_httpStatusText; 393 AtomicString m_httpStatusText;
403 HTTPHeaderMap m_httpHeaderFields; 394 HTTPHeaderMap m_httpHeaderFields;
404 time_t m_lastModifiedDate; 395 time_t m_lastModifiedDate;
405 bool m_wasCached : 1; 396 bool m_wasCached : 1;
406 unsigned m_connectionID; 397 unsigned m_connectionID;
407 bool m_connectionReused : 1; 398 bool m_connectionReused : 1;
408 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; 399 RefPtr<ResourceLoadTiming> m_resourceLoadTiming;
409 RefPtr<ResourceLoadInfo> m_resourceLoadInfo; 400 RefPtr<ResourceLoadInfo> m_resourceLoadInfo;
410 401
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 struct CrossThreadResourceResponseData { 529 struct CrossThreadResourceResponseData {
539 WTF_MAKE_NONCOPYABLE(CrossThreadResourceResponseData); 530 WTF_MAKE_NONCOPYABLE(CrossThreadResourceResponseData);
540 USING_FAST_MALLOC(CrossThreadResourceResponseData); 531 USING_FAST_MALLOC(CrossThreadResourceResponseData);
541 532
542 public: 533 public:
543 CrossThreadResourceResponseData() {} 534 CrossThreadResourceResponseData() {}
544 KURL m_url; 535 KURL m_url;
545 String m_mimeType; 536 String m_mimeType;
546 long long m_expectedContentLength; 537 long long m_expectedContentLength;
547 String m_textEncodingName; 538 String m_textEncodingName;
548 String m_suggestedFilename;
549 int m_httpStatusCode; 539 int m_httpStatusCode;
550 String m_httpStatusText; 540 String m_httpStatusText;
551 std::unique_ptr<CrossThreadHTTPHeaderMapData> m_httpHeaders; 541 std::unique_ptr<CrossThreadHTTPHeaderMapData> m_httpHeaders;
552 time_t m_lastModifiedDate; 542 time_t m_lastModifiedDate;
553 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; 543 RefPtr<ResourceLoadTiming> m_resourceLoadTiming;
554 bool m_hasMajorCertificateErrors; 544 bool m_hasMajorCertificateErrors;
555 ResourceResponse::SecurityStyle m_securityStyle; 545 ResourceResponse::SecurityStyle m_securityStyle;
556 ResourceResponse::SecurityDetails m_securityDetails; 546 ResourceResponse::SecurityDetails m_securityDetails;
557 // This is |certificate| from SecurityDetails since that structure should 547 // This is |certificate| from SecurityDetails since that structure should
558 // use an AtomicString but this temporary structure is sent across threads. 548 // use an AtomicString but this temporary structure is sent across threads.
(...skipping 19 matching lines...) Expand all
578 long long m_encodedDataLength; 568 long long m_encodedDataLength;
579 long long m_encodedBodyLength; 569 long long m_encodedBodyLength;
580 long long m_decodedBodyLength; 570 long long m_decodedBodyLength;
581 String m_downloadedFilePath; 571 String m_downloadedFilePath;
582 RefPtr<BlobDataHandle> m_downloadedFileHandle; 572 RefPtr<BlobDataHandle> m_downloadedFileHandle;
583 }; 573 };
584 574
585 } // namespace blink 575 } // namespace blink
586 576
587 #endif // ResourceResponse_h 577 #endif // ResourceResponse_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698