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

Side by Side Diff: chrome/browser/local_discovery/privetv3_session.cc

Issue 699123004: Updated comments for gcdPrivate API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tue Nov 4 15:16:17 PST 2014 Created 6 years, 1 month 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/local_discovery/privetv3_session.h" 5 #include "chrome/browser/local_discovery/privetv3_session.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chrome/browser/local_discovery/privet_http.h" 10 #include "chrome/browser/local_discovery/privet_http.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 } 77 }
78 78
79 void PrivetV3Session::FetcherDelegate::OnParsedJson( 79 void PrivetV3Session::FetcherDelegate::OnParsedJson(
80 PrivetURLFetcher* fetcher, 80 PrivetURLFetcher* fetcher,
81 const base::DictionaryValue& value, 81 const base::DictionaryValue& value,
82 bool has_error) { 82 bool has_error) {
83 if (session_) { 83 if (session_) {
84 DeleteThis(); 84 DeleteThis();
85 callback_.Run( 85 callback_.Run(
86 has_error ? Result::STATUS_SETUPERROR : Result::STATUS_SUCCESS, value); 86 has_error ? Result::STATUS_DEVICEERROR : Result::STATUS_SUCCESS, value);
87 } 87 }
88 } 88 }
89 89
90 void PrivetV3Session::FetcherDelegate::DeleteThis() { 90 void PrivetV3Session::FetcherDelegate::DeleteThis() {
91 base::MessageLoop::current()->PostTask( 91 base::MessageLoop::current()->PostTask(
92 FROM_HERE, base::Bind(&PrivetV3Session::DeleteFetcher, session_, 92 FROM_HERE, base::Bind(&PrivetV3Session::DeleteFetcher, session_,
93 base::Unretained(this))); 93 base::Unretained(this)));
94 } 94 }
95 95
96 PrivetV3Session::Request::Request() { 96 PrivetV3Session::Request::Request() {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 void PrivetV3Session::RunCallback(const base::Closure& callback) { 164 void PrivetV3Session::RunCallback(const base::Closure& callback) {
165 callback.Run(); 165 callback.Run();
166 } 166 }
167 167
168 void PrivetV3Session::DeleteFetcher(const FetcherDelegate* fetcher) { 168 void PrivetV3Session::DeleteFetcher(const FetcherDelegate* fetcher) {
169 fetchers_.erase(std::find(fetchers_.begin(), fetchers_.end(), fetcher)); 169 fetchers_.erase(std::find(fetchers_.begin(), fetchers_.end(), fetcher));
170 } 170 }
171 171
172 } // namespace local_discovery 172 } // namespace local_discovery
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698