Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/renderer/static_v8_external_string_resource.h

Issue 8820016: Don't attempt to forward declare StringPiece. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix include order. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/net/net_resource_provider.h ('k') | chrome/test/base/v8_unit_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_RENDERER_EXTENSIONS_STATIC_V8_EXTERNAL_STRING_RESOURCE_H_ 5 #ifndef CHROME_RENDERER_EXTENSIONS_STATIC_V8_EXTERNAL_STRING_RESOURCE_H_
6 #define CHROME_RENDERER_EXTENSIONS_STATIC_V8_EXTERNAL_STRING_RESOURCE_H_ 6 #define CHROME_RENDERER_EXTENSIONS_STATIC_V8_EXTERNAL_STRING_RESOURCE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
11 #include "v8/include/v8.h" 11 #include "v8/include/v8.h"
12 12
13 namespace base {
14 class StringPiece;
15 }
16
17 // A very simple implementation of v8::ExternalAsciiStringResource that just 13 // A very simple implementation of v8::ExternalAsciiStringResource that just
18 // wraps a buffer. The buffer must outlive the v8 runtime instance this resource 14 // wraps a buffer. The buffer must outlive the v8 runtime instance this resource
19 // is used in. 15 // is used in.
20 class StaticV8ExternalAsciiStringResource 16 class StaticV8ExternalAsciiStringResource
21 : public v8::String::ExternalAsciiStringResource { 17 : public v8::String::ExternalAsciiStringResource {
22 public: 18 public:
23 explicit StaticV8ExternalAsciiStringResource(const base::StringPiece& buffer); 19 explicit StaticV8ExternalAsciiStringResource(const base::StringPiece& buffer);
24 20
25 virtual const char* data() const OVERRIDE; 21 virtual const char* data() const OVERRIDE;
26 virtual size_t length() const OVERRIDE; 22 virtual size_t length() const OVERRIDE;
27 23
28 private: 24 private:
29 base::StringPiece buffer_; 25 base::StringPiece buffer_;
30 }; 26 };
31 27
32 #endif // CHROME_RENDERER_EXTENSIONS_STATIC_V8_EXTERNAL_STRING_RESOURCE_H_ 28 #endif // CHROME_RENDERER_EXTENSIONS_STATIC_V8_EXTERNAL_STRING_RESOURCE_H_
OLDNEW
« no previous file with comments | « chrome/common/net/net_resource_provider.h ('k') | chrome/test/base/v8_unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698