| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/remoting/directory_add_request.h" | 5 #include "chrome/browser/remoting/directory_add_request.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 fetcher_->set_upload_data("application/json", request_content); | 54 fetcher_->set_upload_data("application/json", request_content); |
| 55 fetcher_->set_extra_request_headers(headers.ToString()); | 55 fetcher_->set_extra_request_headers(headers.ToString()); |
| 56 | 56 |
| 57 // And then start the request. | 57 // And then start the request. |
| 58 fetcher_->Start(); | 58 fetcher_->Start(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void DirectoryAddRequest::OnURLFetchComplete( | 61 void DirectoryAddRequest::OnURLFetchComplete( |
| 62 const URLFetcher* source, | 62 const URLFetcher* source, |
| 63 const GURL& url, | 63 const GURL& url, |
| 64 const URLRequestStatus& status, | 64 const net::URLRequestStatus& status, |
| 65 int response_code, | 65 int response_code, |
| 66 const ResponseCookies& cookies, | 66 const ResponseCookies& cookies, |
| 67 const std::string& data) { | 67 const std::string& data) { |
| 68 DCHECK_EQ(source, fetcher_.get()); | 68 DCHECK_EQ(source, fetcher_.get()); |
| 69 | 69 |
| 70 // Destroy the fetcher after the response has been received. | 70 // Destroy the fetcher after the response has been received. |
| 71 fetcher_.reset(); | 71 fetcher_.reset(); |
| 72 | 72 |
| 73 Result result; | 73 Result result; |
| 74 std::string error_message; | 74 std::string error_message; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 LOG(WARNING) << "Received error when trying to register Chromoting host. " | 116 LOG(WARNING) << "Received error when trying to register Chromoting host. " |
| 117 << "status.is_success(): " << status.is_success() | 117 << "status.is_success(): " << status.is_success() |
| 118 << " response_code: " << response_code | 118 << " response_code: " << response_code |
| 119 << " error_message: " << error_message; | 119 << " error_message: " << error_message; |
| 120 } | 120 } |
| 121 | 121 |
| 122 done_callback_->Run(result, error_message); | 122 done_callback_->Run(result, error_message); |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace remoting | 125 } // namespace remoting |
| OLD | NEW |