| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 2646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2657 return buffer; | 2657 return buffer; |
| 2658 } | 2658 } |
| 2659 | 2659 |
| 2660 PassRefPtr<SerializedScriptValue> Internals::deserializeBuffer( | 2660 PassRefPtr<SerializedScriptValue> Internals::deserializeBuffer( |
| 2661 DOMArrayBuffer* buffer) const { | 2661 DOMArrayBuffer* buffer) const { |
| 2662 String value(static_cast<const UChar*>(buffer->data()), | 2662 String value(static_cast<const UChar*>(buffer->data()), |
| 2663 buffer->byteLength() / sizeof(UChar)); | 2663 buffer->byteLength() / sizeof(UChar)); |
| 2664 return SerializedScriptValue::create(value); | 2664 return SerializedScriptValue::create(value); |
| 2665 } | 2665 } |
| 2666 | 2666 |
| 2667 DOMArrayBuffer* Internals::serializeWithInlineWasm(ScriptValue value) const { |
| 2668 v8::Isolate* isolate = value.isolate(); |
| 2669 ExceptionState exceptionState(isolate, ExceptionState::ExecutionContext, |
| 2670 "Internals", "serializeWithInlineWasm"); |
| 2671 v8::Local<v8::Value> v8Value = value.v8Value(); |
| 2672 SerializedScriptValue::SerializeOptions options; |
| 2673 options.writeWasmToStream = true; |
| 2674 RefPtr<SerializedScriptValue> obj = SerializedScriptValue::serialize( |
| 2675 isolate, v8Value, options, exceptionState); |
| 2676 if (exceptionState.hadException()) |
| 2677 return nullptr; |
| 2678 return serializeObject(obj); |
| 2679 } |
| 2680 |
| 2681 ScriptValue Internals::deserializeBufferContainingWasm( |
| 2682 ScriptState* state, |
| 2683 DOMArrayBuffer* buffer) const { |
| 2684 String value(static_cast<const UChar*>(buffer->data()), |
| 2685 buffer->byteLength() / sizeof(UChar)); |
| 2686 DummyExceptionStateForTesting exceptionState; |
| 2687 SerializedScriptValue::DeserializeOptions options; |
| 2688 options.readWasmFromStream = true; |
| 2689 return ScriptValue::from( |
| 2690 state, SerializedScriptValue::create(value)->deserialize(state->isolate(), |
| 2691 options)); |
| 2692 } |
| 2693 |
| 2667 void Internals::forceReload(bool bypassCache) { | 2694 void Internals::forceReload(bool bypassCache) { |
| 2668 if (!frame()) | 2695 if (!frame()) |
| 2669 return; | 2696 return; |
| 2670 | 2697 |
| 2671 frame()->reload(bypassCache ? FrameLoadTypeReloadBypassingCache | 2698 frame()->reload(bypassCache ? FrameLoadTypeReloadBypassingCache |
| 2672 : FrameLoadTypeReloadMainResource, | 2699 : FrameLoadTypeReloadMainResource, |
| 2673 ClientRedirectPolicy::NotClientRedirect); | 2700 ClientRedirectPolicy::NotClientRedirect); |
| 2674 } | 2701 } |
| 2675 | 2702 |
| 2676 Node* Internals::visibleSelectionAnchorNode() { | 2703 Node* Internals::visibleSelectionAnchorNode() { |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3226 | 3253 |
| 3227 void Internals::crash() { | 3254 void Internals::crash() { |
| 3228 CHECK(false) << "Intentional crash"; | 3255 CHECK(false) << "Intentional crash"; |
| 3229 } | 3256 } |
| 3230 | 3257 |
| 3231 void Internals::setIsLowEndDevice(bool isLowEndDevice) { | 3258 void Internals::setIsLowEndDevice(bool isLowEndDevice) { |
| 3232 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice); | 3259 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice); |
| 3233 } | 3260 } |
| 3234 | 3261 |
| 3235 } // namespace blink | 3262 } // namespace blink |
| OLD | NEW |