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

Side by Side Diff: components/safe_json/safe_json_parser_impl.cc

Issue 2558613002: Changed the SafeJsonParser connection error message. (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium 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 #include "components/safe_json/safe_json_parser_impl.h" 5 #include "components/safe_json/safe_json_parser_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/sequenced_task_runner.h" 8 #include "base/sequenced_task_runner.h"
9 #include "base/threading/sequenced_task_runner_handle.h" 9 #include "base/threading/sequenced_task_runner_handle.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 base::Bind(&SafeJsonParserImpl::OnParseDone, base::Unretained(this))); 49 base::Bind(&SafeJsonParserImpl::OnParseDone, base::Unretained(this)));
50 } 50 }
51 51
52 void SafeJsonParserImpl::OnConnectionError() { 52 void SafeJsonParserImpl::OnConnectionError() {
53 DCHECK(io_thread_checker_.CalledOnValidThread()); 53 DCHECK(io_thread_checker_.CalledOnValidThread());
54 54
55 // Shut down the utility process. 55 // Shut down the utility process.
56 mojo_json_parser_.reset(); 56 mojo_json_parser_.reset();
57 57
58 caller_task_runner_->PostTask( 58 caller_task_runner_->PostTask(
59 FROM_HERE, base::Bind(&SafeJsonParserImpl::ReportResults, 59 FROM_HERE,
60 base::Unretained(this), nullptr, "Json error")); 60 base::Bind(&SafeJsonParserImpl::ReportResults, base::Unretained(this),
61 nullptr, "Connection error with the json parser process."));
61 } 62 }
62 63
63 void SafeJsonParserImpl::OnParseDone(const base::ListValue& wrapper, 64 void SafeJsonParserImpl::OnParseDone(const base::ListValue& wrapper,
64 const base::Optional<std::string>& error) { 65 const base::Optional<std::string>& error) {
65 DCHECK(io_thread_checker_.CalledOnValidThread()); 66 DCHECK(io_thread_checker_.CalledOnValidThread());
66 67
67 // Shut down the utility process. 68 // Shut down the utility process.
68 mojo_json_parser_.reset(); 69 mojo_json_parser_.reset();
69 70
70 std::unique_ptr<base::Value> parsed_json; 71 std::unique_ptr<base::Value> parsed_json;
(...skipping 23 matching lines...) Expand all
94 if (!error_callback_.is_null()) 95 if (!error_callback_.is_null())
95 error_callback_.Run(error); 96 error_callback_.Run(error);
96 } 97 }
97 98
98 // The parsing is done whether an error occured or not, so this instance can 99 // The parsing is done whether an error occured or not, so this instance can
99 // be cleaned up. 100 // be cleaned up.
100 delete this; 101 delete this;
101 } 102 }
102 103
103 } // namespace safe_json 104 } // namespace safe_json
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698