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

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

Issue 12560005: Merge 139854 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 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 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 RefPtr<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(info.GetIsolate()) : v8::Handle <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());
65 if (didThrow) 65 if (didThrow)
(...skipping 32 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 | « Source/WebCore/bindings/v8/SerializedScriptValue.cpp ('k') | Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698