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

Side by Side Diff: third_party/WebKit/Source/platform/network/NetworkUtils.cpp

Issue 2390583002: [WIP] WebFonts cache-aware timeout adaption (Closed)
Patch Set: switchToSwapPeriod(), Inspector disable cache check workaround 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/network/NetworkUtils.h" 5 #include "platform/network/NetworkUtils.h"
6 6
7 #include "components/mime_util/mime_util.h" 7 #include "components/mime_util/mime_util.h"
8 #include "net/base/data_url.h" 8 #include "net/base/data_url.h"
9 #include "net/base/ip_address.h" 9 #include "net/base/ip_address.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (net::DataURL::Parse(WebStringToGURL(url.getString()), &utf8MimeType, 70 if (net::DataURL::Parse(WebStringToGURL(url.getString()), &utf8MimeType,
71 &utf8Charset, &data) && 71 &utf8Charset, &data) &&
72 mime_util::IsSupportedMimeType(utf8MimeType)) { 72 mime_util::IsSupportedMimeType(utf8MimeType)) {
73 mimetype = WebString::fromUTF8(utf8MimeType); 73 mimetype = WebString::fromUTF8(utf8MimeType);
74 charset = WebString::fromUTF8(utf8Charset); 74 charset = WebString::fromUTF8(utf8Charset);
75 return SharedBuffer::create(data.data(), data.size()); 75 return SharedBuffer::create(data.data(), data.size());
76 } 76 }
77 return nullptr; 77 return nullptr;
78 } 78 }
79 79
80 int cacheMissErrorCode() {
81 return net::ERR_CACHE_MISS;
82 }
83
84 bool isCacheMissErrorCode(int code) {
85 return code == net::ERR_CACHE_MISS;
86 }
87
80 } // NetworkUtils 88 } // NetworkUtils
81 89
82 } // namespace blink 90 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698