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

Side by Side Diff: tracing/tracing/mre/job.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: Fix test Created 3 years, 9 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2015 The Chromium Authors. All rights reserved. 3 Copyright 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 <link rel="import" href="/tracing/base/guid.html"> 7 <link rel="import" href="/tracing/base/guid.html">
8 <link rel="import" href="/tracing/mre/function_handle.html"> 8 <link rel="import" href="/tracing/mre/function_handle.html">
9 9
10 <script> 10 <script>
11 'use strict'; 11 'use strict';
12 12
13 tr.exportTo('tr.mre', function() { 13 tr.exportTo('tr.mre', function() {
14 function Job(mapFunctionHandle, opt_guid) { 14 function Job(mapFunctionHandle, opt_guid) {
15 this.mapFunctionHandle_ = mapFunctionHandle; 15 this.mapFunctionHandle_ = mapFunctionHandle;
16 if (opt_guid === undefined) 16 if (opt_guid === undefined) {
17 this.guid_ = tr.b.GUID.allocateSimple(); 17 this.guid_ = tr.b.GUID.allocateSimple();
18 else 18 } else {
19 this.guid_ = opt_guid; 19 this.guid_ = opt_guid;
20 }
20 } 21 }
21 22
22 Job.prototype = { 23 Job.prototype = {
23 get mapFunctionHandle() { return this.mapFunctionHandle_; }, 24 get mapFunctionHandle() { return this.mapFunctionHandle_; },
24 get guid() { return this.guid_; }, 25 get guid() { return this.guid_; },
25 26
26 asDict: function() { 27 asDict: function() {
27 return { 28 return {
28 map_function_handle: this.mapFunctionHandle_.asDict(), 29 map_function_handle: this.mapFunctionHandle_.asDict(),
29 guid: this.guid_.toString() 30 guid: this.guid_.toString()
30 }; 31 };
31 } 32 }
32 }; 33 };
33 34
34 Job.fromDict = function(jobDict) { 35 Job.fromDict = function(jobDict) {
35 var mapFunctionHandle = null; 36 var mapFunctionHandle = null;
36 if (jobDict.map_function_handle !== null) { 37 if (jobDict.map_function_handle !== null) {
37 mapFunctionHandle = tr.mre.FunctionHandle.fromDict( 38 mapFunctionHandle = tr.mre.FunctionHandle.fromDict(
38 jobDict.map_function_handle); 39 jobDict.map_function_handle);
39 } 40 }
40 41
41 return new Job(mapFunctionHandle, jobDict.guid); 42 return new Job(mapFunctionHandle, jobDict.guid);
42 }; 43 };
43 44
44 return { 45 return {
45 Job, 46 Job,
46 }; 47 };
47 }); 48 });
48 </script> 49 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698