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

Side by Side Diff: content/public/renderer/v8_value_converter.h

Issue 10387055: Support optional arguments in SendRequestNatives::StartRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed John's comments Created 8 years, 7 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_ 5 #ifndef CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_
6 #define CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_ 6 #define CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_
7 7
8 #include "content/common/content_export.h" 8 #include "content/common/content_export.h"
9 #include "v8/include/v8.h" 9 #include "v8/include/v8.h"
10 10
(...skipping 10 matching lines...) Expand all
21 // The JSON types (null, boolean, string, number, array, and object) as well as 21 // The JSON types (null, boolean, string, number, array, and object) as well as
22 // binary values are supported. For binary values, we convert to WebKit 22 // binary values are supported. For binary values, we convert to WebKit
23 // ArrayBuffers, and support converting from an ArrayBuffer or any of the 23 // ArrayBuffers, and support converting from an ArrayBuffer or any of the
24 // ArrayBufferView subclasses (Uint8Array, etc.). 24 // ArrayBufferView subclasses (Uint8Array, etc.).
25 class CONTENT_EXPORT V8ValueConverter { 25 class CONTENT_EXPORT V8ValueConverter {
26 public: 26 public:
27 static V8ValueConverter* create(); 27 static V8ValueConverter* create();
28 28
29 virtual ~V8ValueConverter() {} 29 virtual ~V8ValueConverter() {}
30 30
31 // Use the following setters to support additional types other than the
32 // default ones.
33 virtual bool GetUndefinedAllowed() const = 0;
34 virtual void SetUndefinedAllowed(bool val) = 0;
35
36 virtual bool GetDateAllowed() const = 0;
37 virtual void SetDateAllowed(bool val) = 0;
38
39 virtual bool GetRegexpAllowed() const = 0;
40 virtual void SetRegexpAllowed(bool val) = 0;
41
31 // Converts Value to v8::Value. Unsupported types are replaced with null. 42 // Converts Value to v8::Value. Unsupported types are replaced with null.
32 // If an array or object throws while setting a value, that property or item 43 // If an array or object throws while setting a value, that property or item
33 // is skipped, leaving a hole in the case of arrays. 44 // is skipped, leaving a hole in the case of arrays.
34 virtual v8::Handle<v8::Value> ToV8Value( 45 virtual v8::Handle<v8::Value> ToV8Value(
35 const base::Value* value, 46 const base::Value* value,
36 v8::Handle<v8::Context> context) const = 0; 47 v8::Handle<v8::Context> context) const = 0;
37 48
38 // Converts v8::Value to Value. Unsupported types are replaced with null. 49 // Converts v8::Value to Value. Unsupported types are replaced with null.
39 // If an array or object throws while getting a value, that property or item 50 // If an array or object throws while getting a value, that property or item
40 // is replaced with null. 51 // is replaced with null.
41 virtual base::Value* FromV8Value(v8::Handle<v8::Value> value, 52 virtual base::Value* FromV8Value(v8::Handle<v8::Value> value,
42 v8::Handle<v8::Context> context) const = 0; 53 v8::Handle<v8::Context> context) const = 0;
43 }; 54 };
44 55
45 } // namespace content 56 } // namespace content
46 57
47 #endif // CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_ 58 #endif // CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/send_request_natives.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698