| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/dial/dial_api.h" | 5 #include "chrome/browser/extensions/api/dial/dial_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 return true; | 174 return true; |
| 175 } | 175 } |
| 176 | 176 |
| 177 void DialDiscoverNowFunction::Work() { | 177 void DialDiscoverNowFunction::Work() { |
| 178 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 178 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 179 result_ = dial_->dial_registry()->DiscoverNow(); | 179 result_ = dial_->dial_registry()->DiscoverNow(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool DialDiscoverNowFunction::Respond() { | 182 bool DialDiscoverNowFunction::Respond() { |
| 183 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 183 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 184 SetResult(base::MakeUnique<base::FundamentalValue>(result_)); | 184 SetResult(base::MakeUnique<base::Value>(result_)); |
| 185 return true; | 185 return true; |
| 186 } | 186 } |
| 187 | 187 |
| 188 DialFetchDeviceDescriptionFunction::DialFetchDeviceDescriptionFunction() | 188 DialFetchDeviceDescriptionFunction::DialFetchDeviceDescriptionFunction() |
| 189 : dial_(nullptr) {} | 189 : dial_(nullptr) {} |
| 190 | 190 |
| 191 DialFetchDeviceDescriptionFunction::~DialFetchDeviceDescriptionFunction() {} | 191 DialFetchDeviceDescriptionFunction::~DialFetchDeviceDescriptionFunction() {} |
| 192 | 192 |
| 193 bool DialFetchDeviceDescriptionFunction::RunAsync() { | 193 bool DialFetchDeviceDescriptionFunction::RunAsync() { |
| 194 dial_ = DialAPIFactory::GetForBrowserContext(browser_context()).get(); | 194 dial_ = DialAPIFactory::GetForBrowserContext(browser_context()).get(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 void DialFetchDeviceDescriptionFunction::OnFetchError( | 254 void DialFetchDeviceDescriptionFunction::OnFetchError( |
| 255 const std::string& message) { | 255 const std::string& message) { |
| 256 // Destroy the DeviceDescriptionFetcher since it still contains a reference | 256 // Destroy the DeviceDescriptionFetcher since it still contains a reference |
| 257 // to |this| in its un-invoked callback. | 257 // to |this| in its un-invoked callback. |
| 258 device_description_fetcher_.reset(); | 258 device_description_fetcher_.reset(); |
| 259 SetError(message); | 259 SetError(message); |
| 260 SendResponse(false); | 260 SendResponse(false); |
| 261 } | 261 } |
| 262 | 262 |
| 263 } // namespace extensions | 263 } // namespace extensions |
| OLD | NEW |