1*635a8641SAndroid Build Coastguard WorkerFrom 9d210ed05abf5e527f1de0b30fff62a8a3ae548f Mon Sep 17 00:00:00 2001
2*635a8641SAndroid Build Coastguard WorkerFrom: hscham <[email protected]>
3*635a8641SAndroid Build Coastguard WorkerDate: Mon, 13 Apr 2020 10:36:11 +0900
4*635a8641SAndroid Build Coastguard WorkerSubject: [PATCH] libchrome: r680000 forward compatibility patch part 1
5*635a8641SAndroid Build Coastguard Worker
6*635a8641SAndroid Build Coastguard WorkerThis CL includes:
7*635a8641SAndroid Build Coastguard Worker- Add header files base/hash/{hash,md5,sha1}.h and
8*635a8641SAndroid Build Coastguard Worker  base/system/sys_info.h from base/.
9*635a8641SAndroid Build Coastguard Worker- Add macro PRFilePath.
10*635a8641SAndroid Build Coastguard Worker- Add JSONReader::{Read,ReadAndReturnError,ReadToValue}Deprecated, alias
11*635a8641SAndroid Build Coastguard Worker  of the corresponding method without the Deprecated suffix.
12*635a8641SAndroid Build Coastguard Worker- Add empty class base::CheckedObserver.
13*635a8641SAndroid Build Coastguard Worker- Add bool operators == and != for base::RepeatingCallback.
14*635a8641SAndroid Build Coastguard Worker- ScopedClearLastError (up to r758621)
15*635a8641SAndroid Build Coastguard Worker
16*635a8641SAndroid Build Coastguard WorkerChange-Id: I6ba15f2938c02729e4fd51e5a4a52cb94e7c2a4e
17*635a8641SAndroid Build Coastguard Worker---
18*635a8641SAndroid Build Coastguard Worker base/callback.h            |  8 ++++++++
19*635a8641SAndroid Build Coastguard Worker base/files/file_path.h     |  1 +
20*635a8641SAndroid Build Coastguard Worker base/hash/hash.h           |  8 ++++++++
21*635a8641SAndroid Build Coastguard Worker base/hash/md5.h            | 10 ++++++++++
22*635a8641SAndroid Build Coastguard Worker base/hash/sha1.h           | 10 ++++++++++
23*635a8641SAndroid Build Coastguard Worker base/json/json_reader.h    | 19 +++++++++++++++++++
24*635a8641SAndroid Build Coastguard Worker base/observer_list_types.h | 24 ++++++++++++++++++++++++
25*635a8641SAndroid Build Coastguard Worker base/system/sys_info.h     | 10 ++++++++++
26*635a8641SAndroid Build Coastguard Worker 8 files changed, 90 insertions(+)
27*635a8641SAndroid Build Coastguard Worker create mode 100644 base/hash/hash.h
28*635a8641SAndroid Build Coastguard Worker create mode 100644 base/hash/md5.h
29*635a8641SAndroid Build Coastguard Worker create mode 100644 base/hash/sha1.h
30*635a8641SAndroid Build Coastguard Worker create mode 100644 base/observer_list_types.h
31*635a8641SAndroid Build Coastguard Worker create mode 100644 base/system/sys_info.h
32*635a8641SAndroid Build Coastguard Worker
33*635a8641SAndroid Build Coastguard Workerdiff --git a/base/callback.h b/base/callback.h
34*635a8641SAndroid Build Coastguard Workerindex bcda5af58..22a6f0e3e 100644
35*635a8641SAndroid Build Coastguard Worker--- a/base/callback.h
36*635a8641SAndroid Build Coastguard Worker+++ b/base/callback.h
37*635a8641SAndroid Build Coastguard Worker@@ -123,6 +123,14 @@ class RepeatingCallback<R(Args...)> : public internal::CallbackBaseCopyable {
38*635a8641SAndroid Build Coastguard Worker     return EqualsInternal(other);
39*635a8641SAndroid Build Coastguard Worker   }
40*635a8641SAndroid Build Coastguard Worker
41*635a8641SAndroid Build Coastguard Worker+  bool operator==(const RepeatingCallback& other) const {
42*635a8641SAndroid Build Coastguard Worker+    return EqualsInternal(other);
43*635a8641SAndroid Build Coastguard Worker+  }
44*635a8641SAndroid Build Coastguard Worker+
45*635a8641SAndroid Build Coastguard Worker+  bool operator!=(const RepeatingCallback& other) const {
46*635a8641SAndroid Build Coastguard Worker+    return !operator==(other);
47*635a8641SAndroid Build Coastguard Worker+  }
48*635a8641SAndroid Build Coastguard Worker+
49*635a8641SAndroid Build Coastguard Worker   R Run(Args... args) const & {
50*635a8641SAndroid Build Coastguard Worker     PolymorphicInvoke f =
51*635a8641SAndroid Build Coastguard Worker         reinterpret_cast<PolymorphicInvoke>(this->polymorphic_invoke());
52*635a8641SAndroid Build Coastguard Workerdiff --git a/base/files/file_path.h b/base/files/file_path.h
53*635a8641SAndroid Build Coastguard Workerindex 2dc15f9d0..36229979d 100644
54*635a8641SAndroid Build Coastguard Worker--- a/base/files/file_path.h
55*635a8641SAndroid Build Coastguard Worker+++ b/base/files/file_path.h
56*635a8641SAndroid Build Coastguard Worker@@ -131,6 +131,7 @@
57*635a8641SAndroid Build Coastguard Worker #define PRIsFP "ls"
58*635a8641SAndroid Build Coastguard Worker #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
59*635a8641SAndroid Build Coastguard Worker #define PRIsFP "s"
60*635a8641SAndroid Build Coastguard Worker+#define PRFilePath "s"
61*635a8641SAndroid Build Coastguard Worker #endif  // OS_WIN
62*635a8641SAndroid Build Coastguard Worker
63*635a8641SAndroid Build Coastguard Worker namespace base {
64*635a8641SAndroid Build Coastguard Workerdiff --git a/base/hash/hash.h b/base/hash/hash.h
65*635a8641SAndroid Build Coastguard Workernew file mode 100644
66*635a8641SAndroid Build Coastguard Workerindex 000000000..b35a96fd3
67*635a8641SAndroid Build Coastguard Worker--- /dev/null
68*635a8641SAndroid Build Coastguard Worker+++ b/base/hash/hash.h
69*635a8641SAndroid Build Coastguard Worker@@ -0,0 +1,8 @@
70*635a8641SAndroid Build Coastguard Worker+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
71*635a8641SAndroid Build Coastguard Worker+// Use of this source code is governed by a BSD-style license that can be
72*635a8641SAndroid Build Coastguard Worker+// found in the LICENSE file.
73*635a8641SAndroid Build Coastguard Worker+
74*635a8641SAndroid Build Coastguard Worker+#ifndef BASE_HASH_HASH_H_
75*635a8641SAndroid Build Coastguard Worker+#define BASE_HASH_HASH_H_
76*635a8641SAndroid Build Coastguard Worker+#include "base/hash.h"
77*635a8641SAndroid Build Coastguard Worker+#endif  // BASE_HASH_HASH_H_
78*635a8641SAndroid Build Coastguard Workerdiff --git a/base/hash/md5.h b/base/hash/md5.h
79*635a8641SAndroid Build Coastguard Workernew file mode 100644
80*635a8641SAndroid Build Coastguard Workerindex 000000000..821649319
81*635a8641SAndroid Build Coastguard Worker--- /dev/null
82*635a8641SAndroid Build Coastguard Worker+++ b/base/hash/md5.h
83*635a8641SAndroid Build Coastguard Worker@@ -0,0 +1,10 @@
84*635a8641SAndroid Build Coastguard Worker+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
85*635a8641SAndroid Build Coastguard Worker+// Use of this source code is governed by a BSD-style license that can be
86*635a8641SAndroid Build Coastguard Worker+// found in the LICENSE file.
87*635a8641SAndroid Build Coastguard Worker+
88*635a8641SAndroid Build Coastguard Worker+#ifndef BASE_HASH_MD5_H_
89*635a8641SAndroid Build Coastguard Worker+#define BASE_HASH_MD5_H_
90*635a8641SAndroid Build Coastguard Worker+
91*635a8641SAndroid Build Coastguard Worker+#include "base/md5.h"
92*635a8641SAndroid Build Coastguard Worker+
93*635a8641SAndroid Build Coastguard Worker+#endif  // BASE_HASH_MD5_H_
94*635a8641SAndroid Build Coastguard Workerdiff --git a/base/hash/sha1.h b/base/hash/sha1.h
95*635a8641SAndroid Build Coastguard Workernew file mode 100644
96*635a8641SAndroid Build Coastguard Workerindex 000000000..7d3e18212
97*635a8641SAndroid Build Coastguard Worker--- /dev/null
98*635a8641SAndroid Build Coastguard Worker+++ b/base/hash/sha1.h
99*635a8641SAndroid Build Coastguard Worker@@ -0,0 +1,10 @@
100*635a8641SAndroid Build Coastguard Worker+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
101*635a8641SAndroid Build Coastguard Worker+// Use of this source code is governed by a BSD-style license that can be
102*635a8641SAndroid Build Coastguard Worker+// found in the LICENSE file.
103*635a8641SAndroid Build Coastguard Worker+
104*635a8641SAndroid Build Coastguard Worker+#ifndef BASE_HASH_SHA1_H_
105*635a8641SAndroid Build Coastguard Worker+#define BASE_HASH_SHA1_H_
106*635a8641SAndroid Build Coastguard Worker+
107*635a8641SAndroid Build Coastguard Worker+#include "base/sha1.h"
108*635a8641SAndroid Build Coastguard Worker+
109*635a8641SAndroid Build Coastguard Worker+#endif  // BASE_HASH_SHA1_H_
110*635a8641SAndroid Build Coastguard Workerdiff --git a/base/json/json_reader.h b/base/json/json_reader.h
111*635a8641SAndroid Build Coastguard Workerindex 2c6bd3e47..05de907ce 100644
112*635a8641SAndroid Build Coastguard Worker--- a/base/json/json_reader.h
113*635a8641SAndroid Build Coastguard Worker+++ b/base/json/json_reader.h
114*635a8641SAndroid Build Coastguard Worker@@ -98,6 +98,12 @@ class BASE_EXPORT JSONReader {
115*635a8641SAndroid Build Coastguard Worker   static std::unique_ptr<Value> Read(StringPiece json,
116*635a8641SAndroid Build Coastguard Worker                                      int options = JSON_PARSE_RFC,
117*635a8641SAndroid Build Coastguard Worker                                      int max_depth = kStackMaxDepth);
118*635a8641SAndroid Build Coastguard Worker+  inline static std::unique_ptr<Value> ReadDeprecated(
119*635a8641SAndroid Build Coastguard Worker+      StringPiece json,
120*635a8641SAndroid Build Coastguard Worker+      int options = JSON_PARSE_RFC,
121*635a8641SAndroid Build Coastguard Worker+      int max_depth = kStackMaxDepth){
122*635a8641SAndroid Build Coastguard Worker+    return Read(json, options, max_depth);
123*635a8641SAndroid Build Coastguard Worker+  }
124*635a8641SAndroid Build Coastguard Worker
125*635a8641SAndroid Build Coastguard Worker   // Reads and parses |json| like Read(). |error_code_out| and |error_msg_out|
126*635a8641SAndroid Build Coastguard Worker   // are optional. If specified and nullptr is returned, they will be populated
127*635a8641SAndroid Build Coastguard Worker@@ -110,6 +116,16 @@ class BASE_EXPORT JSONReader {
128*635a8641SAndroid Build Coastguard Worker       std::string* error_msg_out,
129*635a8641SAndroid Build Coastguard Worker       int* error_line_out = nullptr,
130*635a8641SAndroid Build Coastguard Worker       int* error_column_out = nullptr);
131*635a8641SAndroid Build Coastguard Worker+  inline static std::unique_ptr<Value> ReadAndReturnErrorDeprecated(
132*635a8641SAndroid Build Coastguard Worker+      StringPiece json,
133*635a8641SAndroid Build Coastguard Worker+      int options,  // JSONParserOptions
134*635a8641SAndroid Build Coastguard Worker+      int* error_code_out,
135*635a8641SAndroid Build Coastguard Worker+      std::string* error_msg_out,
136*635a8641SAndroid Build Coastguard Worker+      int* error_line_out = nullptr,
137*635a8641SAndroid Build Coastguard Worker+      int* error_column_out = nullptr){
138*635a8641SAndroid Build Coastguard Worker+    return ReadAndReturnError(json, options, error_code_out, error_msg_out,
139*635a8641SAndroid Build Coastguard Worker+                              error_line_out, error_column_out);
140*635a8641SAndroid Build Coastguard Worker+  }
141*635a8641SAndroid Build Coastguard Worker
142*635a8641SAndroid Build Coastguard Worker   // Converts a JSON parse error code into a human readable message.
143*635a8641SAndroid Build Coastguard Worker   // Returns an empty string if error_code is JSON_NO_ERROR.
144*635a8641SAndroid Build Coastguard Worker@@ -117,6 +133,9 @@ class BASE_EXPORT JSONReader {
145*635a8641SAndroid Build Coastguard Worker
146*635a8641SAndroid Build Coastguard Worker   // Non-static version of Read() above.
147*635a8641SAndroid Build Coastguard Worker   std::unique_ptr<Value> ReadToValue(StringPiece json);
148*635a8641SAndroid Build Coastguard Worker+  inline std::unique_ptr<Value> ReadToValueDeprecated(StringPiece json) {
149*635a8641SAndroid Build Coastguard Worker+    return JSONReader::ReadToValue(json);
150*635a8641SAndroid Build Coastguard Worker+  }
151*635a8641SAndroid Build Coastguard Worker
152*635a8641SAndroid Build Coastguard Worker   // Returns the error code if the last call to ReadToValue() failed.
153*635a8641SAndroid Build Coastguard Worker   // Returns JSON_NO_ERROR otherwise.
154*635a8641SAndroid Build Coastguard Workerdiff --git a/base/observer_list_types.h b/base/observer_list_types.h
155*635a8641SAndroid Build Coastguard Workernew file mode 100644
156*635a8641SAndroid Build Coastguard Workerindex 000000000..8f3889735
157*635a8641SAndroid Build Coastguard Worker--- /dev/null
158*635a8641SAndroid Build Coastguard Worker+++ b/base/observer_list_types.h
159*635a8641SAndroid Build Coastguard Worker@@ -0,0 +1,24 @@
160*635a8641SAndroid Build Coastguard Worker+// Copyright 2018 The Chromium Authors. All rights reserved.
161*635a8641SAndroid Build Coastguard Worker+// Use of this source code is governed by a BSD-style license that can be
162*635a8641SAndroid Build Coastguard Worker+// found in the LICENSE file.
163*635a8641SAndroid Build Coastguard Worker+
164*635a8641SAndroid Build Coastguard Worker+#ifndef BASE_OBSERVER_LIST_TYPES_H_
165*635a8641SAndroid Build Coastguard Worker+#define BASE_OBSERVER_LIST_TYPES_H_
166*635a8641SAndroid Build Coastguard Worker+
167*635a8641SAndroid Build Coastguard Worker+#include "base/base_export.h"
168*635a8641SAndroid Build Coastguard Worker+#include "base/macros.h"
169*635a8641SAndroid Build Coastguard Worker+
170*635a8641SAndroid Build Coastguard Worker+namespace base {
171*635a8641SAndroid Build Coastguard Worker+class BASE_EXPORT CheckedObserver {
172*635a8641SAndroid Build Coastguard Worker+ public:
173*635a8641SAndroid Build Coastguard Worker+  CheckedObserver() {};
174*635a8641SAndroid Build Coastguard Worker+
175*635a8641SAndroid Build Coastguard Worker+ protected:
176*635a8641SAndroid Build Coastguard Worker+  virtual ~CheckedObserver() = default;
177*635a8641SAndroid Build Coastguard Worker+
178*635a8641SAndroid Build Coastguard Worker+  DISALLOW_COPY_AND_ASSIGN(CheckedObserver);
179*635a8641SAndroid Build Coastguard Worker+};
180*635a8641SAndroid Build Coastguard Worker+
181*635a8641SAndroid Build Coastguard Worker+}  // namespace base
182*635a8641SAndroid Build Coastguard Worker+
183*635a8641SAndroid Build Coastguard Worker+#endif  // BASE_OBSERVER_LIST_TYPES_H_
184*635a8641SAndroid Build Coastguard Workerdiff --git a/base/scoped_clear_last_error.h b/base/scoped_clear_last_error.h
185*635a8641SAndroid Build Coastguard Workernew file mode 100644
186*635a8641SAndroid Build Coastguard Workerindex 0000000..066730d
187*635a8641SAndroid Build Coastguard Worker--- /dev/null
188*635a8641SAndroid Build Coastguard Worker+++ b/base/scoped_clear_last_error.h
189*635a8641SAndroid Build Coastguard Worker@@ -0,0 +1,14 @@
190*635a8641SAndroid Build Coastguard Worker+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
191*635a8641SAndroid Build Coastguard Worker+// Use of this source code is governed by a BSD-style license that can be
192*635a8641SAndroid Build Coastguard Worker+// found in the LICENSE file.
193*635a8641SAndroid Build Coastguard Worker+
194*635a8641SAndroid Build Coastguard Worker+#ifndef BASE_SCOPED_CLEAR_LAST_ERROR_H_
195*635a8641SAndroid Build Coastguard Worker+#define BASE_SCOPED_CLEAR_LAST_ERROR_H_
196*635a8641SAndroid Build Coastguard Worker+
197*635a8641SAndroid Build Coastguard Worker+#include "base/scoped_clear_errno.h"
198*635a8641SAndroid Build Coastguard Worker+
199*635a8641SAndroid Build Coastguard Worker+namespace base {
200*635a8641SAndroid Build Coastguard Worker+using ScopedClearLastError = base::ScopedClearErrno;
201*635a8641SAndroid Build Coastguard Worker+}
202*635a8641SAndroid Build Coastguard Worker+
203*635a8641SAndroid Build Coastguard Worker+#endif  // BASE_SCOPED_CLEAR_LAST_ERROR_H_
204*635a8641SAndroid Build Coastguard Workerdiff --git a/base/system/sys_info.h b/base/system/sys_info.h
205*635a8641SAndroid Build Coastguard Workernew file mode 100644
206*635a8641SAndroid Build Coastguard Workerindex 000000000..60676e0e1
207*635a8641SAndroid Build Coastguard Worker--- /dev/null
208*635a8641SAndroid Build Coastguard Worker+++ b/base/system/sys_info.h
209*635a8641SAndroid Build Coastguard Worker@@ -0,0 +1,10 @@
210*635a8641SAndroid Build Coastguard Worker+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
211*635a8641SAndroid Build Coastguard Worker+// Use of this source code is governed by a BSD-style license that can be
212*635a8641SAndroid Build Coastguard Worker+// found in the LICENSE file.
213*635a8641SAndroid Build Coastguard Worker+
214*635a8641SAndroid Build Coastguard Worker+#ifndef BASE_SYSTEM_SYS_INFO_H_
215*635a8641SAndroid Build Coastguard Worker+#define BASE_SYSTEM_SYS_INFO_H_
216*635a8641SAndroid Build Coastguard Worker+
217*635a8641SAndroid Build Coastguard Worker+#include "base/sys_info.h"
218*635a8641SAndroid Build Coastguard Worker+
219*635a8641SAndroid Build Coastguard Worker+#endif  // BASE_SYSTEM_SYS_INFO_H_
220*635a8641SAndroid Build Coastguard Worker--
221*635a8641SAndroid Build Coastguard Worker2.26.1.301.g55bc3eb7cb9-goog
222*635a8641SAndroid Build Coastguard Worker
223