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

Side by Side Diff: Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp

Issue 12092048: Merge 140748 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 v8::Handle<v8::Value> V8History::stateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 44 v8::Handle<v8::Value> V8History::stateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
45 { 45 {
46 INC_STATS("DOM.History.state"); 46 INC_STATS("DOM.History.state");
47 History* history = V8History::toNative(info.Holder()); 47 History* history = V8History::toNative(info.Holder());
48 48
49 v8::Handle<v8::Value> value = info.Holder()->GetHiddenValue(V8HiddenProperty Name::state()); 49 v8::Handle<v8::Value> value = info.Holder()->GetHiddenValue(V8HiddenProperty Name::state());
50 50
51 if (!value.IsEmpty() && !history->stateChanged()) 51 if (!value.IsEmpty() && !history->stateChanged())
52 return value; 52 return value;
53 53
54 SerializedScriptValue* serialized = history->state(); 54 RefPtr<SerializedScriptValue> serialized = history->state();
55 value = serialized ? serialized->deserialize(0, info.GetIsolate()) : v8::Han dle<v8::Value>(v8Null(info.GetIsolate())); 55 value = serialized ? serialized->deserialize(0, info.GetIsolate()) : v8::Han dle<v8::Value>(v8Null(info.GetIsolate()));
56 info.Holder()->SetHiddenValue(V8HiddenPropertyName::state(), value); 56 info.Holder()->SetHiddenValue(V8HiddenPropertyName::state(), value);
57 57
58 return value; 58 return value;
59 } 59 }
60 60
61 v8::Handle<v8::Value> V8History::pushStateCallback(const v8::Arguments& args) 61 v8::Handle<v8::Value> V8History::pushStateCallback(const v8::Arguments& args)
62 { 62 {
63 bool didThrow = false; 63 bool didThrow = false;
64 RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(a rgs[0], 0, 0, didThrow, args.GetIsolate()); 64 RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(a rgs[0], 0, 0, didThrow, args.GetIsolate());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), h istory->frame(), DoNotReportSecurityError); 98 return BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), h istory->frame(), DoNotReportSecurityError);
99 } 99 }
100 100
101 bool V8History::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Val ue> key, v8::AccessType type, v8::Local<v8::Value>) 101 bool V8History::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Val ue> key, v8::AccessType type, v8::Local<v8::Value>)
102 { 102 {
103 History* history = V8History::toNative(host); 103 History* history = V8History::toNative(host);
104 return BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), h istory->frame(), DoNotReportSecurityError); 104 return BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), h istory->frame(), DoNotReportSecurityError);
105 } 105 }
106 106
107 } // namespace WebCore 107 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/history/replacestate-nocrash-expected.txt ('k') | Source/WebCore/history/HistoryItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698