OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef WebContentSettingCallbacks_h | 5 #ifndef WebContentSettingCallbacks_h |
6 #define WebContentSettingCallbacks_h | 6 #define WebContentSettingCallbacks_h |
7 | 7 |
8 #include "WebPrivatePtr.h" | 8 #include "WebPrivatePtr.h" |
9 | 9 |
10 #if INSIDE_BLINK | 10 #if INSIDE_BLINK |
11 #include <memory> | 11 #include "wtf/OwnPtr.h" |
| 12 #include "wtf/PassOwnPtr.h" |
12 #endif | 13 #endif |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
16 class ContentSettingCallbacks; | 17 class ContentSettingCallbacks; |
17 class WebContentSettingCallbacksPrivate; | 18 class WebContentSettingCallbacksPrivate; |
18 | 19 |
19 class WebContentSettingCallbacks { | 20 class WebContentSettingCallbacks { |
20 public: | 21 public: |
21 ~WebContentSettingCallbacks() { reset(); } | 22 ~WebContentSettingCallbacks() { reset(); } |
22 WebContentSettingCallbacks() { } | 23 WebContentSettingCallbacks() { } |
23 WebContentSettingCallbacks(const WebContentSettingCallbacks& c) { assign(c);
} | 24 WebContentSettingCallbacks(const WebContentSettingCallbacks& c) { assign(c);
} |
24 WebContentSettingCallbacks& operator=(const WebContentSettingCallbacks& c) | 25 WebContentSettingCallbacks& operator=(const WebContentSettingCallbacks& c) |
25 { | 26 { |
26 assign(c); | 27 assign(c); |
27 return *this; | 28 return *this; |
28 } | 29 } |
29 | 30 |
30 BLINK_PLATFORM_EXPORT void reset(); | 31 BLINK_PLATFORM_EXPORT void reset(); |
31 BLINK_PLATFORM_EXPORT void assign(const WebContentSettingCallbacks&); | 32 BLINK_PLATFORM_EXPORT void assign(const WebContentSettingCallbacks&); |
32 | 33 |
33 #if INSIDE_BLINK | 34 #if INSIDE_BLINK |
34 BLINK_PLATFORM_EXPORT WebContentSettingCallbacks(std::unique_ptr<ContentSett
ingCallbacks>&&); | 35 BLINK_PLATFORM_EXPORT WebContentSettingCallbacks(WTF::PassOwnPtr<ContentSett
ingCallbacks>&&); |
35 #endif | 36 #endif |
36 | 37 |
37 BLINK_PLATFORM_EXPORT void doAllow(); | 38 BLINK_PLATFORM_EXPORT void doAllow(); |
38 BLINK_PLATFORM_EXPORT void doDeny(); | 39 BLINK_PLATFORM_EXPORT void doDeny(); |
39 | 40 |
40 private: | 41 private: |
41 WebPrivatePtr<WebContentSettingCallbacksPrivate> m_private; | 42 WebPrivatePtr<WebContentSettingCallbacksPrivate> m_private; |
42 }; | 43 }; |
43 | 44 |
44 } // namespace blink | 45 } // namespace blink |
45 | 46 |
46 #endif | 47 #endif |
OLD | NEW |