| 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 2658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2669 | 2669 |
| 2670 bool Internals::cursorUpdatePending() const { | 2670 bool Internals::cursorUpdatePending() const { |
| 2671 if (!GetFrame()) | 2671 if (!GetFrame()) |
| 2672 return false; | 2672 return false; |
| 2673 | 2673 |
| 2674 return GetFrame()->GetEventHandler().CursorUpdatePending(); | 2674 return GetFrame()->GetEventHandler().CursorUpdatePending(); |
| 2675 } | 2675 } |
| 2676 | 2676 |
| 2677 DOMArrayBuffer* Internals::serializeObject( | 2677 DOMArrayBuffer* Internals::serializeObject( |
| 2678 PassRefPtr<SerializedScriptValue> value) const { | 2678 PassRefPtr<SerializedScriptValue> value) const { |
| 2679 String string_value = value->ToWireString(); | 2679 StringView view = value->GetWireData(); |
| 2680 DOMArrayBuffer* buffer = DOMArrayBuffer::CreateUninitializedOrNull( | 2680 DCHECK(view.Is8Bit()); |
| 2681 string_value.length(), sizeof(UChar)); | 2681 DOMArrayBuffer* buffer = |
| 2682 if (buffer) { | 2682 DOMArrayBuffer::CreateUninitializedOrNull(view.length(), sizeof(LChar)); |
| 2683 string_value.CopyTo(static_cast<UChar*>(buffer->Data()), 0, | 2683 if (buffer) |
| 2684 string_value.length()); | 2684 memcpy(buffer->Data(), view.Characters8(), view.length()); |
| 2685 } | |
| 2686 return buffer; | 2685 return buffer; |
| 2687 } | 2686 } |
| 2688 | 2687 |
| 2689 PassRefPtr<SerializedScriptValue> Internals::deserializeBuffer( | 2688 PassRefPtr<SerializedScriptValue> Internals::deserializeBuffer( |
| 2690 DOMArrayBuffer* buffer) const { | 2689 DOMArrayBuffer* buffer) const { |
| 2691 String value(static_cast<const UChar*>(buffer->Data()), | 2690 String value(static_cast<const UChar*>(buffer->Data()), |
| 2692 buffer->ByteLength() / sizeof(UChar)); | 2691 buffer->ByteLength() / sizeof(UChar)); |
| 2693 return SerializedScriptValue::Create(value); | 2692 return SerializedScriptValue::Create(value); |
| 2694 } | 2693 } |
| 2695 | 2694 |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3279 | 3278 |
| 3280 void Internals::crash() { | 3279 void Internals::crash() { |
| 3281 CHECK(false) << "Intentional crash"; | 3280 CHECK(false) << "Intentional crash"; |
| 3282 } | 3281 } |
| 3283 | 3282 |
| 3284 void Internals::setIsLowEndDevice(bool is_low_end_device) { | 3283 void Internals::setIsLowEndDevice(bool is_low_end_device) { |
| 3285 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); | 3284 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); |
| 3286 } | 3285 } |
| 3287 | 3286 |
| 3288 } // namespace blink | 3287 } // namespace blink |
| OLD | NEW |