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

Side by Side Diff: content/browser/device_orientation/provider_impl.cc

Issue 13433002: Implement DeviceOrientation API on Windows (Closed) Base URL: ssh://nhu@powerbuilder.sh.intel.com/home/www-data/git-repos/perc/chromium.git@sensor
Patch Set: Update according to comment #17 Created 7 years, 8 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
« no previous file with comments | « content/browser/device_orientation/provider.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/browser/device_orientation/provider_impl.h" 5 #include "content/browser/device_orientation/provider_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 Stop(); 217 Stop();
218 } 218 }
219 219
220 void ProviderImpl::Start(DeviceData::Type type) { 220 void ProviderImpl::Start(DeviceData::Type type) {
221 DCHECK(MessageLoop::current() == creator_loop_); 221 DCHECK(MessageLoop::current() == creator_loop_);
222 DCHECK(!polling_thread_); 222 DCHECK(!polling_thread_);
223 223
224 polling_thread_ = new PollingThread("Device data polling thread", 224 polling_thread_ = new PollingThread("Device data polling thread",
225 weak_factory_.GetWeakPtr(), 225 weak_factory_.GetWeakPtr(),
226 creator_loop_); 226 creator_loop_);
227 #if defined(OS_WIN)
228 polling_thread_->init_com_with_mta(true);
229 #endif
227 if (!polling_thread_->Start()) { 230 if (!polling_thread_->Start()) {
228 LOG(ERROR) << "Failed to start device data polling thread"; 231 LOG(ERROR) << "Failed to start device data polling thread";
229 delete polling_thread_; 232 delete polling_thread_;
230 polling_thread_ = NULL; 233 polling_thread_ = NULL;
231 return; 234 return;
232 } 235 }
233 ScheduleInitializePollingThread(type); 236 ScheduleInitializePollingThread(type);
234 } 237 }
235 238
236 void ProviderImpl::Stop() { 239 void ProviderImpl::Stop() {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 observers_.erase(current); 287 observers_.erase(current);
285 } 288 }
286 289
287 if (observers_.empty()) 290 if (observers_.empty())
288 Stop(); 291 Stop();
289 } 292 }
290 } 293 }
291 294
292 295
293 } // namespace content 296 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/device_orientation/provider.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698