| 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 16 matching lines...) Expand all Loading... |
| 27 #ifndef MessagePort_h | 27 #ifndef MessagePort_h |
| 28 #define MessagePort_h | 28 #define MessagePort_h |
| 29 | 29 |
| 30 #include <memory> | 30 #include <memory> |
| 31 #include "bindings/core/v8/ActiveScriptWrappable.h" | 31 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 32 #include "bindings/core/v8/SerializedScriptValue.h" | 32 #include "bindings/core/v8/SerializedScriptValue.h" |
| 33 #include "core/CoreExport.h" | 33 #include "core/CoreExport.h" |
| 34 #include "core/dom/ContextLifecycleObserver.h" | 34 #include "core/dom/ContextLifecycleObserver.h" |
| 35 #include "core/events/EventListener.h" | 35 #include "core/events/EventListener.h" |
| 36 #include "core/events/EventTarget.h" | 36 #include "core/events/EventTarget.h" |
| 37 #include "platform/WebTaskRunner.h" | |
| 38 #include "platform/wtf/PassRefPtr.h" | 37 #include "platform/wtf/PassRefPtr.h" |
| 39 #include "platform/wtf/RefPtr.h" | 38 #include "platform/wtf/RefPtr.h" |
| 40 #include "platform/wtf/Vector.h" | 39 #include "platform/wtf/Vector.h" |
| 41 #include "public/platform/WebMessagePortChannel.h" | 40 #include "public/platform/WebMessagePortChannel.h" |
| 42 #include "public/platform/WebMessagePortChannelClient.h" | 41 #include "public/platform/WebMessagePortChannelClient.h" |
| 43 | 42 |
| 44 namespace blink { | 43 namespace blink { |
| 45 | 44 |
| 46 class ExceptionState; | 45 class ExceptionState; |
| 47 class ExecutionContext; | 46 class ExecutionContext; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 bool TryGetMessage(RefPtr<SerializedScriptValue>& message, | 133 bool TryGetMessage(RefPtr<SerializedScriptValue>& message, |
| 135 MessagePortChannelArray& channels); | 134 MessagePortChannelArray& channels); |
| 136 | 135 |
| 137 private: | 136 private: |
| 138 // WebMessagePortChannelClient implementation. | 137 // WebMessagePortChannelClient implementation. |
| 139 void MessageAvailable() override; | 138 void MessageAvailable() override; |
| 140 void DispatchMessages(); | 139 void DispatchMessages(); |
| 141 | 140 |
| 142 std::unique_ptr<WebMessagePortChannel> entangled_channel_; | 141 std::unique_ptr<WebMessagePortChannel> entangled_channel_; |
| 143 | 142 |
| 144 int pending_dispatch_task_ = 0; | 143 int pending_dispatch_task_; |
| 145 bool started_ = false; | 144 bool started_; |
| 146 bool closed_ = false; | 145 bool closed_; |
| 147 | |
| 148 RefPtr<WebTaskRunner> task_runner_; | |
| 149 }; | 146 }; |
| 150 | 147 |
| 151 } // namespace blink | 148 } // namespace blink |
| 152 | 149 |
| 153 #endif // MessagePort_h | 150 #endif // MessagePort_h |
| OLD | NEW |