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

Side by Side Diff: Source/core/dom/MessagePort.h

Issue 18778002: Inherit EventTarget interface instead of duplicating its code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 30 matching lines...) Expand all
41 namespace WebCore { 41 namespace WebCore {
42 42
43 class Event; 43 class Event;
44 class Frame; 44 class Frame;
45 class MessagePort; 45 class MessagePort;
46 class ScriptExecutionContext; 46 class ScriptExecutionContext;
47 47
48 // The overwhelmingly common case is sending a single port, so handle that effic iently with an inline buffer of size 1. 48 // The overwhelmingly common case is sending a single port, so handle that effic iently with an inline buffer of size 1.
49 typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray; 49 typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray;
50 50
51 class MessagePort : public RefCounted<MessagePort>, public ScriptWrappable, publ ic EventTarget { 51 class MessagePort : public EventTarget, public RefCounted<MessagePort>, public S criptWrappable {
52 public: 52 public:
53 static PassRefPtr<MessagePort> create(ScriptExecutionContext& scriptExecutio nContext) { return adoptRef(new MessagePort(scriptExecutionContext)); } 53 static PassRefPtr<MessagePort> create(ScriptExecutionContext& scriptExecutio nContext) { return adoptRef(new MessagePort(scriptExecutionContext)); }
54 virtual ~MessagePort(); 54 virtual ~MessagePort();
55 55
56 void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePor tArray*, ExceptionCode&); 56 void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePor tArray*, ExceptionCode&);
57 57
58 void start(); 58 void start();
59 void close(); 59 void close();
60 60
61 void entangle(PassOwnPtr<MessagePortChannel>); 61 void entangle(PassOwnPtr<MessagePortChannel>);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 bool m_started; 113 bool m_started;
114 bool m_closed; 114 bool m_closed;
115 115
116 ScriptExecutionContext* m_scriptExecutionContext; 116 ScriptExecutionContext* m_scriptExecutionContext;
117 EventTargetData m_eventTargetData; 117 EventTargetData m_eventTargetData;
118 }; 118 };
119 119
120 } // namespace WebCore 120 } // namespace WebCore
121 121
122 #endif // MessagePort_h 122 #endif // MessagePort_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698