OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 /** | 220 /** |
221 * @param {!WebInspector.NetworkRequest} request | 221 * @param {!WebInspector.NetworkRequest} request |
222 * @return {!Element} | 222 * @return {!Element} |
223 */ | 223 */ |
224 WebInspector.linkifyRequestAsNode = function(request) | 224 WebInspector.linkifyRequestAsNode = function(request) |
225 { | 225 { |
226 var anchor = WebInspector.linkifyURLAsNode(request.url); | 226 var anchor = WebInspector.linkifyURLAsNode(request.url); |
227 anchor.requestId = request.requestId; | 227 anchor.requestId = request.requestId; |
228 return anchor; | 228 return anchor; |
229 } | 229 } |
230 | |
231 /** | |
232 * @param {?string} content | |
233 * @param {string} mimeType | |
234 * @param {boolean} contentEncoded | |
235 * @return {?string} | |
236 */ | |
237 WebInspector.contentAsDataURL = function(content, mimeType, contentEncoded) | |
238 { | |
239 const maxDataUrlSize = 1024 * 1024; | |
240 if (content === null || content.length > maxDataUrlSize) | |
241 return null; | |
242 | |
243 return "data:" + mimeType + (contentEncoded ? ";base64," : ",") + content; | |
244 } | |
OLD | NEW |