| OLD | NEW | 
|---|
| 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  Loading... | 
| 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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|