uploadData => uploadRawData

This commit is contained in:
deepak1556 2016-10-24 15:55:06 +05:30 committed by Kevin Sawicki
parent 9536ebc0ad
commit 61576c39be
6 changed files with 10 additions and 6 deletions

View file

@ -215,7 +215,7 @@ Converter<scoped_refptr<ResourceRequestBodyImpl>>::ToV8(
std::unique_ptr<base::Value> bytes( std::unique_ptr<base::Value> bytes(
base::BinaryValue::CreateWithCopiedBuffer( base::BinaryValue::CreateWithCopiedBuffer(
element.bytes(), static_cast<size_t>(element.length()))); element.bytes(), static_cast<size_t>(element.length())));
post_data_dict->SetString("type", "data"); post_data_dict->SetString("type", "rawData");
post_data_dict->Set("bytes", std::move(bytes)); post_data_dict->Set("bytes", std::move(bytes));
} else if (type == ResourceRequestBodyImpl::Element::TYPE_FILE) { } else if (type == ResourceRequestBodyImpl::Element::TYPE_FILE) {
post_data_dict->SetString("type", "file"); post_data_dict->SetString("type", "file");
@ -257,7 +257,7 @@ bool Converter<scoped_refptr<ResourceRequestBodyImpl>>::FromV8(
if (!list->GetDictionary(i, &dict)) if (!list->GetDictionary(i, &dict))
return false; return false;
dict->GetString("type", &type); dict->GetString("type", &type);
if (type == "data") { if (type == "rawData") {
base::BinaryValue* bytes = nullptr; base::BinaryValue* bytes = nullptr;
dict->GetBinary("bytes", &bytes); dict->GetBinary("bytes", &bytes);
(*out)->AppendBytes(bytes->GetBuffer(), bytes->GetSize()); (*out)->AppendBytes(bytes->GetBuffer(), bytes->GetSize());

View file

@ -969,7 +969,7 @@ Same as `webContents.capturePage([rect, ]callback)`.
* `httpReferrer` String - A HTTP Referrer url. * `httpReferrer` String - A HTTP Referrer url.
* `userAgent` String - A user agent originating the request. * `userAgent` String - A user agent originating the request.
* `extraHeaders` String - Extra headers separated by "\n" * `extraHeaders` String - Extra headers separated by "\n"
* `postData` ([UploadData](structures/upload-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[] * `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[]
Same as `webContents.loadURL(url[, options])`. Same as `webContents.loadURL(url[, options])`.

View file

@ -0,0 +1,4 @@
# Upload RawData Object
* `type` String - `rawData`.
* `bytes` Buffer - Data to be uploaded.

View file

@ -490,7 +490,7 @@ win.loadURL('http://github.com')
* `httpReferrer` String - A HTTP Referrer url. * `httpReferrer` String - A HTTP Referrer url.
* `userAgent` String - A user agent originating the request. * `userAgent` String - A user agent originating the request.
* `extraHeaders` String - Extra headers separated by "\n" * `extraHeaders` String - Extra headers separated by "\n"
* `postData` ([UploadData](structures/upload-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[] * `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[]
Loads the `url` in the window. The `url` must contain the protocol prefix, Loads the `url` in the window. The `url` must contain the protocol prefix,
e.g. the `http://` or `file://`. If the load should bypass http cache then e.g. the `http://` or `file://`. If the load should bypass http cache then

View file

@ -265,7 +265,7 @@ webview.addEventListener('dom-ready', () => {
* `httpReferrer` String - A HTTP Referrer url. * `httpReferrer` String - A HTTP Referrer url.
* `userAgent` String - A user agent originating the request. * `userAgent` String - A user agent originating the request.
* `extraHeaders` String - Extra headers separated by "\n" * `extraHeaders` String - Extra headers separated by "\n"
* `postData` ([UploadData](structures/upload-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[] * `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[]
Loads the `url` in the webview, the `url` must contain the protocol prefix, Loads the `url` in the webview, the `url` must contain the protocol prefix,
e.g. the `http://` or `file://`. e.g. the `http://` or `file://`.

View file

@ -29,7 +29,7 @@ describe('browser-window module', function () {
const fileStats = fs.statSync(filePath) const fileStats = fs.statSync(filePath)
postData = [ postData = [
{ {
'type': 'data', 'type': 'rawData',
'bytes': new Buffer('username=test&file=') 'bytes': new Buffer('username=test&file=')
}, },
{ {