Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: src/Utils.h

Issue 29810586: Issue 6526 - Use the maybe version of Compile() and Run() (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Left Patch Set: Actually remove the move code. Created June 20, 2018, 6:14 p.m.
Right Patch Set: r-value CheckedToLocal Created June 21, 2018, 1:04 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/JsError.cpp ('k') | src/Utils.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 24 matching lines...) Expand all
35 { 35 {
36 void CheckTryCatch(v8::Isolate* isolate, const v8::TryCatch& tryCatch); 36 void CheckTryCatch(v8::Isolate* isolate, const v8::TryCatch& tryCatch);
37 37
38 /* 38 /*
39 * Check for exception and then that a MaybeLocal<> isn't empty, 39 * Check for exception and then that a MaybeLocal<> isn't empty,
40 * and throw a JsError if it is, otherwise return the Local<> 40 * and throw a JsError if it is, otherwise return the Local<>
41 * Call using the macro %CHECKED_MAYBE to get the location. 41 * Call using the macro %CHECKED_MAYBE to get the location.
42 */ 42 */
43 template<class T> 43 template<class T>
44 v8::Local<T> CheckedToLocal(v8::Isolate* isolate, 44 v8::Local<T> CheckedToLocal(v8::Isolate* isolate,
45 v8::MaybeLocal<T>& value, const v8::TryCatch& tryCatch, 45 v8::MaybeLocal<T>&& value, const v8::TryCatch& tryCatch,
46 const char* filename, int line) 46 const char* filename, int line)
47 { 47 {
48 CheckTryCatch(isolate, tryCatch); 48 CheckTryCatch(isolate, tryCatch);
49 if (value.IsEmpty()) 49 if (value.IsEmpty())
50 throw AdblockPlus::JsError("Empty value at ", filename, line); 50 throw AdblockPlus::JsError("Empty value at ", filename, line);
51 return value.ToLocalChecked(); 51 return value.ToLocalChecked();
52 } 52 }
53 53
54 #define CHECKED_TO_LOCAL(isolate, value, tryCatch) \ 54 #define CHECKED_TO_LOCAL(isolate, value, tryCatch) \
55 AdblockPlus::Utils::CheckedToLocal(isolate, value, tryCatch, __FILE__, __LIN E__) 55 AdblockPlus::Utils::CheckedToLocal(isolate, value, tryCatch, __FILE__, __LIN E__)
(...skipping 16 matching lines...) Expand all
72 } 72 }
73 #ifdef _WIN32 73 #ifdef _WIN32
74 std::wstring ToUtf16String(const std::string& str); 74 std::wstring ToUtf16String(const std::string& str);
75 std::string ToUtf8String(const std::wstring& str); 75 std::string ToUtf8String(const std::wstring& str);
76 std::wstring CanonizeUrl(const std::wstring& url); 76 std::wstring CanonizeUrl(const std::wstring& url);
77 #endif 77 #endif
78 } 78 }
79 } 79 }
80 80
81 #endif 81 #endif
LEFTRIGHT

Powered by Google App Engine
This is Rietveld