OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return 0; | 51 return 0; |
52 return private_->size(); | 52 return private_->size(); |
53 } | 53 } |
54 | 54 |
55 const char* WebData::Data() const { | 55 const char* WebData::Data() const { |
56 if (private_.IsNull()) | 56 if (private_.IsNull()) |
57 return 0; | 57 return 0; |
58 return private_->Data(); | 58 return private_->Data(); |
59 } | 59 } |
60 | 60 |
61 WebData::WebData(PassRefPtr<SharedBuffer> buffer) : private_(buffer) {} | 61 WebData::WebData(PassRefPtr<SharedBuffer> buffer) |
| 62 : private_(std::move(buffer)) {} |
62 | 63 |
63 WebData& WebData::operator=(PassRefPtr<SharedBuffer> buffer) { | 64 WebData& WebData::operator=(PassRefPtr<SharedBuffer> buffer) { |
64 private_ = buffer; | 65 private_ = std::move(buffer); |
65 return *this; | 66 return *this; |
66 } | 67 } |
67 | 68 |
68 WebData::operator PassRefPtr<SharedBuffer>() const { | 69 WebData::operator PassRefPtr<SharedBuffer>() const { |
69 return PassRefPtr<SharedBuffer>(private_.Get()); | 70 return PassRefPtr<SharedBuffer>(private_.Get()); |
70 } | 71 } |
71 | 72 |
72 } // namespace blink | 73 } // namespace blink |
OLD | NEW |