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

Unified Diff: Source/bindings/v8/custom/V8HistoryCustom.cpp

Issue 114363002: Structured cloning: improve DataCloneError reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + reset V8TestInterfaceConstructor.cpp result Created 7 years 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: Source/bindings/v8/custom/V8HistoryCustom.cpp
diff --git a/Source/bindings/v8/custom/V8HistoryCustom.cpp b/Source/bindings/v8/custom/V8HistoryCustom.cpp
index 427e87765323f3d34dfa690dfd889875367e1523..bf04305e15cfdca8322071998d37b6df56acc270 100644
--- a/Source/bindings/v8/custom/V8HistoryCustom.cpp
+++ b/Source/bindings/v8/custom/V8HistoryCustom.cpp
@@ -61,15 +61,14 @@ void V8History::stateAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Va
void V8History::pushStateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- bool didThrow = false;
- RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(info[0], 0, 0, didThrow, info.GetIsolate());
- if (didThrow)
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "pushState", "History", info.Holder(), info.GetIsolate());
+ RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(info[0], 0, 0, exceptionState, info.GetIsolate());
+ if (exceptionState.throwIfNeeded())
return;
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, title, info[1]);
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, url, argumentOrNull(info, 2));
- ExceptionState exceptionState(info.Holder(), info.GetIsolate());
History* history = V8History::toNative(info.Holder());
history->stateObjectAdded(historyState.release(), title, url, SameDocumentNavigationPushState, exceptionState);
info.Holder()->DeleteHiddenValue(V8HiddenPropertyName::state(info.GetIsolate()));
@@ -78,15 +77,14 @@ void V8History::pushStateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
void V8History::replaceStateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- bool didThrow = false;
- RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(info[0], 0, 0, didThrow, info.GetIsolate());
- if (didThrow)
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "replaceState", "History", info.Holder(), info.GetIsolate());
+ RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(info[0], 0, 0, exceptionState, info.GetIsolate());
+ if (exceptionState.throwIfNeeded())
return;
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, title, info[1]);
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, url, argumentOrNull(info, 2));
- ExceptionState exceptionState(info.Holder(), info.GetIsolate());
History* history = V8History::toNative(info.Holder());
history->stateObjectAdded(historyState.release(), title, url, SameDocumentNavigationReplaceState, exceptionState);
info.Holder()->DeleteHiddenValue(V8HiddenPropertyName::state(info.GetIsolate()));
« no previous file with comments | « Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp ('k') | Source/bindings/v8/custom/V8MessagePortCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698