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