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

Side by Side Diff: content/browser/speech/google_one_shot_remote_engine.cc

Issue 1874893002: Convert //content/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/speech/google_one_shot_remote_engine.h" 5 #include "content/browser/speech/google_one_shot_remote_engine.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 SpeechRecognitionResult* result, 42 SpeechRecognitionResult* result,
43 SpeechRecognitionError* error) { 43 SpeechRecognitionError* error) {
44 if (response_body.empty()) { 44 if (response_body.empty()) {
45 LOG(WARNING) << "ParseServerResponse: Response was empty."; 45 LOG(WARNING) << "ParseServerResponse: Response was empty.";
46 return false; 46 return false;
47 } 47 }
48 DVLOG(1) << "ParseServerResponse: Parsing response " << response_body; 48 DVLOG(1) << "ParseServerResponse: Parsing response " << response_body;
49 49
50 // Parse the response, ignoring comments. 50 // Parse the response, ignoring comments.
51 std::string error_msg; 51 std::string error_msg;
52 scoped_ptr<base::Value> response_value = base::JSONReader::ReadAndReturnError( 52 std::unique_ptr<base::Value> response_value =
53 response_body, base::JSON_PARSE_RFC, NULL, &error_msg); 53 base::JSONReader::ReadAndReturnError(response_body, base::JSON_PARSE_RFC,
54 NULL, &error_msg);
54 if (response_value == NULL) { 55 if (response_value == NULL) {
55 LOG(WARNING) << "ParseServerResponse: JSONReader failed : " << error_msg; 56 LOG(WARNING) << "ParseServerResponse: JSONReader failed : " << error_msg;
56 return false; 57 return false;
57 } 58 }
58 59
59 if (!response_value->IsType(base::Value::TYPE_DICTIONARY)) { 60 if (!response_value->IsType(base::Value::TYPE_DICTIONARY)) {
60 DVLOG(1) << "ParseServerResponse: Unexpected response type " 61 DVLOG(1) << "ParseServerResponse: Unexpected response type "
61 << response_value->GetType(); 62 << response_value->GetType();
62 return false; 63 return false;
63 } 64 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 289
289 bool GoogleOneShotRemoteEngine::IsRecognitionPending() const { 290 bool GoogleOneShotRemoteEngine::IsRecognitionPending() const {
290 return url_fetcher_ != NULL; 291 return url_fetcher_ != NULL;
291 } 292 }
292 293
293 int GoogleOneShotRemoteEngine::GetDesiredAudioChunkDurationMs() const { 294 int GoogleOneShotRemoteEngine::GetDesiredAudioChunkDurationMs() const {
294 return kAudioPacketIntervalMs; 295 return kAudioPacketIntervalMs;
295 } 296 }
296 297
297 } // namespace content 298 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/speech/google_one_shot_remote_engine.h ('k') | content/browser/speech/google_streaming_remote_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698