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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template

Issue 1752213003: DevTools: migrate protocol dispatcher off RefPtr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template b/third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template
index 0694e5fd48a2d75ec31b97819543a9d9a9efe736..3a9f3f07ef8e050a69d974bd8fd7baaba65faa88 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template
@@ -13,33 +13,28 @@ namespace blink {
namespace protocol {
class FrontendChannel;
-class DispatcherImpl;
+class DispatcherImplWeakPtr;
using ErrorString = String;
-class PLATFORM_EXPORT Dispatcher: public RefCounted<Dispatcher> {
+class PLATFORM_EXPORT Dispatcher {
public:
- static PassRefPtr<Dispatcher> create(FrontendChannel* frontendChannel);
+ static PassOwnPtr<Dispatcher> create(FrontendChannel* frontendChannel);
virtual ~Dispatcher() { }
- class PLATFORM_EXPORT CallbackBase: public RefCounted<CallbackBase> {
+ class PLATFORM_EXPORT CallbackBase {
public:
- CallbackBase(PassRefPtr<DispatcherImpl> backendImpl, int sessionId, int id);
+ CallbackBase(PassOwnPtr<DispatcherImplWeakPtr> backendImpl, int sessionId, int id);
virtual ~CallbackBase();
void sendFailure(const ErrorString&);
- bool isActive();
+ void dispose();
protected:
void sendIfActive(PassOwnPtr<protocol::DictionaryValue> partialMessage, const ErrorString& invocationError);
private:
- void disable() { m_alreadySent = true; }
-
- RefPtr<DispatcherImpl> m_backendImpl;
+ OwnPtr<DispatcherImplWeakPtr> m_backendImpl;
int m_sessionId;
int m_id;
- bool m_alreadySent;
-
- friend class DispatcherImpl;
};
{% for domain in api.domains %}
@@ -51,7 +46,7 @@ public:
{% if "async" in command %}
class PLATFORM_EXPORT {{command.name | to_title_case}}Callback : public CallbackBase {
public:
- {{command.name | to_title_case}}Callback(PassRefPtr<DispatcherImpl>, int sessionId, int id);
+ {{command.name | to_title_case}}Callback(PassOwnPtr<DispatcherImplWeakPtr>, int sessionId, int id);
void sendSuccess(
{%- for parameter in command.returns -%}
{%- if "optional" in parameter -%}
@@ -73,7 +68,7 @@ public:
{%- endif -%}
{%- endfor -%}
{%- if "async" in command -%}
- , PassRefPtr<{{command.name | to_title_case}}Callback> callback
+ , PassOwnPtr<{{command.name | to_title_case}}Callback> callback
{%- else -%}
{%- for parameter in command.returns -%}
{%- if "optional" in parameter -%}

Powered by Google App Engine
This is Rietveld 408576698