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

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

Issue 2398053003: Compute ResourceResponse::suggestedFileName on the fly. (Closed)
Patch Set: clean up vestigial changes (trybots previous) Created 4 years, 2 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 const AtomicString& mimeType() const; 150 const AtomicString& mimeType() const;
151 void setMimeType(const AtomicString&); 151 void setMimeType(const AtomicString&);
152 152
153 long long expectedContentLength() const; 153 long long expectedContentLength() const;
154 void setExpectedContentLength(long long); 154 void setExpectedContentLength(long long);
155 155
156 const AtomicString& textEncodingName() const; 156 const AtomicString& textEncodingName() const;
157 void setTextEncodingName(const AtomicString&); 157 void setTextEncodingName(const AtomicString&);
158 158
159 // FIXME: Should compute this on the fly.
160 // There should not be a setter exposed, as suggested file name is determined
161 // based on other headers in a manner that WebCore does not necessarily know
162 // about.
163 const String& suggestedFilename() const;
164 void setSuggestedFilename(const String&);
165
166 int httpStatusCode() const; 159 int httpStatusCode() const;
167 void setHTTPStatusCode(int); 160 void setHTTPStatusCode(int);
168 161
169 const AtomicString& httpStatusText() const; 162 const AtomicString& httpStatusText() const;
170 void setHTTPStatusText(const AtomicString&); 163 void setHTTPStatusText(const AtomicString&);
171 164
172 const AtomicString& httpHeaderField(const AtomicString& name) const; 165 const AtomicString& httpHeaderField(const AtomicString& name) const;
173 void setHTTPHeaderField(const AtomicString& name, const AtomicString& value); 166 void setHTTPHeaderField(const AtomicString& name, const AtomicString& value);
174 void addHTTPHeaderField(const AtomicString& name, const AtomicString& value); 167 void addHTTPHeaderField(const AtomicString& name, const AtomicString& value);
175 void clearHTTPHeaderField(const AtomicString& name); 168 void clearHTTPHeaderField(const AtomicString& name);
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 // This method doesn't compare the all members. 352 // This method doesn't compare the all members.
360 static bool compare(const ResourceResponse&, const ResourceResponse&); 353 static bool compare(const ResourceResponse&, const ResourceResponse&);
361 354
362 private: 355 private:
363 void updateHeaderParsedState(const AtomicString& name); 356 void updateHeaderParsedState(const AtomicString& name);
364 357
365 KURL m_url; 358 KURL m_url;
366 AtomicString m_mimeType; 359 AtomicString m_mimeType;
367 long long m_expectedContentLength; 360 long long m_expectedContentLength;
368 AtomicString m_textEncodingName; 361 AtomicString m_textEncodingName;
369 String m_suggestedFilename;
370 int m_httpStatusCode; 362 int m_httpStatusCode;
371 AtomicString m_httpStatusText; 363 AtomicString m_httpStatusText;
372 HTTPHeaderMap m_httpHeaderFields; 364 HTTPHeaderMap m_httpHeaderFields;
373 time_t m_lastModifiedDate; 365 time_t m_lastModifiedDate;
374 bool m_wasCached : 1; 366 bool m_wasCached : 1;
375 unsigned m_connectionID; 367 unsigned m_connectionID;
376 bool m_connectionReused : 1; 368 bool m_connectionReused : 1;
377 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; 369 RefPtr<ResourceLoadTiming> m_resourceLoadTiming;
378 RefPtr<ResourceLoadInfo> m_resourceLoadInfo; 370 RefPtr<ResourceLoadInfo> m_resourceLoadInfo;
379 371
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 struct CrossThreadResourceResponseData { 495 struct CrossThreadResourceResponseData {
504 WTF_MAKE_NONCOPYABLE(CrossThreadResourceResponseData); 496 WTF_MAKE_NONCOPYABLE(CrossThreadResourceResponseData);
505 USING_FAST_MALLOC(CrossThreadResourceResponseData); 497 USING_FAST_MALLOC(CrossThreadResourceResponseData);
506 498
507 public: 499 public:
508 CrossThreadResourceResponseData() {} 500 CrossThreadResourceResponseData() {}
509 KURL m_url; 501 KURL m_url;
510 String m_mimeType; 502 String m_mimeType;
511 long long m_expectedContentLength; 503 long long m_expectedContentLength;
512 String m_textEncodingName; 504 String m_textEncodingName;
513 String m_suggestedFilename;
514 int m_httpStatusCode; 505 int m_httpStatusCode;
515 String m_httpStatusText; 506 String m_httpStatusText;
516 std::unique_ptr<CrossThreadHTTPHeaderMapData> m_httpHeaders; 507 std::unique_ptr<CrossThreadHTTPHeaderMapData> m_httpHeaders;
517 time_t m_lastModifiedDate; 508 time_t m_lastModifiedDate;
518 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; 509 RefPtr<ResourceLoadTiming> m_resourceLoadTiming;
519 bool m_hasMajorCertificateErrors; 510 bool m_hasMajorCertificateErrors;
520 ResourceResponse::SecurityStyle m_securityStyle; 511 ResourceResponse::SecurityStyle m_securityStyle;
521 ResourceResponse::SecurityDetails m_securityDetails; 512 ResourceResponse::SecurityDetails m_securityDetails;
522 // This is |certificate| from SecurityDetails since that structure should 513 // This is |certificate| from SecurityDetails since that structure should
523 // use an AtomicString but this temporary structure is sent across threads. 514 // use an AtomicString but this temporary structure is sent across threads.
(...skipping 18 matching lines...) Expand all
542 long long m_encodedDataLength; 533 long long m_encodedDataLength;
543 long long m_encodedBodyLength; 534 long long m_encodedBodyLength;
544 long long m_decodedBodyLength; 535 long long m_decodedBodyLength;
545 String m_downloadedFilePath; 536 String m_downloadedFilePath;
546 RefPtr<BlobDataHandle> m_downloadedFileHandle; 537 RefPtr<BlobDataHandle> m_downloadedFileHandle;
547 }; 538 };
548 539
549 } // namespace blink 540 } // namespace blink
550 541
551 #endif // ResourceResponse_h 542 #endif // ResourceResponse_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698