| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 PassRefPtr<SerializedScriptValue> SerializedScriptValue::serialize( | 63 PassRefPtr<SerializedScriptValue> SerializedScriptValue::serialize( |
| 64 v8::Isolate* isolate, | 64 v8::Isolate* isolate, |
| 65 v8::Local<v8::Value> value, | 65 v8::Local<v8::Value> value, |
| 66 Transferables* transferables, | 66 Transferables* transferables, |
| 67 WebBlobInfoArray* blobInfo, | 67 WebBlobInfoArray* blobInfo, |
| 68 ExceptionState& exception) { | 68 ExceptionState& exception) { |
| 69 return SerializedScriptValueFactory::instance().create( | 69 return SerializedScriptValueFactory::instance().create( |
| 70 isolate, value, transferables, blobInfo, exception); | 70 isolate, value, transferables, blobInfo, exception); |
| 71 } | 71 } |
| 72 | 72 |
| 73 PassRefPtr<SerializedScriptValue> SerializedScriptValue::serialize( | |
| 74 const String& str) { | |
| 75 return create(ScriptValueSerializer::serializeWTFString(str)); | |
| 76 } | |
| 77 | |
| 78 PassRefPtr<SerializedScriptValue> | 73 PassRefPtr<SerializedScriptValue> |
| 79 SerializedScriptValue::serializeAndSwallowExceptions( | 74 SerializedScriptValue::serializeAndSwallowExceptions( |
| 80 v8::Isolate* isolate, | 75 v8::Isolate* isolate, |
| 81 v8::Local<v8::Value> value) { | 76 v8::Local<v8::Value> value) { |
| 82 DummyExceptionStateForTesting exceptionState; | 77 DummyExceptionStateForTesting exceptionState; |
| 83 RefPtr<SerializedScriptValue> serialized = | 78 RefPtr<SerializedScriptValue> serialized = |
| 84 serialize(isolate, value, nullptr, nullptr, exceptionState); | 79 serialize(isolate, value, nullptr, nullptr, exceptionState); |
| 85 if (exceptionState.hadException()) | 80 if (exceptionState.hadException()) |
| 86 return nullValue(); | 81 return nullValue(); |
| 87 return serialized.release(); | 82 return serialized.release(); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 void SerializedScriptValue::registerMemoryAllocatedWithCurrentScriptContext() { | 462 void SerializedScriptValue::registerMemoryAllocatedWithCurrentScriptContext() { |
| 468 if (m_externallyAllocatedMemory) | 463 if (m_externallyAllocatedMemory) |
| 469 return; | 464 return; |
| 470 | 465 |
| 471 m_externallyAllocatedMemory = static_cast<intptr_t>(dataLengthInBytes()); | 466 m_externallyAllocatedMemory = static_cast<intptr_t>(dataLengthInBytes()); |
| 472 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory( | 467 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory( |
| 473 m_externallyAllocatedMemory); | 468 m_externallyAllocatedMemory); |
| 474 } | 469 } |
| 475 | 470 |
| 476 } // namespace blink | 471 } // namespace blink |
| OLD | NEW |