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

Side by Side Diff: chrome/browser/extensions/api/gcd_private/privet_v3_session.cc

Issue 1609923002: Fix remaining incompatibilities between scoped_ptr and unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/api/gcd_private/privet_v3_session.h" 5 #include "chrome/browser/extensions/api/gcd_private/privet_v3_session.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 << ", error: " << source->GetStatus().error() 152 << ", error: " << source->GetStatus().error()
153 << ", response code: " << source->GetResponseCode(); 153 << ", response code: " << source->GetResponseCode();
154 154
155 scoped_ptr<base::DictionaryValue> value = GetJson(source); 155 scoped_ptr<base::DictionaryValue> value = GetJson(source);
156 if (!value) { 156 if (!value) {
157 return ReplyAndDestroyItself(Result::STATUS_CONNECTIONERROR, 157 return ReplyAndDestroyItself(Result::STATUS_CONNECTIONERROR,
158 base::DictionaryValue()); 158 base::DictionaryValue());
159 } 159 }
160 160
161 bool has_error = value->HasKey(kPrivetV3KeyError); 161 bool has_error = value->HasKey(kPrivetV3KeyError);
162 LOG_IF(ERROR, has_error) << "Response: " << value; 162 LOG_IF(ERROR, has_error) << "Response: " << value.get();
163 ReplyAndDestroyItself( 163 ReplyAndDestroyItself(
164 has_error ? Result::STATUS_DEVICEERROR : Result::STATUS_SUCCESS, *value); 164 has_error ? Result::STATUS_DEVICEERROR : Result::STATUS_SUCCESS, *value);
165 } 165 }
166 166
167 net::URLFetcher* PrivetV3Session::FetcherDelegate::CreateURLFetcher( 167 net::URLFetcher* PrivetV3Session::FetcherDelegate::CreateURLFetcher(
168 const GURL& url, 168 const GURL& url,
169 net::URLFetcher::RequestType request_type, 169 net::URLFetcher::RequestType request_type,
170 bool orphaned) { 170 bool orphaned) {
171 DCHECK(!url_fetcher_); 171 DCHECK(!url_fetcher_);
172 DCHECK(session_); 172 DCHECK(session_);
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 // Only session with pairing in process needs to be canceled. Paired sessions 507 // Only session with pairing in process needs to be canceled. Paired sessions
508 // (in https mode) does not need to be canceled. 508 // (in https mode) does not need to be canceled.
509 if (session_id_.empty() || use_https_) 509 if (session_id_.empty() || use_https_)
510 return; 510 return;
511 base::DictionaryValue input; 511 base::DictionaryValue input;
512 input.SetString(kPrivetV3KeySessionId, session_id_); 512 input.SetString(kPrivetV3KeySessionId, session_id_);
513 StartPostRequest(kPrivetV3PairingCancelPath, input, MessageCallback()); 513 StartPostRequest(kPrivetV3PairingCancelPath, input, MessageCallback());
514 } 514 }
515 515
516 } // namespace extensions 516 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698