refactor: make util::Promise type safe when chaining in native (#19809)
* refactor: make util::Promise type safe when chaining in native * fixup! refactor: make util::Promise type safe when chaining in native * chore: remove spare brackets
This commit is contained in:
parent
f7e3e1f97a
commit
6a3922d330
39 changed files with 275 additions and 343 deletions
|
@ -27,7 +27,9 @@ void FreeNodeBufferData(char* data, void* hint) {
|
|||
delete[] data;
|
||||
}
|
||||
|
||||
void RunPromiseInUI(util::Promise promise, char* blob_data, int size) {
|
||||
void RunPromiseInUI(util::Promise<v8::Local<v8::Value>> promise,
|
||||
char* blob_data,
|
||||
int size) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
v8::Isolate* isolate = promise.isolate();
|
||||
|
||||
|
@ -52,13 +54,13 @@ AtomBlobReader::AtomBlobReader(content::ChromeBlobStorageContext* blob_context)
|
|||
AtomBlobReader::~AtomBlobReader() {}
|
||||
|
||||
void AtomBlobReader::StartReading(const std::string& uuid,
|
||||
util::Promise promise) {
|
||||
util::Promise<v8::Local<v8::Value>> promise) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
|
||||
auto blob_data_handle = blob_context_->context()->GetBlobDataFromUUID(uuid);
|
||||
if (!blob_data_handle) {
|
||||
util::Promise::RejectPromise(std::move(promise),
|
||||
"Could not get blob data handle");
|
||||
util::Promise<v8::Local<v8::Value>>::RejectPromise(
|
||||
std::move(promise), "Could not get blob data handle");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue