OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 const char* WebThreadSafeData::Data() const { | 56 const char* WebThreadSafeData::Data() const { |
57 if (private_.IsNull()) | 57 if (private_.IsNull()) |
58 return 0; | 58 return 0; |
59 return private_->data(); | 59 return private_->data(); |
60 } | 60 } |
61 | 61 |
62 WebThreadSafeData::WebThreadSafeData(PassRefPtr<RawData> data) | 62 WebThreadSafeData::WebThreadSafeData(PassRefPtr<RawData> data) |
63 : private_(std::move(data)) {} | 63 : private_(std::move(data)) {} |
64 | 64 |
| 65 WebThreadSafeData::WebThreadSafeData(RefPtr<RawData>&& data) |
| 66 : private_(std::move(data)) {} |
| 67 |
65 WebThreadSafeData::WebThreadSafeData(const WebThreadSafeData& other) { | 68 WebThreadSafeData::WebThreadSafeData(const WebThreadSafeData& other) { |
66 private_ = other.private_; | 69 private_ = other.private_; |
67 } | 70 } |
68 | 71 |
69 WebThreadSafeData& WebThreadSafeData::operator=( | 72 WebThreadSafeData& WebThreadSafeData::operator=( |
70 const WebThreadSafeData& other) { | 73 const WebThreadSafeData& other) { |
71 private_ = other.private_; | 74 private_ = other.private_; |
72 return *this; | 75 return *this; |
73 } | 76 } |
74 | 77 |
75 WebThreadSafeData& WebThreadSafeData::operator=(PassRefPtr<RawData> data) { | 78 WebThreadSafeData& WebThreadSafeData::operator=(PassRefPtr<RawData> data) { |
76 private_ = std::move(data); | 79 private_ = std::move(data); |
77 return *this; | 80 return *this; |
78 } | 81 } |
79 | 82 |
80 } // namespace blink | 83 } // namespace blink |
OLD | NEW |