OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2015 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/tracing/importer/importer.html"> | 8 <link rel="import" href="/tracing/importer/importer.html"> |
9 | 9 |
10 <script> | 10 <script> |
(...skipping 14 matching lines...) Expand all Loading... |
25 */ | 25 */ |
26 GcloudTraceImporter.canImport = function(eventData) { | 26 GcloudTraceImporter.canImport = function(eventData) { |
27 if (typeof(eventData) !== 'string' && !(eventData instanceof String)) | 27 if (typeof(eventData) !== 'string' && !(eventData instanceof String)) |
28 return false; | 28 return false; |
29 | 29 |
30 // Slice the data so we don't potentially do a replace on a gigantic string. | 30 // Slice the data so we don't potentially do a replace on a gigantic string. |
31 var normalizedEventData = eventData.slice(0, 20).replace(/\s/g, ''); | 31 var normalizedEventData = eventData.slice(0, 20).replace(/\s/g, ''); |
32 if (normalizedEventData.length < 14) | 32 if (normalizedEventData.length < 14) |
33 return false; | 33 return false; |
34 | 34 |
35 return normalizedEventData.slice(0, 14) == '{"projectId":"'; | 35 return normalizedEventData.slice(0, 14) === '{"projectId":"'; |
36 }; | 36 }; |
37 | 37 |
38 GcloudTraceImporter.prototype = { | 38 GcloudTraceImporter.prototype = { |
39 | 39 |
40 __proto__: tr.importer.Importer.prototype, | 40 __proto__: tr.importer.Importer.prototype, |
41 | 41 |
42 get importerName() { | 42 get importerName() { |
43 return 'GcloudTraceImporter'; | 43 return 'GcloudTraceImporter'; |
44 }, | 44 }, |
45 | 45 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 }; | 91 }; |
92 | 92 |
93 tr.importer.Importer.register(GcloudTraceImporter); | 93 tr.importer.Importer.register(GcloudTraceImporter); |
94 | 94 |
95 return { | 95 return { |
96 GcloudTraceImporter: GcloudTraceImporter | 96 GcloudTraceImporter: GcloudTraceImporter |
97 }; | 97 }; |
98 }); | 98 }); |
99 </script> | 99 </script> |
OLD | NEW |