Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template

Issue 2004313003: DevTools: migrate from OwnPtr to std::unique_ptr for inspector protocol classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // This file is generated 1 // This file is generated
2 2
3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 3 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style license that can be 4 // Use of this source code is governed by a BSD-style license that can be
5 // found in the LICENSE file. 5 // found in the LICENSE file.
6 6
7 #ifndef {{class_name}}_h 7 #ifndef {{class_name}}_h
8 #define {{class_name}}_h 8 #define {{class_name}}_h
9 9
10 #include "platform/inspector_protocol/Backend.h" 10 #include "platform/inspector_protocol/Backend.h"
11 #include "platform/inspector_protocol/TypeBuilder.h" 11 #include "platform/inspector_protocol/TypeBuilder.h"
12 12
13 namespace blink { 13 namespace blink {
14 namespace protocol { 14 namespace protocol {
15 15
16 class FrontendChannel; 16 class FrontendChannel;
17 class DispatcherImplWeakPtr; 17 class DispatcherImplWeakPtr;
18 18
19 class PLATFORM_EXPORT Dispatcher { 19 class PLATFORM_EXPORT Dispatcher {
20 public: 20 public:
21 static PassOwnPtr<Dispatcher> create(FrontendChannel* frontendChannel); 21 static std::unique_ptr<Dispatcher> create(FrontendChannel* frontendChannel);
22 virtual ~Dispatcher() { } 22 virtual ~Dispatcher() { }
23 23
24 class PLATFORM_EXPORT CallbackBase { 24 class PLATFORM_EXPORT CallbackBase {
25 public: 25 public:
26 CallbackBase(PassOwnPtr<DispatcherImplWeakPtr> backendImpl, int callId); 26 CallbackBase(std::unique_ptr<DispatcherImplWeakPtr> backendImpl, int cal lId);
27 virtual ~CallbackBase(); 27 virtual ~CallbackBase();
28 void sendFailure(const ErrorString&); 28 void sendFailure(const ErrorString&);
29 void dispose(); 29 void dispose();
30 30
31 protected: 31 protected:
32 void sendIfActive(PassOwnPtr<protocol::DictionaryValue> partialMessage, const ErrorString& invocationError); 32 void sendIfActive(std::unique_ptr<protocol::DictionaryValue> partialMess age, const ErrorString& invocationError);
33 33
34 private: 34 private:
35 OwnPtr<DispatcherImplWeakPtr> m_backendImpl; 35 std::unique_ptr<DispatcherImplWeakPtr> m_backendImpl;
36 int m_callId; 36 int m_callId;
37 }; 37 };
38 38
39 {% for domain in api.domains %} 39 {% for domain in api.domains %}
40 virtual void registerAgent(blink::protocol::Backend::{{domain.domain}}*) = 0 ; 40 virtual void registerAgent(blink::protocol::Backend::{{domain.domain}}*) = 0 ;
41 {% endfor %} 41 {% endfor %}
42 42
43 virtual void clearFrontend() = 0; 43 virtual void clearFrontend() = 0;
44 44
45 enum CommonErrorCode { 45 enum CommonErrorCode {
46 ParseError = 0, 46 ParseError = 0,
47 InvalidRequest, 47 InvalidRequest,
48 MethodNotFound, 48 MethodNotFound,
49 InvalidParams, 49 InvalidParams,
50 InternalError, 50 InternalError,
51 ServerError, 51 ServerError,
52 LastEntry, 52 LastEntry,
53 }; 53 };
54 54
55 void reportProtocolError(int callId, CommonErrorCode, const String16& errorM essage) const; 55 void reportProtocolError(int callId, CommonErrorCode, const String16& errorM essage) const;
56 virtual void reportProtocolError(int callId, CommonErrorCode, const String16 & errorMessage, ErrorSupport*) const = 0; 56 virtual void reportProtocolError(int callId, CommonErrorCode, const String16 & errorMessage, ErrorSupport*) const = 0;
57 virtual void dispatch(const String16& message) = 0; 57 virtual void dispatch(const String16& message) = 0;
58 static bool getCommandName(const String16& message, String16* result); 58 static bool getCommandName(const String16& message, String16* result);
59 }; 59 };
60 60
61 } // namespace protocol 61 } // namespace protocol
62 } // namespace blink 62 } // namespace blink
63 63
64 #endif // !defined({{class_name}}_h) 64 #endif // !defined({{class_name}}_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698