OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 if (instance_ == NULL) { | 341 if (instance_ == NULL) { |
342 instance_ = new DataLogImpl(); | 342 instance_ = new DataLogImpl(); |
343 return instance_->Init(); | 343 return instance_->Init(); |
344 } else { | 344 } else { |
345 ++instance_->counter_; | 345 ++instance_->counter_; |
346 } | 346 } |
347 return 0; | 347 return 0; |
348 } | 348 } |
349 | 349 |
350 int DataLogImpl::Init() { | 350 int DataLogImpl::Init() { |
351 file_writer_thread_ = ThreadWrapper::CreateThread( | 351 file_writer_thread_ = |
352 DataLogImpl::Run, instance_, "DataLog"); | 352 PlatformThread::CreateThread(DataLogImpl::Run, instance_, "DataLog"); |
353 bool success = file_writer_thread_->Start(); | 353 bool success = file_writer_thread_->Start(); |
354 if (!success) | 354 if (!success) |
355 return -1; | 355 return -1; |
356 file_writer_thread_->SetPriority(kHighestPriority); | 356 file_writer_thread_->SetPriority(kHighestPriority); |
357 return 0; | 357 return 0; |
358 } | 358 } |
359 | 359 |
360 DataLogImpl* DataLogImpl::StaticInstance() { | 360 DataLogImpl* DataLogImpl::StaticInstance() { |
361 return instance_; | 361 return instance_; |
362 } | 362 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 } | 435 } |
436 | 436 |
437 void DataLogImpl::StopThread() { | 437 void DataLogImpl::StopThread() { |
438 if (file_writer_thread_) { | 438 if (file_writer_thread_) { |
439 flush_event_->Set(); | 439 flush_event_->Set(); |
440 file_writer_thread_->Stop(); | 440 file_writer_thread_->Stop(); |
441 } | 441 } |
442 } | 442 } |
443 | 443 |
444 } // namespace webrtc | 444 } // namespace webrtc |
OLD | NEW |