-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename C++ part of ReadableMapBuffer to JReadableMapBuffer
Summary: Aligns naming with `JWritableMapBuffer` and other fbjni classes to indicate that it is a JNI binding. Changelog: [Internal] - Rename C++ part of ReadableMapBuffer to JReadableMapBuffer Reviewed By: mdvacca Differential Revision: D35219323 fbshipit-source-id: a7eb644a700a35dc94fa18e4fb3cc68f2cfa3e99
- Loading branch information
1 parent
81e4249
commit 2a6a685
Showing
11 changed files
with
71 additions
and
80 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...ava/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/JReadableMapBuffer.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "JReadableMapBuffer.h" | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
void JReadableMapBuffer::registerNatives() { | ||
registerHybrid({ | ||
makeNativeMethod( | ||
"importByteBuffer", JReadableMapBuffer::importByteBuffer), | ||
}); | ||
} | ||
|
||
jni::local_ref<jni::JByteBuffer> JReadableMapBuffer::importByteBuffer() { | ||
// TODO T83483191: Reevaluate what's the best approach here (allocateDirect vs | ||
// DirectByteBuffer). | ||
return jni::JByteBuffer::wrapBytes( | ||
serializedData_.data(), serializedData_.size()); | ||
} | ||
|
||
std::vector<uint8_t> JReadableMapBuffer::data() const { | ||
return serializedData_; | ||
} | ||
|
||
jni::local_ref<JReadableMapBuffer::jhybridobject> | ||
JReadableMapBuffer::createWithContents(MapBuffer &&map) { | ||
return newObjectCxxArgs(std::move(map)); | ||
} | ||
|
||
JReadableMapBuffer::JReadableMapBuffer(MapBuffer &&map) | ||
: serializedData_(std::move(map.bytes_)) { | ||
react_native_assert( | ||
(serializedData_.size() != 0) && "Error no content in map"); | ||
} | ||
|
||
} // namespace react | ||
} // namespace facebook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
...java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.cpp
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters