Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 V8_URI_H_ | 5 #ifndef V8_URI_H_ |
| 6 #define V8_URI_H_ | 6 #define V8_URI_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 class Uri : public AllStatic { | 14 class Uri : public AllStatic { |
|
Benedikt Meurer
2016/05/21 19:27:59
I'd rather handlify these functions completely. Re
Franzi
2016/05/22 12:34:08
Done.
| |
| 15 public: | 15 public: |
| 16 static Object* EncodeUri(Isolate* isolate, Handle<String> uri) { | 16 static Object* EncodeUri(Isolate* isolate, Handle<String> uri) { |
| 17 return Encode(isolate, uri, true); | 17 return Encode(isolate, uri, true); |
| 18 } | 18 } |
| 19 | 19 |
| 20 static Object* EncodeUriComponent(Isolate* isolate, | 20 static Object* EncodeUriComponent(Isolate* isolate, |
| 21 Handle<String> component) { | 21 Handle<String> component) { |
| 22 return Encode(isolate, component, false); | 22 return Encode(isolate, component, false); |
| 23 } | 23 } |
| 24 | 24 |
| 25 // DecodeUri | 25 static Object* DecodeUri(Isolate* isolate, Handle<String> uri) { |
|
Benedikt Meurer
2016/05/21 19:27:59
Nit: Please add references to the EcmaScript stand
Franzi
2016/05/22 12:34:08
Done.
| |
| 26 // DecodeUriComponent | 26 return Decode(isolate, uri, true); |
| 27 // escape | 27 } |
| 28 // unescape | 28 |
| 29 static Object* DecodeUriComponent(Isolate* isolate, | |
|
Benedikt Meurer
2016/05/21 19:27:59
Nit: Please add references to the EcmaScript stand
Franzi
2016/05/22 12:34:08
Done.
| |
| 30 Handle<String> component) { | |
| 31 return Decode(isolate, component, false); | |
| 32 } | |
| 29 | 33 |
| 30 private: | 34 private: |
| 31 static Object* Encode(Isolate* isolate, Handle<String> uri, bool is_uri); | 35 static Object* Encode(Isolate* isolate, Handle<String> uri, bool is_uri); |
| 32 // decode | 36 static Object* Decode(Isolate* isolate, Handle<String> uri, bool is_uri); |
| 33 }; | 37 }; |
| 34 | 38 |
| 35 } // namespace internal | 39 } // namespace internal |
| 36 } // namespace v8 | 40 } // namespace v8 |
| 37 | 41 |
| 38 #endif // V8_URI_H_ | 42 #endif // V8_URI_H_ |
| OLD | NEW |