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

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

Issue 2472753003: Move fromJSONString to V8Binding (Closed)
Patch Set: Really swallow exception Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/modules/payments/PaymentResponse.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
index 2c96ff2de9e2a66dfb19fd0e2eb3abe6fcea2c4e..92a5eeb6eda4fc572e753891e38039a2fed2f51d 100644
--- a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
+++ b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
@@ -72,17 +72,11 @@ Blob* PushMessageData::blob() const {
ScriptValue PushMessageData::json(ScriptState* scriptState,
ExceptionState& exceptionState) const {
- v8::Isolate* isolate = scriptState->isolate();
-
ScriptState::Scope scope(scriptState);
- v8::Local<v8::String> dataString = v8String(isolate, text());
-
- v8::TryCatch block(isolate);
- v8::Local<v8::Value> parsed;
- if (!v8Call(v8::JSON::Parse(isolate, dataString), parsed, block)) {
- exceptionState.rethrowV8Exception(block.Exception());
+ v8::Local<v8::Value> parsed =
+ fromJSONString(scriptState->isolate(), text(), exceptionState);
+ if (exceptionState.hadException())
return ScriptValue();
- }
return ScriptValue(scriptState, parsed);
}
« no previous file with comments | « third_party/WebKit/Source/modules/payments/PaymentResponse.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698