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

Side by Side Diff: Source/devtools/front_end/source_frame/ImageView.js

Issue 672573002: DevTools: _base64ToSize doesn't check content param for null. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: return type annotation Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 infoListElement.createChild("dt").textContent = imageProperties[ i].name; 86 infoListElement.createChild("dt").textContent = imageProperties[ i].name;
87 infoListElement.createChild("dd").textContent = imageProperties[ i].value; 87 infoListElement.createChild("dd").textContent = imageProperties[ i].value;
88 } 88 }
89 infoListElement.createChild("dt").textContent = WebInspector.UIStrin g("URL"); 89 infoListElement.createChild("dt").textContent = WebInspector.UIStrin g("URL");
90 infoListElement.createChild("dd").appendChild(WebInspector.linkifyUR LAsNode(this._url, undefined, undefined, true /* externalResource */)); 90 infoListElement.createChild("dd").appendChild(WebInspector.linkifyUR LAsNode(this._url, undefined, undefined, true /* externalResource */));
91 this._container.appendChild(infoListElement); 91 this._container.appendChild(infoListElement);
92 } 92 }
93 this._imagePreviewElement = imagePreviewElement; 93 this._imagePreviewElement = imagePreviewElement;
94 }, 94 },
95 95
96 /**
97 * @param {?string} content
98 * @return {number}
99 */
96 _base64ToSize: function(content) 100 _base64ToSize: function(content)
97 { 101 {
98 if (!content.length) 102 if (!content || !content.length)
99 return 0; 103 return 0;
100 var size = (content.length || 0) * 3 / 4; 104 var size = (content.length || 0) * 3 / 4;
101 if (content.length > 0 && content[content.length - 1] === "=") 105 if (content.length > 0 && content[content.length - 1] === "=")
102 size--; 106 size--;
103 if (content.length > 1 && content[content.length - 2] === "=") 107 if (content.length > 1 && content[content.length - 2] === "=")
104 size--; 108 size--;
105 return size; 109 return size;
106 }, 110 },
107 111
108 _contextMenu: function(event) 112 _contextMenu: function(event)
(...skipping 16 matching lines...) Expand all
125 InspectorFrontendHost.copyText(this._url); 129 InspectorFrontendHost.copyText(this._url);
126 }, 130 },
127 131
128 _openInNewTab: function() 132 _openInNewTab: function()
129 { 133 {
130 InspectorFrontendHost.openInNewTab(this._url); 134 InspectorFrontendHost.openInNewTab(this._url);
131 }, 135 },
132 136
133 __proto__: WebInspector.VBox.prototype 137 __proto__: WebInspector.VBox.prototype
134 } 138 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698