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

Side by Side Diff: third_party/libaddressinput/chromium/cpp/src/util/json.h

Issue 147843008: libaddressinput - Don't make transient copies of entire JSON rule dictionaries (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no obsolete comment Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (C) 2013 Google Inc. 1 // Copyright (C) 2013 Google Inc.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // Sets |value| to the string for |key| if it exists and has a string value. 43 // Sets |value| to the string for |key| if it exists and has a string value.
44 // Returns false if the key doesn't exist or doesn't correspond to a string. 44 // Returns false if the key doesn't exist or doesn't correspond to a string.
45 // The JSON object must be parsed successfully in ParseObject() before 45 // The JSON object must be parsed successfully in ParseObject() before
46 // invoking this method. 46 // invoking this method.
47 virtual bool GetStringValueForKey(const std::string& key, 47 virtual bool GetStringValueForKey(const std::string& key,
48 std::string* value) const = 0; 48 std::string* value) const = 0;
49 49
50 // Sets |value| to the dictionary for |key| if it exists and has a dictionary 50 // Sets |value| to the dictionary for |key| if it exists and has a dictionary
51 // value. Returns false if the key doesn't exist or doesn't correspond to a 51 // value. Returns false if the key doesn't exist or doesn't correspond to a
52 // dictionary. The JSON object must be parsed successfully in ParseObject() 52 // dictionary. The JSON object must be parsed successfully in ParseObject()
53 // before invoking this method. 53 // before invoking this method. The returned object is only gauranteed to be
Dan Beam 2014/02/01 01:02:36 nit: |value| is only guaranteed to be valid as lon
Evan Stade 2014/02/01 01:11:12 Done.
54 // valid as long as |this| is valid.
54 virtual bool GetJsonValueForKey(const std::string& key, 55 virtual bool GetJsonValueForKey(const std::string& key,
55 scoped_ptr<Json>* value) const = 0; 56 scoped_ptr<Json>* value) const = 0;
56 57
57 protected: 58 protected:
58 Json(); 59 Json();
59 }; 60 };
60 61
61 } // namespace addressinput 62 } // namespace addressinput
62 } // namespace i18n 63 } // namespace i18n
63 64
64 #endif // I18N_ADDRESSINPUT_UTIL_JSON_H_ 65 #endif // I18N_ADDRESSINPUT_UTIL_JSON_H_
OLDNEW
« no previous file with comments | « no previous file | third_party/libaddressinput/chromium/json.cc » ('j') | third_party/libaddressinput/chromium/json.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698