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

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

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 years, 5 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_streaming_remote_engine.h" 5 #include "content/browser/speech/google_streaming_remote_engine.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/big_endian.h" 10 #include "base/big_endian.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 313 }
314 314
315 // Setup downstream fetcher. 315 // Setup downstream fetcher.
316 std::vector<std::string> downstream_args; 316 std::vector<std::string> downstream_args;
317 downstream_args.push_back( 317 downstream_args.push_back(
318 "key=" + net::EscapeQueryParamValue(google_apis::GetAPIKey(), true)); 318 "key=" + net::EscapeQueryParamValue(google_apis::GetAPIKey(), true));
319 downstream_args.push_back("pair=" + request_key); 319 downstream_args.push_back("pair=" + request_key);
320 downstream_args.push_back("output=pb"); 320 downstream_args.push_back("output=pb");
321 GURL downstream_url(std::string(kWebServiceBaseUrl) + 321 GURL downstream_url(std::string(kWebServiceBaseUrl) +
322 std::string(kDownstreamUrl) + 322 std::string(kDownstreamUrl) +
323 JoinString(downstream_args, '&')); 323 base::JoinString(downstream_args, "&"));
324 324
325 downstream_fetcher_ = URLFetcher::Create( 325 downstream_fetcher_ = URLFetcher::Create(
326 kDownstreamUrlFetcherIdForTesting, downstream_url, URLFetcher::GET, this); 326 kDownstreamUrlFetcherIdForTesting, downstream_url, URLFetcher::GET, this);
327 downstream_fetcher_->SetRequestContext(url_context_.get()); 327 downstream_fetcher_->SetRequestContext(url_context_.get());
328 downstream_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | 328 downstream_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
329 net::LOAD_DO_NOT_SEND_COOKIES | 329 net::LOAD_DO_NOT_SEND_COOKIES |
330 net::LOAD_DO_NOT_SEND_AUTH_DATA); 330 net::LOAD_DO_NOT_SEND_AUTH_DATA);
331 downstream_fetcher_->Start(); 331 downstream_fetcher_->Start();
332 332
333 // Setup upstream fetcher. 333 // Setup upstream fetcher.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 if (use_framed_post_data_) { 365 if (use_framed_post_data_) {
366 std::string audio_format; 366 std::string audio_format;
367 if (preamble_encoder_) 367 if (preamble_encoder_)
368 audio_format = preamble_encoder_->mime_type() + ","; 368 audio_format = preamble_encoder_->mime_type() + ",";
369 audio_format += encoder_->mime_type(); 369 audio_format += encoder_->mime_type();
370 upstream_args.push_back( 370 upstream_args.push_back(
371 "audioFormat=" + net::EscapeQueryParamValue(audio_format, true)); 371 "audioFormat=" + net::EscapeQueryParamValue(audio_format, true));
372 } 372 }
373 GURL upstream_url(std::string(kWebServiceBaseUrl) + 373 GURL upstream_url(std::string(kWebServiceBaseUrl) +
374 std::string(kUpstreamUrl) + 374 std::string(kUpstreamUrl) +
375 JoinString(upstream_args, '&')); 375 base::JoinString(upstream_args, "&"));
376 376
377 upstream_fetcher_ = URLFetcher::Create(kUpstreamUrlFetcherIdForTesting, 377 upstream_fetcher_ = URLFetcher::Create(kUpstreamUrlFetcherIdForTesting,
378 upstream_url, URLFetcher::POST, this); 378 upstream_url, URLFetcher::POST, this);
379 if (use_framed_post_data_) 379 if (use_framed_post_data_)
380 upstream_fetcher_->SetChunkedUpload("application/octet-stream"); 380 upstream_fetcher_->SetChunkedUpload("application/octet-stream");
381 else 381 else
382 upstream_fetcher_->SetChunkedUpload(encoder_->mime_type()); 382 upstream_fetcher_->SetChunkedUpload(encoder_->mime_type());
383 upstream_fetcher_->SetRequestContext(url_context_.get()); 383 upstream_fetcher_->SetRequestContext(url_context_.get());
384 upstream_fetcher_->SetReferrer(config_.origin_url); 384 upstream_fetcher_->SetReferrer(config_.origin_url);
385 upstream_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | 385 upstream_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 } 627 }
628 628
629 GoogleStreamingRemoteEngine::FSMEventArgs::FSMEventArgs(FSMEvent event_value) 629 GoogleStreamingRemoteEngine::FSMEventArgs::FSMEventArgs(FSMEvent event_value)
630 : event(event_value) { 630 : event(event_value) {
631 } 631 }
632 632
633 GoogleStreamingRemoteEngine::FSMEventArgs::~FSMEventArgs() { 633 GoogleStreamingRemoteEngine::FSMEventArgs::~FSMEventArgs() {
634 } 634 }
635 635
636 } // namespace content 636 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/speech/google_one_shot_remote_engine.cc ('k') | content/child/websocket_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698