OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "bindings/core/v8/ScriptValueSerializer.h" | 6 #include "bindings/core/v8/ScriptValueSerializer.h" |
7 | 7 |
8 #include "bindings/core/v8/V8ArrayBuffer.h" | 8 #include "bindings/core/v8/V8ArrayBuffer.h" |
9 #include "bindings/core/v8/V8ArrayBufferView.h" | 9 #include "bindings/core/v8/V8ArrayBufferView.h" |
10 #include "bindings/core/v8/V8Blob.h" | 10 #include "bindings/core/v8/V8Blob.h" |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 else | 829 else |
830 m_writer.writeBlob(blob->uuid(), blob->type(), blob->size()); | 830 m_writer.writeBlob(blob->uuid(), blob->type(), blob->size()); |
831 return 0; | 831 return 0; |
832 } | 832 } |
833 | 833 |
834 ScriptValueSerializer::StateBase* ScriptValueSerializer::writeCompositorProxy(v8
::Local<v8::Value> value, ScriptValueSerializer::StateBase* next) | 834 ScriptValueSerializer::StateBase* ScriptValueSerializer::writeCompositorProxy(v8
::Local<v8::Value> value, ScriptValueSerializer::StateBase* next) |
835 { | 835 { |
836 CompositorProxy* compositorProxy = V8CompositorProxy::toImpl(value.As<v8::Ob
ject>()); | 836 CompositorProxy* compositorProxy = V8CompositorProxy::toImpl(value.As<v8::Ob
ject>()); |
837 if (!compositorProxy) | 837 if (!compositorProxy) |
838 return nullptr; | 838 return nullptr; |
| 839 if (!compositorProxy->connected()) |
| 840 return handleError(DataCloneError, "A CompositorProxy object has been di
sconnected, and could therefore not be cloned.", next); |
839 m_writer.writeCompositorProxy(*compositorProxy); | 841 m_writer.writeCompositorProxy(*compositorProxy); |
840 return nullptr; | 842 return nullptr; |
841 } | 843 } |
842 | 844 |
843 ScriptValueSerializer::StateBase* ScriptValueSerializer::writeFile(v8::Local<v8:
:Value> value, ScriptValueSerializer::StateBase* next) | 845 ScriptValueSerializer::StateBase* ScriptValueSerializer::writeFile(v8::Local<v8:
:Value> value, ScriptValueSerializer::StateBase* next) |
844 { | 846 { |
845 File* file = V8File::toImpl(value.As<v8::Object>()); | 847 File* file = V8File::toImpl(value.As<v8::Object>()); |
846 if (!file) | 848 if (!file) |
847 return 0; | 849 return 0; |
848 if (file->hasBeenClosed()) | 850 if (file->hasBeenClosed()) |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1924 return false; | 1926 return false; |
1925 uint32_t objectReference = m_openCompositeReferenceStack[m_openCompositeRefe
renceStack.size() - 1]; | 1927 uint32_t objectReference = m_openCompositeReferenceStack[m_openCompositeRefe
renceStack.size() - 1]; |
1926 m_openCompositeReferenceStack.shrink(m_openCompositeReferenceStack.size() -
1); | 1928 m_openCompositeReferenceStack.shrink(m_openCompositeReferenceStack.size() -
1); |
1927 if (objectReference >= m_objectPool.size()) | 1929 if (objectReference >= m_objectPool.size()) |
1928 return false; | 1930 return false; |
1929 *object = m_objectPool[objectReference]; | 1931 *object = m_objectPool[objectReference]; |
1930 return true; | 1932 return true; |
1931 } | 1933 } |
1932 | 1934 |
1933 } // namespace blink | 1935 } // namespace blink |
OLD | NEW |