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

Side by Side Diff: src/uri.h

Issue 2006673002: Reduce boilerplace for common pattern to return MaybeHandle. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase and fix Created 4 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
« no previous file with comments | « src/runtime/runtime-uri.cc ('k') | src/uri.cc » ('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 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 {
15 public: 15 public:
16 static Object* EncodeUri(Isolate* isolate, Handle<String> uri) { 16 static MaybeHandle<String> 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 MaybeHandle<String> 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 // DecodeUri
26 // DecodeUriComponent 26 // DecodeUriComponent
27 // escape 27 // escape
28 // unescape 28 // unescape
29 29
30 private: 30 private:
31 static Object* Encode(Isolate* isolate, Handle<String> uri, bool is_uri); 31 static MaybeHandle<String> Encode(Isolate* isolate, Handle<String> uri,
32 bool is_uri);
32 // decode 33 // decode
33 }; 34 };
34 35
35 } // namespace internal 36 } // namespace internal
36 } // namespace v8 37 } // namespace v8
37 38
38 #endif // V8_URI_H_ 39 #endif // V8_URI_H_
OLDNEW
« no previous file with comments | « src/runtime/runtime-uri.cc ('k') | src/uri.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698