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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationConnection.h

Issue 2547143002: [Presentation API] fire onconnectionavailable and onconnect event asynchronously (Closed)
Patch Set: resolve code review comments from Mark Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PresentationConnection_h 5 #ifndef PresentationConnection_h
6 #define PresentationConnection_h 6 #define PresentationConnection_h
7 7
8 #include "core/events/EventTarget.h" 8 #include "core/events/EventTarget.h"
9 #include "core/fileapi/Blob.h" 9 #include "core/fileapi/Blob.h"
10 #include "core/fileapi/FileError.h" 10 #include "core/fileapi/FileError.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 PresentationConnection(LocalFrame*, const String& id, const KURL&); 108 PresentationConnection(LocalFrame*, const String& id, const KURL&);
109 109
110 bool canSendMessage(ExceptionState&); 110 bool canSendMessage(ExceptionState&);
111 void handleMessageQueue(); 111 void handleMessageQueue();
112 112
113 // Callbacks invoked from BlobLoader. 113 // Callbacks invoked from BlobLoader.
114 void didFinishLoadingBlob(DOMArrayBuffer*); 114 void didFinishLoadingBlob(DOMArrayBuffer*);
115 void didFailLoadingBlob(FileError::ErrorCode); 115 void didFailLoadingBlob(FileError::ErrorCode);
116 116
117 // Internal helper function to dispatch state change events asynchronously.
118 void dispatchStateChangeEvent(Event*);
119 static void dispatchEventAsync(EventTarget*, Event*);
120
117 // Cancel loads and pending messages when the connection is closed. 121 // Cancel loads and pending messages when the connection is closed.
118 void tearDown(); 122 void tearDown();
119 123
120 String m_id; 124 String m_id;
121 KURL m_url; 125 KURL m_url;
122 WebPresentationConnectionState m_state; 126 WebPresentationConnectionState m_state;
123 127
124 // For Blob data handling. 128 // For Blob data handling.
125 Member<BlobLoader> m_blobLoader; 129 Member<BlobLoader> m_blobLoader;
126 HeapDeque<Member<Message>> m_messages; 130 HeapDeque<Member<Message>> m_messages;
127 131
128 BinaryType m_binaryType; 132 BinaryType m_binaryType;
129 }; 133 };
130 134
131 } // namespace blink 135 } // namespace blink
132 136
133 #endif // PresentationConnection_h 137 #endif // PresentationConnection_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698