Summary:
Part of #24875, adds a spec for HeapCapture

## Changelog

[General] [Added] - TM Spec for HeapCapture
Pull Request resolved: https://github.com/facebook/react-native/pull/24899

Reviewed By: fkgozali

Differential Revision: D15393464

Pulled By: RSNara

fbshipit-source-id: d8778285753ce8dbc87204ecfbddfa7339acd264
This commit is contained in:
Wojteg1337 2019-05-22 13:04:35 -07:00 коммит произвёл Facebook Github Bot
Родитель 67c3ed34ba
Коммит 94029eee54
3 изменённых файлов: 30 добавлений и 5 удалений

Просмотреть файл

@ -22,7 +22,7 @@ BatchedBridge.registerLazyCallableModule('JSTimers', () =>
require('./Timers/JSTimers'),
);
BatchedBridge.registerLazyCallableModule('HeapCapture', () =>
require('../Utilities/HeapCapture'),
require('../HeapCapture/HeapCapture'),
);
BatchedBridge.registerLazyCallableModule('SamplingProfiler', () =>
require('../Performance/SamplingProfiler'),

Просмотреть файл

@ -10,6 +10,8 @@
'use strict';
import NativeHeapCapture from './NativeHeapCapture';
const HeapCapture = {
captureHeap: function(path: string) {
let error = null;
@ -20,10 +22,9 @@ const HeapCapture = {
console.log('HeapCapture.captureHeap error: ' + e.toString());
error = e.toString();
}
require('../BatchedBridge/NativeModules').JSCHeapCapture.captureComplete(
path,
error,
);
if (NativeHeapCapture) {
NativeHeapCapture.captureComplete(path, error);
}
},
};

Просмотреть файл

@ -0,0 +1,24 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';
import type {TurboModule} from 'RCTExport';
import * as TurboModuleRegistry from 'TurboModuleRegistry';
export interface Spec extends TurboModule {
// Common interface
+captureHeap: (path: string) => void;
// Android only
+captureComplete: (path: string, error: ?string) => void;
}
export default TurboModuleRegistry.get<Spec>('HeapCapture');