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

Side by Side Diff: Source/bindings/core/v8/SerializedScriptValue.h

Issue 1301953002: WebMessaging: Show a warning when MessagePort attempts to send a transferable ArrayBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | Source/bindings/core/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // of the HTML5 spec and generates exceptions as appropriate. 90 // of the HTML5 spec and generates exceptions as appropriate.
91 // Returns true if the array was filled, or false if the passed value was no t of an appropriate type. 91 // Returns true if the array was filled, or false if the passed value was no t of an appropriate type.
92 static bool extractTransferables(v8::Isolate*, v8::Local<v8::Value>, int, Me ssagePortArray&, ArrayBufferArray&, ExceptionState&); 92 static bool extractTransferables(v8::Isolate*, v8::Local<v8::Value>, int, Me ssagePortArray&, ArrayBufferArray&, ExceptionState&);
93 93
94 // Informs the V8 about external memory allocated and owned by this object. Large values should contribute 94 // Informs the V8 about external memory allocated and owned by this object. Large values should contribute
95 // to GC counters to eventually trigger a GC, otherwise flood of postMessage () can cause OOM. 95 // to GC counters to eventually trigger a GC, otherwise flood of postMessage () can cause OOM.
96 // Ok to invoke multiple times (only adds memory once). 96 // Ok to invoke multiple times (only adds memory once).
97 // The memory registration is revoked automatically in destructor. 97 // The memory registration is revoked automatically in destructor.
98 void registerMemoryAllocatedWithCurrentScriptContext(); 98 void registerMemoryAllocatedWithCurrentScriptContext();
99 99
100 // Returns true if the value contains a transferable ArrayBuffer.
101 bool containsTransferableArrayBuffer();
haraken 2015/08/19 12:10:40 Add const.
nhiroki 2015/08/19 12:59:16 Done.
102
100 private: 103 private:
101 // The followings are private, but used by SerializedScriptValueFactory. 104 // The followings are private, but used by SerializedScriptValueFactory.
102 enum StringDataMode { 105 enum StringDataMode {
103 StringValue, 106 StringValue,
104 WireData 107 WireData
105 }; 108 };
106 typedef Vector<WTF::ArrayBufferContents, 1> ArrayBufferContentsArray; 109 typedef Vector<WTF::ArrayBufferContents, 1> ArrayBufferContentsArray;
107 110
108 SerializedScriptValue(); 111 SerializedScriptValue();
109 explicit SerializedScriptValue(const String& wireData); 112 explicit SerializedScriptValue(const String& wireData);
(...skipping 11 matching lines...) Expand all
121 OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray; 124 OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray;
122 BlobDataHandleMap m_blobDataHandles; 125 BlobDataHandleMap m_blobDataHandles;
123 intptr_t m_externallyAllocatedMemory; 126 intptr_t m_externallyAllocatedMemory;
124 127
125 friend class SerializedScriptValueFactory; 128 friend class SerializedScriptValueFactory;
126 }; 129 };
127 130
128 } // namespace blink 131 } // namespace blink
129 132
130 #endif // SerializedScriptValue_h 133 #endif // SerializedScriptValue_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698