Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(847)

Unified Diff: third_party/WebKit/Source/modules/push_messaging/PushManager.cpp

Issue 1816123002: Add testing for subscription from service workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review comments incorporated and all tests working Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/push_messaging/PushManager.cpp
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp b/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp
index c6fd24f3058c81833a64378776ae5abfa7f115f3..9cc076a618b9882b06787a438ac22187164be6e7 100644
--- a/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp
+++ b/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp
@@ -38,14 +38,14 @@ String bufferSourceToString(const ArrayBufferOrArrayBufferView& applicationServe
{
// Check the validity of the sender info. It must be a 65 byte unencrypted key,
// which has the byte 0x04 as the first byte as a marker.
- char* input;
+ unsigned char* input;
int length;
if (applicationServerKey.isArrayBuffer()) {
- input = static_cast<char*>(
+ input = static_cast<unsigned char*>(
applicationServerKey.getAsArrayBuffer()->data());
length = applicationServerKey.getAsArrayBuffer()->byteLength();
} else if (applicationServerKey.isArrayBufferView()) {
- input = static_cast<char*>(
+ input = static_cast<unsigned char*>(
applicationServerKey.getAsArrayBufferView()->buffer()->data());
length = applicationServerKey.getAsArrayBufferView()->buffer()->byteLength();
} else {
@@ -54,7 +54,7 @@ String bufferSourceToString(const ArrayBufferOrArrayBufferView& applicationServe
}
if (length == 65 && input[0] == 0x04)
- return WebString::fromUTF8(input, length);
+ return WebString::fromLatin1(input, length);
Michael van Ouwerkerk 2016/03/30 09:50:04 Or maybe only here. Maybe find a single best place
harkness 2016/03/30 10:51:49 I documented it all three places. Documentation is
exceptionState.throwDOMException(InvalidAccessError, "The provided applicationServerKey is not valid.");
return String();
}

Powered by Google App Engine
This is Rietveld 408576698