diff options
author | yangguo <yangguo@chromium.org> | 2014-10-15 00:23:26 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-15 07:23:45 +0000 |
commit | 0d0c476f5dffd58b9f93be01db23c3847dbf0865 (patch) | |
tree | 159267f7d66eeb45f10bc568b7dcd1de163321c0 /extensions/renderer/static_v8_external_one_byte_string_resource.h | |
parent | 755aaca0859cf9db13fb17d99e987ade0553af6a (diff) | |
download | chromium_src-0d0c476f5dffd58b9f93be01db23c3847dbf0865.zip chromium_src-0d0c476f5dffd58b9f93be01db23c3847dbf0865.tar.gz chromium_src-0d0c476f5dffd58b9f93be01db23c3847dbf0865.tar.bz2 |
Rename v8::ExternalAsciiStringResource to v8::ExternalOneByteStringResource.
The former is a deprecated alias for the latter and will be removed soon.
TBR=eroman@chromium.org
BUG=none
Review URL: https://codereview.chromium.org/640413003
Cr-Commit-Position: refs/heads/master@{#299661}
Diffstat (limited to 'extensions/renderer/static_v8_external_one_byte_string_resource.h')
-rw-r--r-- | extensions/renderer/static_v8_external_one_byte_string_resource.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/extensions/renderer/static_v8_external_one_byte_string_resource.h b/extensions/renderer/static_v8_external_one_byte_string_resource.h new file mode 100644 index 0000000..97923b8 --- /dev/null +++ b/extensions/renderer/static_v8_external_one_byte_string_resource.h @@ -0,0 +1,33 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EXTENSIONS_RENDERER_STATIC_V8_EXTERNAL_ONE_BYTE_STRING_RESOURCE_H_ +#define EXTENSIONS_RENDERER_STATIC_V8_EXTERNAL_ONE_BYTE_STRING_RESOURCE_H_ + +#include "base/compiler_specific.h" +#include "base/strings/string_piece.h" +#include "v8/include/v8.h" + +namespace extensions { + +// A very simple implementation of v8::ExternalAsciiStringResource that just +// wraps a buffer. The buffer must outlive the v8 runtime instance this resource +// is used in. +class StaticV8ExternalOneByteStringResource + : public v8::String::ExternalOneByteStringResource { + public: + explicit StaticV8ExternalOneByteStringResource( + const base::StringPiece& buffer); + virtual ~StaticV8ExternalOneByteStringResource(); + + virtual const char* data() const override; + virtual size_t length() const override; + + private: + base::StringPiece buffer_; +}; + +} // namespace extensions + +#endif // EXTENSIONS_RENDERER_STATIC_V8_EXTERNAL_ONE_BYTE_STRING_RESOURCE_H_ |