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

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

Issue 2062333002: mojo::Callback -> base::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, base::Bind(&SafeJsonParserImpl::ReportResults,
60 base::Unretained(this), nullptr, "Json error")); 60 base::Unretained(this), nullptr, "Json error"));
61 } 61 }
62 62
63 void SafeJsonParserImpl::OnParseDone(const base::ListValue& wrapper, 63 void SafeJsonParserImpl::OnParseDone(const base::ListValue& wrapper,
64 const mojo::String& error) { 64 mojo::String error) {
65 DCHECK(io_thread_checker_.CalledOnValidThread()); 65 DCHECK(io_thread_checker_.CalledOnValidThread());
66 66
67 // Shut down the utility process. 67 // Shut down the utility process.
68 mojo_json_parser_.reset(); 68 mojo_json_parser_.reset();
69 69
70 std::unique_ptr<base::Value> parsed_json; 70 std::unique_ptr<base::Value> parsed_json;
71 std::string error_message; 71 std::string error_message;
72 if (!wrapper.empty()) { 72 if (!wrapper.empty()) {
73 const base::Value* value = nullptr; 73 const base::Value* value = nullptr;
74 CHECK(wrapper.Get(0, &value)); 74 CHECK(wrapper.Get(0, &value));
(...skipping 19 matching lines...) Expand all
94 if (!error_callback_.is_null()) 94 if (!error_callback_.is_null())
95 error_callback_.Run(error); 95 error_callback_.Run(error);
96 } 96 }
97 97
98 // The parsing is done whether an error occured or not, so this instance can 98 // The parsing is done whether an error occured or not, so this instance can
99 // be cleaned up. 99 // be cleaned up.
100 delete this; 100 delete this;
101 } 101 }
102 102
103 } // namespace safe_json 103 } // namespace safe_json
OLDNEW
« no previous file with comments | « components/safe_json/safe_json_parser_impl.h ('k') | content/browser/background_sync/background_sync_service_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698