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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/RemoteObjectId.h

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 // 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 RemoteObjectId_h 5 #ifndef RemoteObjectId_h
6 #define RemoteObjectId_h 6 #define RemoteObjectId_h
7 7
8 #include "platform/inspector_protocol/String16.h" 8 #include "platform/inspector_protocol/String16.h"
9 #include "platform/inspector_protocol/TypeBuilder.h" 9 #include "platform/inspector_protocol/TypeBuilder.h"
10 #include "wtf/PassOwnPtr.h" 10 #include "wtf/PtrUtil.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 namespace protocol { 14 namespace protocol {
15 class DictionaryValue; 15 class DictionaryValue;
16 } 16 }
17 17
18 class RemoteObjectIdBase { 18 class RemoteObjectIdBase {
19 public: 19 public:
20 int contextId() const { return m_injectedScriptId; } 20 int contextId() const { return m_injectedScriptId; }
21 21
22 protected: 22 protected:
23 RemoteObjectIdBase(); 23 RemoteObjectIdBase();
24 ~RemoteObjectIdBase() { } 24 ~RemoteObjectIdBase() { }
25 25
26 PassOwnPtr<protocol::DictionaryValue> parseInjectedScriptId(const String16&) ; 26 std::unique_ptr<protocol::DictionaryValue> parseInjectedScriptId(const Strin g16&);
27 27
28 int m_injectedScriptId; 28 int m_injectedScriptId;
29 }; 29 };
30 30
31 class RemoteObjectId final : public RemoteObjectIdBase { 31 class RemoteObjectId final : public RemoteObjectIdBase {
32 public: 32 public:
33 static PassOwnPtr<RemoteObjectId> parse(ErrorString*, const String16&); 33 static std::unique_ptr<RemoteObjectId> parse(ErrorString*, const String16&);
34 ~RemoteObjectId() { } 34 ~RemoteObjectId() { }
35 int id() const { return m_id; } 35 int id() const { return m_id; }
36 36
37 private: 37 private:
38 RemoteObjectId(); 38 RemoteObjectId();
39 39
40 int m_id; 40 int m_id;
41 }; 41 };
42 42
43 class RemoteCallFrameId final : public RemoteObjectIdBase { 43 class RemoteCallFrameId final : public RemoteObjectIdBase {
44 public: 44 public:
45 static PassOwnPtr<RemoteCallFrameId> parse(ErrorString*, const String16&); 45 static std::unique_ptr<RemoteCallFrameId> parse(ErrorString*, const String16 &);
46 ~RemoteCallFrameId() { } 46 ~RemoteCallFrameId() { }
47 47
48 int frameOrdinal() const { return m_frameOrdinal; } 48 int frameOrdinal() const { return m_frameOrdinal; }
49 49
50 static String16 serialize(int injectedScriptId, int frameOrdinal); 50 static String16 serialize(int injectedScriptId, int frameOrdinal);
51 private: 51 private:
52 RemoteCallFrameId(); 52 RemoteCallFrameId();
53 53
54 int m_frameOrdinal; 54 int m_frameOrdinal;
55 }; 55 };
56 56
57 } // namespace blink 57 } // namespace blink
58 58
59 #endif // !defined(RemoteObjectId_h) 59 #endif // !defined(RemoteObjectId_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698