diff options
author | bauerb <bauerb@chromium.org> | 2015-07-06 13:08:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-06 20:10:55 +0000 |
commit | 64c5a3888f21acf96082e89764e5ee66cc3531b6 (patch) | |
tree | bf10840cbd4cbf849e47fa9136afdff46a70f54b /components/safe_json.gypi | |
parent | f4401a54cc6ea79bf067b62eb941c311e613b601 (diff) | |
download | chromium_src-64c5a3888f21acf96082e89764e5ee66cc3531b6.zip chromium_src-64c5a3888f21acf96082e89764e5ee66cc3531b6.tar.gz chromium_src-64c5a3888f21acf96082e89764e5ee66cc3531b6.tar.bz2 |
Make JSONParser a pure interface.
This allows stubbing it out in tests, and using platform-specific implementations in the future.
As a side effect, the fact that the default implementation is refcounted is not exposed to clients anymore. Instead, the (newly added) factory method returns a raw pointer, and the object will delete itself after either of the callbacks has been called. In practice, this should not make a difference, as no client currently requires the SafeJsonParser to live longer than that, and in one case it actually simplifies things for the client by breaking a reference cycle.
TBR=benwells@chromium.org,brettw@chromium.org
BUG=501333
Review URL: https://codereview.chromium.org/1214903010
Cr-Commit-Position: refs/heads/master@{#337459}
Diffstat (limited to 'components/safe_json.gypi')
-rw-r--r-- | components/safe_json.gypi | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/components/safe_json.gypi b/components/safe_json.gypi index d3c5512..b7ab608 100644 --- a/components/safe_json.gypi +++ b/components/safe_json.gypi @@ -25,6 +25,23 @@ 'sources': [ 'safe_json/safe_json_parser.cc', 'safe_json/safe_json_parser.h', + 'safe_json/safe_json_parser_impl.cc', + 'safe_json/safe_json_parser_impl.h', + ], + }, + { + 'target_name': 'safe_json_test_support', + 'type': 'static_library', + 'dependencies': [ + '../base/base.gyp:base', + ':safe_json', + ], + 'include_dirs': [ + '..', + ], + 'sources': [ + 'safe_json/testing_json_parser.cc', + 'safe_json/testing_json_parser.h', ], }, { |