Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 22 matching lines...) Expand all Loading... | |
| 33 #include "core/dom/ActiveDOMObject.h" | 33 #include "core/dom/ActiveDOMObject.h" |
| 34 #include "core/events/EventListener.h" | 34 #include "core/events/EventListener.h" |
| 35 #include "core/events/EventTarget.h" | 35 #include "core/events/EventTarget.h" |
| 36 #include "public/platform/WebMessagePortChannel.h" | 36 #include "public/platform/WebMessagePortChannel.h" |
| 37 #include "public/platform/WebMessagePortChannelClient.h" | 37 #include "public/platform/WebMessagePortChannelClient.h" |
| 38 #include "wtf/OwnPtr.h" | 38 #include "wtf/OwnPtr.h" |
| 39 #include "wtf/PassOwnPtr.h" | 39 #include "wtf/PassOwnPtr.h" |
| 40 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
| 41 #include "wtf/RefPtr.h" | 41 #include "wtf/RefPtr.h" |
| 42 #include "wtf/Vector.h" | 42 #include "wtf/Vector.h" |
| 43 #include "wtf/WeakPtr.h" | |
| 44 | 43 |
| 45 namespace blink { | 44 namespace blink { |
| 46 | 45 |
| 47 class ExceptionState; | 46 class ExceptionState; |
| 48 class ExecutionContext; | 47 class ExecutionContext; |
| 49 class MessagePort; | 48 class MessagePort; |
| 50 class ScriptState; | 49 class ScriptState; |
| 51 class SerializedScriptValue; | 50 class SerializedScriptValue; |
| 52 | 51 |
| 53 // Not to be confused with WebMessagePortChannelArray; this one uses Vector and OwnPtr instead of WebVector and raw pointers. | 52 // Not to be confused with WebMessagePortChannelArray; this one uses Vector and OwnPtr instead of WebVector and raw pointers. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 explicit MessagePort(ExecutionContext&); | 114 explicit MessagePort(ExecutionContext&); |
| 116 bool tryGetMessage(RefPtr<SerializedScriptValue>& message, OwnPtr<MessagePor tChannelArray>& channels); | 115 bool tryGetMessage(RefPtr<SerializedScriptValue>& message, OwnPtr<MessagePor tChannelArray>& channels); |
| 117 | 116 |
| 118 private: | 117 private: |
| 119 // WebMessagePortChannelClient implementation. | 118 // WebMessagePortChannelClient implementation. |
| 120 void messageAvailable() override; | 119 void messageAvailable() override; |
| 121 v8::Isolate* scriptIsolate() override; | 120 v8::Isolate* scriptIsolate() override; |
| 122 v8::Local<v8::Context> scriptContextForMessageConversion() override; | 121 v8::Local<v8::Context> scriptContextForMessageConversion() override; |
| 123 void dispatchMessages(); | 122 void dispatchMessages(); |
| 124 | 123 |
| 125 OwnPtr<WebMessagePortChannel> m_entangledChannel; | 124 OwnPtr<WebMessagePortChannel> m_entangledChannel; |
|
sof
2016/04/27 13:50:36
Note: I'm considering making MessagePort eagerly f
| |
| 126 | 125 |
| 127 bool m_started; | 126 bool m_started; |
| 128 bool m_closed; | 127 bool m_closed; |
| 129 | 128 |
| 130 WeakPtrFactory<MessagePort> m_weakFactory; | |
| 131 | |
| 132 RefPtr<ScriptState> m_scriptStateForConversion; | 129 RefPtr<ScriptState> m_scriptStateForConversion; |
| 133 }; | 130 }; |
| 134 | 131 |
| 135 } // namespace blink | 132 } // namespace blink |
| 136 | 133 |
| 137 #endif // MessagePort_h | 134 #endif // MessagePort_h |
| OLD | NEW |