From c0df6b3239aef5d6b1bbeeb84dc1dd92464fb0d8 Mon Sep 17 00:00:00 2001 From: Jacob Trimble Date: Tue, 22 Dec 2015 11:19:22 -0800 Subject: [PATCH] Cleaned up Status class. Change-Id: I1ff470410b38d32ad828618f756487585660a272 --- packager/media/base/status.cc | 5 +++-- packager/media/base/status.h | 9 ++++----- packager/media/formats/mp4/fragmenter.h | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packager/media/base/status.cc b/packager/media/base/status.cc index 297e617a6c..021023d7f7 100644 --- a/packager/media/base/status.cc +++ b/packager/media/base/status.cc @@ -6,6 +6,7 @@ #include "packager/media/base/status.h" +#include "packager/base/logging.h" #include "packager/base/strings/stringprintf.h" namespace edash_packager { @@ -53,8 +54,8 @@ std::string ErrorCodeToString(Code error_code) { } // namespace } // namespace error -const Status& Status::OK = Status(error::OK, ""); -const Status& Status::UNKNOWN = Status(error::UNKNOWN, ""); +const Status Status::OK = Status(error::OK, ""); +const Status Status::UNKNOWN = Status(error::UNKNOWN, ""); std::string Status::ToString() const { if (error_code_ == error::OK) diff --git a/packager/media/base/status.h b/packager/media/base/status.h index 210168a522..a683fa5932 100644 --- a/packager/media/base/status.h +++ b/packager/media/base/status.h @@ -7,10 +7,9 @@ #ifndef MEDIA_BASE_STATUS_H_ #define MEDIA_BASE_STATUS_H_ +#include #include -#include "packager/base/logging.h" - namespace edash_packager { namespace media { @@ -91,8 +90,8 @@ class Status { /// @name Some pre-defined Status objects. /// @{ - static const Status& OK; // Identical to 0-arg constructor. - static const Status& UNKNOWN; + static const Status OK; // Identical to 0-arg constructor. + static const Status UNKNOWN; /// @} /// Store the specified error in this Status object. @@ -158,7 +157,7 @@ class Status { // generated copy constructor and assignment operator. }; -extern std::ostream& operator<<(std::ostream& os, const Status& x); +std::ostream& operator<<(std::ostream& os, const Status& x); } // namespace media } // namespace edash_packager diff --git a/packager/media/formats/mp4/fragmenter.h b/packager/media/formats/mp4/fragmenter.h index 9fe1ace1b5..aa64f48267 100644 --- a/packager/media/formats/mp4/fragmenter.h +++ b/packager/media/formats/mp4/fragmenter.h @@ -9,6 +9,7 @@ #include +#include "packager/base/logging.h" #include "packager/base/memory/ref_counted.h" #include "packager/base/memory/scoped_ptr.h" #include "packager/media/base/status.h"