OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 #include "wtf/Uint32Array.h" | 82 #include "wtf/Uint32Array.h" |
83 #include "wtf/Uint8Array.h" | 83 #include "wtf/Uint8Array.h" |
84 #include "wtf/Uint8ClampedArray.h" | 84 #include "wtf/Uint8ClampedArray.h" |
85 #include "wtf/Vector.h" | 85 #include "wtf/Vector.h" |
86 #include "wtf/text/StringBuffer.h" | 86 #include "wtf/text/StringBuffer.h" |
87 #include "wtf/text/StringUTF8Adaptor.h" | 87 #include "wtf/text/StringUTF8Adaptor.h" |
88 | 88 |
89 // FIXME: consider crashing in debug mode on deserialization errors | 89 // FIXME: consider crashing in debug mode on deserialization errors |
90 // NOTE: be sure to change wireFormatVersion as necessary! | 90 // NOTE: be sure to change wireFormatVersion as necessary! |
91 | 91 |
92 namespace WebCore { | 92 namespace blink { |
93 | 93 |
94 namespace { | 94 namespace { |
95 | 95 |
96 // This code implements the HTML5 Structured Clone algorithm: | 96 // This code implements the HTML5 Structured Clone algorithm: |
97 // http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#safe-pa
ssing-of-structured-data | 97 // http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#safe-pa
ssing-of-structured-data |
98 | 98 |
99 // V8ObjectMap is a map from V8 objects to arbitrary values of type T. | 99 // V8ObjectMap is a map from V8 objects to arbitrary values of type T. |
100 // V8 objects (or handles to V8 objects) cannot be used as keys in ordinary wtf:
:HashMaps; | 100 // V8 objects (or handles to V8 objects) cannot be used as keys in ordinary wtf:
:HashMaps; |
101 // this class should be used instead. GCObject must be a subtype of v8::Object. | 101 // this class should be used instead. GCObject must be a subtype of v8::Object. |
102 // Suggested usage: | 102 // Suggested usage: |
(...skipping 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 { | 2181 { |
2182 uint32_t type; | 2182 uint32_t type; |
2183 String name; | 2183 String name; |
2184 String url; | 2184 String url; |
2185 if (!doReadUint32(&type)) | 2185 if (!doReadUint32(&type)) |
2186 return false; | 2186 return false; |
2187 if (!readWebCoreString(&name)) | 2187 if (!readWebCoreString(&name)) |
2188 return false; | 2188 return false; |
2189 if (!readWebCoreString(&url)) | 2189 if (!readWebCoreString(&url)) |
2190 return false; | 2190 return false; |
2191 DOMFileSystem* fs = DOMFileSystem::create(m_scriptState->executionContex
t(), name, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, url
)); | 2191 DOMFileSystem* fs = DOMFileSystem::create(m_scriptState->executionContex
t(), name, static_cast<blink::FileSystemType>(type), KURL(ParsedURLString, url))
; |
2192 *value = toV8(fs, m_scriptState->context()->Global(), isolate()); | 2192 *value = toV8(fs, m_scriptState->context()->Global(), isolate()); |
2193 return true; | 2193 return true; |
2194 } | 2194 } |
2195 | 2195 |
2196 bool readFile(v8::Handle<v8::Value>* value, bool isIndexed) | 2196 bool readFile(v8::Handle<v8::Value>* value, bool isIndexed) |
2197 { | 2197 { |
2198 RefPtrWillBeRawPtr<File> file; | 2198 RefPtrWillBeRawPtr<File> file; |
2199 if (isIndexed) { | 2199 if (isIndexed) { |
2200 if (m_version < 6) | 2200 if (m_version < 6) |
2201 return false; | 2201 return false; |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3055 { | 3055 { |
3056 // If the allocated memory was not registered before, then this class is lik
ely | 3056 // If the allocated memory was not registered before, then this class is lik
ely |
3057 // used in a context other then Worker's onmessage environment and the prese
nce of | 3057 // used in a context other then Worker's onmessage environment and the prese
nce of |
3058 // current v8 context is not guaranteed. Avoid calling v8 then. | 3058 // current v8 context is not guaranteed. Avoid calling v8 then. |
3059 if (m_externallyAllocatedMemory) { | 3059 if (m_externallyAllocatedMemory) { |
3060 ASSERT(v8::Isolate::GetCurrent()); | 3060 ASSERT(v8::Isolate::GetCurrent()); |
3061 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte
rnallyAllocatedMemory); | 3061 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte
rnallyAllocatedMemory); |
3062 } | 3062 } |
3063 } | 3063 } |
3064 | 3064 |
3065 } // namespace WebCore | 3065 } // namespace blink |
OLD | NEW |