v8/src/uri.h
Stephan Herhut 7ead0c146e [cleanup] Move handle() function to handles-inl.h
This moves the static handle() helper function to handles-inl.h as
it ultimately depends on handles-inl.h anyway. To make this
possible, also move some other code to -inl.h files and split up
some header files into a -inl.h part.

Bug: v8:7490
Change-Id: I0f68e0728ba082b87ffa911aaf205d9b1523d2c9
Reviewed-on: https://chromium-review.googlesource.com/1146723
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Stephan Herhut <herhut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54617}
2018-07-23 16:10:10 +00:00

56 lines
1.7 KiB
C++

// Copyright 2016 the V8 project 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 V8_URI_H_
#define V8_URI_H_
#include "src/allocation.h"
#include "src/maybe-handles.h"
#include "src/objects.h"
namespace v8 {
namespace internal {
class Uri : public AllStatic {
public:
// ES6 section 18.2.6.2 decodeURI (encodedURI)
static MaybeHandle<String> DecodeUri(Isolate* isolate, Handle<String> uri) {
return Decode(isolate, uri, true);
}
// ES6 section 18.2.6.3 decodeURIComponent (encodedURIComponent)
static MaybeHandle<String> DecodeUriComponent(Isolate* isolate,
Handle<String> component) {
return Decode(isolate, component, false);
}
// ES6 section 18.2.6.4 encodeURI (uri)
static MaybeHandle<String> EncodeUri(Isolate* isolate, Handle<String> uri) {
return Encode(isolate, uri, true);
}
// ES6 section 18.2.6.5 encodeURIComponenet (uriComponent)
static MaybeHandle<String> EncodeUriComponent(Isolate* isolate,
Handle<String> component) {
return Encode(isolate, component, false);
}
// ES6 section B.2.1.1 escape (string)
static MaybeHandle<String> Escape(Isolate* isolate, Handle<String> string);
// ES6 section B.2.1.2 unescape (string)
static MaybeHandle<String> Unescape(Isolate* isolate, Handle<String> string);
private:
static MaybeHandle<String> Decode(Isolate* isolate, Handle<String> uri,
bool is_uri);
static MaybeHandle<String> Encode(Isolate* isolate, Handle<String> uri,
bool is_uri);
};
} // namespace internal
} // namespace v8
#endif // V8_URI_H_