Fixes option-right in textfields when VoiceOver is set to read to the right of the...
[chromium-blink-merge.git] / chrome / renderer / static_v8_external_string_resource.h
blobe255a7d42f9e3841e5a0b757dac204f81b62f71e
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_RENDERER_EXTENSIONS_STATIC_V8_EXTERNAL_STRING_RESOURCE_H_
6 #define CHROME_RENDERER_EXTENSIONS_STATIC_V8_EXTERNAL_STRING_RESOURCE_H_
7 #pragma once
9 #include "base/compiler_specific.h"
10 #include "base/string_piece.h"
11 #include "v8/include/v8.h"
13 // A very simple implementation of v8::ExternalAsciiStringResource that just
14 // wraps a buffer. The buffer must outlive the v8 runtime instance this resource
15 // is used in.
16 class StaticV8ExternalAsciiStringResource
17 : public v8::String::ExternalAsciiStringResource {
18 public:
19 explicit StaticV8ExternalAsciiStringResource(const base::StringPiece& buffer);
20 virtual ~StaticV8ExternalAsciiStringResource();
22 virtual const char* data() const OVERRIDE;
23 virtual size_t length() const OVERRIDE;
25 private:
26 base::StringPiece buffer_;
29 #endif // CHROME_RENDERER_EXTENSIONS_STATIC_V8_EXTERNAL_STRING_RESOURCE_H_