Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "webkit/glue/media/media_resource_loader_bridge_factory.h" | |
| 6 | |
| 7 #include "base/format_macros.h" | |
| 5 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 6 #include "webkit/glue/media/media_resource_loader_bridge_factory.h" | |
| 7 | 9 |
| 8 namespace { | 10 namespace { |
| 9 | 11 |
| 10 // A constant for an unknown position. | 12 // A constant for an unknown position. |
| 11 const int64 kPositionNotSpecified = -1; | 13 const int64 kPositionNotSpecified = -1; |
| 12 | 14 |
| 13 } // namespace | 15 } // namespace |
| 14 | 16 |
| 15 namespace webkit_glue { | 17 namespace webkit_glue { |
| 16 | 18 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 } | 52 } |
| 51 | 53 |
| 52 // static | 54 // static |
| 53 const std::string MediaResourceLoaderBridgeFactory::GenerateHeaders ( | 55 const std::string MediaResourceLoaderBridgeFactory::GenerateHeaders ( |
| 54 int64 first_byte_position, int64 last_byte_position) { | 56 int64 first_byte_position, int64 last_byte_position) { |
| 55 // Construct the range header. | 57 // Construct the range header. |
| 56 std::string header; | 58 std::string header; |
| 57 if (first_byte_position > kPositionNotSpecified && | 59 if (first_byte_position > kPositionNotSpecified && |
| 58 last_byte_position > kPositionNotSpecified) { | 60 last_byte_position > kPositionNotSpecified) { |
| 59 if (first_byte_position <= last_byte_position) { | 61 if (first_byte_position <= last_byte_position) { |
| 60 header = StringPrintf("Range: bytes=%lld-%lld", | 62 header = StringPrintf("Range: bytes=%"PRId64"-%"PRId64, |
|
Mark Mentovai
2009/11/18 20:55:27
spaces.
| |
| 61 first_byte_position, | 63 first_byte_position, |
| 62 last_byte_position); | 64 last_byte_position); |
| 63 } | 65 } |
| 64 } else if (first_byte_position > kPositionNotSpecified) { | 66 } else if (first_byte_position > kPositionNotSpecified) { |
| 65 header = StringPrintf("Range: bytes=%lld-", first_byte_position); | 67 header = StringPrintf("Range: bytes=%"PRId64"-", first_byte_position); |
|
Mark Mentovai
2009/11/18 20:55:27
spaces.
| |
| 66 } else if (last_byte_position > kPositionNotSpecified) { | 68 } else if (last_byte_position > kPositionNotSpecified) { |
| 67 NOTIMPLEMENTED() << "Suffix range not implemented"; | 69 NOTIMPLEMENTED() << "Suffix range not implemented"; |
| 68 } | 70 } |
| 69 return header; | 71 return header; |
| 70 } | 72 } |
| 71 | 73 |
| 72 } // namespace webkit_glue | 74 } // namespace webkit_glue |
| OLD | NEW |