OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 24 matching lines...) Expand all Loading... |
35 #include "WebNonCopyable.h" | 35 #include "WebNonCopyable.h" |
36 #include "WebPrivatePtr.h" | 36 #include "WebPrivatePtr.h" |
37 #include "WebString.h" | 37 #include "WebString.h" |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 class RTCVoidRequest; | 41 class RTCVoidRequest; |
42 | 42 |
43 class WebRTCVoidRequest { | 43 class WebRTCVoidRequest { |
44 public: | 44 public: |
45 class ExtraData { | |
46 public: | |
47 virtual ~ExtraData() { } | |
48 }; | |
49 | |
50 WebRTCVoidRequest() { } | 45 WebRTCVoidRequest() { } |
51 WebRTCVoidRequest(const WebRTCVoidRequest& other) { assign(other); } | 46 WebRTCVoidRequest(const WebRTCVoidRequest& other) { assign(other); } |
52 ~WebRTCVoidRequest() { reset(); } | 47 ~WebRTCVoidRequest() { reset(); } |
53 | 48 |
54 WebRTCVoidRequest& operator=(const WebRTCVoidRequest& other) | 49 WebRTCVoidRequest& operator=(const WebRTCVoidRequest& other) |
55 { | 50 { |
56 assign(other); | 51 assign(other); |
57 return *this; | 52 return *this; |
58 } | 53 } |
59 | 54 |
60 BLINK_PLATFORM_EXPORT void assign(const WebRTCVoidRequest&); | 55 BLINK_PLATFORM_EXPORT void assign(const WebRTCVoidRequest&); |
61 | 56 |
62 BLINK_PLATFORM_EXPORT void reset(); | 57 BLINK_PLATFORM_EXPORT void reset(); |
63 bool isNull() const { return m_private.isNull(); } | 58 bool isNull() const { return m_private.isNull(); } |
64 | 59 |
65 BLINK_PLATFORM_EXPORT void requestSucceeded() const; | 60 BLINK_PLATFORM_EXPORT void requestSucceeded() const; |
66 BLINK_PLATFORM_EXPORT void requestFailed(const WebString& error) const; | 61 BLINK_PLATFORM_EXPORT void requestFailed(const WebString& error) const; |
67 | 62 |
68 // Extra data associated with this object. | |
69 // If non-null, the extra data pointer will be deleted when the object is de
stroyed. | |
70 // Setting the extra data pointer will cause any existing non-null | |
71 // extra data pointer to be deleted. | |
72 BLINK_PLATFORM_EXPORT ExtraData* extraData() const; | |
73 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); | |
74 | |
75 #if INSIDE_BLINK | 63 #if INSIDE_BLINK |
76 BLINK_PLATFORM_EXPORT WebRTCVoidRequest(RTCVoidRequest*); | 64 BLINK_PLATFORM_EXPORT WebRTCVoidRequest(RTCVoidRequest*); |
77 #endif | 65 #endif |
78 | 66 |
79 private: | 67 private: |
80 WebPrivatePtr<RTCVoidRequest> m_private; | 68 WebPrivatePtr<RTCVoidRequest> m_private; |
81 }; | 69 }; |
82 | 70 |
83 } // namespace blink | 71 } // namespace blink |
84 | 72 |
85 #endif // WebRTCVoidRequest_h | 73 #endif // WebRTCVoidRequest_h |
OLD | NEW |