-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement BlobCollector * Change files * clang format
- Loading branch information
1 parent
ad17143
commit 0b31812
Showing
6 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/react-native-windows-5d9952b2-0b6d-4246-a1ec-994f54168545.json
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,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "Implement BlobCollector", | ||
"packageName": "react-native-windows", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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,21 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
#include "BlobCollector.h" | ||
|
||
using std::string; | ||
|
||
namespace Microsoft::React { | ||
|
||
using Networking::IBlobResource; | ||
|
||
BlobCollector::BlobCollector(string blobId, std::shared_ptr<IBlobResource> resource) noexcept | ||
: m_blobId{blobId}, m_weakResource{std::weak_ptr<IBlobResource>(resource)} {} | ||
|
||
BlobCollector::~BlobCollector() noexcept { | ||
if (auto rc = m_weakResource.lock()) { | ||
rc->Release(std::move(m_blobId)); | ||
} | ||
} | ||
|
||
} // namespace Microsoft::React |
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,23 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
#pragma once | ||
|
||
#include <Networking/IBlobResource.h> | ||
|
||
// JSI | ||
#include <jsi/jsi.h> | ||
|
||
namespace Microsoft::React { | ||
|
||
class JSI_EXPORT BlobCollector : public facebook::jsi::HostObject { | ||
std::string m_blobId; | ||
std::weak_ptr<Networking::IBlobResource> m_weakResource; | ||
|
||
public: | ||
BlobCollector(std::string blobId, std::shared_ptr<Networking::IBlobResource> resource) noexcept; | ||
|
||
~BlobCollector() noexcept; | ||
}; | ||
|
||
} // namespace Microsoft::React |
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