| Index: chrome/service/cloud_print/cloud_print_helpers.cc
|
| ===================================================================
|
| --- chrome/service/cloud_print/cloud_print_helpers.cc (revision 64444)
|
| +++ chrome/service/cloud_print/cloud_print_helpers.cc (working copy)
|
| @@ -14,7 +14,6 @@
|
| #include "base/values.h"
|
| #include "chrome/service/cloud_print/cloud_print_consts.h"
|
| #include "chrome/common/net/url_fetcher.h"
|
| -#include "chrome/service/net/service_url_request_context.h"
|
| #include "chrome/service/service_process.h"
|
|
|
| std::string StringFromJobStatus(cloud_print::PrintJobStatus status) {
|
| @@ -138,14 +137,12 @@
|
| const std::string& response_data, bool* succeeded,
|
| DictionaryValue** response_dict) {
|
| scoped_ptr<Value> message_value(base::JSONReader::Read(response_data, false));
|
| - if (!message_value.get()) {
|
| - NOTREACHED();
|
| + if (!message_value.get())
|
| return false;
|
| - }
|
| - if (!message_value->IsType(Value::TYPE_DICTIONARY)) {
|
| - NOTREACHED();
|
| +
|
| + if (!message_value->IsType(Value::TYPE_DICTIONARY))
|
| return false;
|
| - }
|
| +
|
| scoped_ptr<DictionaryValue> response_dict_local(
|
| static_cast<DictionaryValue*>(message_value.release()));
|
| if (succeeded)
|
| @@ -155,37 +152,6 @@
|
| return true;
|
| }
|
|
|
| -void CloudPrintHelpers::PrepCloudPrintRequest(URLFetcher* request,
|
| - const std::string& auth_token) {
|
| - DCHECK(g_service_process);
|
| - request->set_request_context(new ServiceURLRequestContextGetter());
|
| - std::string headers = "Authorization: GoogleLogin auth=";
|
| - headers += auth_token;
|
| - headers += "\r\n";
|
| - headers += kChromeCloudPrintProxyHeader;
|
| - request->set_extra_request_headers(headers);
|
| -}
|
| -
|
| -void CloudPrintHelpers::HandleServerError(int* error_count, int max_retry_count,
|
| - int64 max_retry_interval,
|
| - int64 base_retry_interval,
|
| - Task* task_to_retry,
|
| - Task* task_on_give_up) {
|
| - (*error_count)++;
|
| - if ((-1 != max_retry_count) && (*error_count > max_retry_count)) {
|
| - if (task_on_give_up) {
|
| - MessageLoop::current()->PostTask(FROM_HERE, task_on_give_up);
|
| - }
|
| - } else {
|
| - int64 retry_interval = base_retry_interval * (*error_count);
|
| - if ((-1 != max_retry_interval) && (retry_interval > max_retry_interval)) {
|
| - retry_interval = max_retry_interval;
|
| - }
|
| - MessageLoop::current()->PostDelayedTask(FROM_HERE, task_to_retry,
|
| - retry_interval);
|
| - }
|
| -}
|
| -
|
| void CloudPrintHelpers::AddMultipartValueForUpload(
|
| const std::string& value_name, const std::string& value,
|
| const std::string& mime_boundary, const std::string& content_type,
|
|
|