OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // The |FeedbackSender| object stores the user feedback to spellcheck | 5 // The |FeedbackSender| object stores the user feedback to spellcheck |
6 // suggestions in a |Feedback| object. | 6 // suggestions in a |Feedback| object. |
7 // | 7 // |
8 // When spelling service returns spellcheck results, these results first arrive | 8 // When spelling service returns spellcheck results, these results first arrive |
9 // in |FeedbackSender| to assign hash identifiers for each | 9 // in |FeedbackSender| to assign hash identifiers for each |
10 // misspelling-suggestion pair. If the spelling service identifies the same | 10 // misspelling-suggestion pair. If the spelling service identifies the same |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
400 scoped_ptr<base::Value> feedback_value(BuildFeedbackValue( | 400 scoped_ptr<base::Value> feedback_value(BuildFeedbackValue( |
401 BuildParams(BuildSuggestionInfo(feedback_data, is_first_feedback_batch), | 401 BuildParams(BuildSuggestionInfo(feedback_data, is_first_feedback_batch), |
402 language_, | 402 language_, |
403 country_), | 403 country_), |
404 api_version_)); | 404 api_version_)); |
405 std::string feedback; | 405 std::string feedback; |
406 base::JSONWriter::Write(feedback_value.get(), &feedback); | 406 base::JSONWriter::Write(feedback_value.get(), &feedback); |
407 | 407 |
408 // The tests use this identifier to mock the URL fetcher. | 408 // The tests use this identifier to mock the URL fetcher. |
409 static const int kUrlFetcherId = 0; | 409 static const int kUrlFetcherId = 0; |
410 net::URLFetcher* sender = net::URLFetcher::Create( | 410 net::URLFetcher* sender = |
411 kUrlFetcherId, feedback_service_url_, net::URLFetcher::POST, this); | 411 net::URLFetcher::Create(kUrlFetcherId, feedback_service_url_, |
412 net::URLFetcher::POST, this).release(); | |
Ryan Sleevi
2015/04/30 18:23:44
line 416
| |
412 sender->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | | 413 sender->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | |
413 net::LOAD_DO_NOT_SAVE_COOKIES); | 414 net::LOAD_DO_NOT_SAVE_COOKIES); |
414 sender->SetUploadData("application/json", feedback); | 415 sender->SetUploadData("application/json", feedback); |
415 senders_.push_back(sender); | 416 senders_.push_back(sender); |
416 | 417 |
417 // Request context is NULL in testing. | 418 // Request context is NULL in testing. |
418 if (request_context_.get()) { | 419 if (request_context_.get()) { |
419 sender->SetRequestContext(request_context_.get()); | 420 sender->SetRequestContext(request_context_.get()); |
420 sender->Start(); | 421 sender->Start(); |
421 } | 422 } |
422 } | 423 } |
423 | 424 |
424 } // namespace spellcheck | 425 } // namespace spellcheck |
OLD | NEW |