OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2009, 2012 Ericsson AB. All rights reserved. |
3 * Copyright (C) 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2010 Apple Inc. All rights reserved. |
4 * Copyright (C) 2011, Code Aurora Forum. All rights reserved. | 4 * Copyright (C) 2011, Code Aurora Forum. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 source->scheduleInitialConnect(); | 116 source->scheduleInitialConnect(); |
117 return source; | 117 return source; |
118 } | 118 } |
119 | 119 |
120 EventSource::~EventSource() { | 120 EventSource::~EventSource() { |
121 DCHECK_EQ(kClosed, m_state); | 121 DCHECK_EQ(kClosed, m_state); |
122 DCHECK(!m_loader); | 122 DCHECK(!m_loader); |
123 } | 123 } |
124 | 124 |
| 125 void EventSource::dispose() { |
| 126 InspectorInstrumentation::detachClientRequest(getExecutionContext(), this); |
| 127 } |
| 128 |
125 void EventSource::scheduleInitialConnect() { | 129 void EventSource::scheduleInitialConnect() { |
126 DCHECK_EQ(kConnecting, m_state); | 130 DCHECK_EQ(kConnecting, m_state); |
127 DCHECK(!m_loader); | 131 DCHECK(!m_loader); |
128 | 132 |
129 m_connectTimer.startOneShot(0, BLINK_FROM_HERE); | 133 m_connectTimer.startOneShot(0, BLINK_FROM_HERE); |
130 } | 134 } |
131 | 135 |
132 void EventSource::connect() { | 136 void EventSource::connect() { |
133 DCHECK_EQ(kConnecting, m_state); | 137 DCHECK_EQ(kConnecting, m_state); |
134 DCHECK(!m_loader); | 138 DCHECK(!m_loader); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 DCHECK_EQ(kConnecting, m_state); | 367 DCHECK_EQ(kConnecting, m_state); |
364 | 368 |
365 m_loader = nullptr; | 369 m_loader = nullptr; |
366 m_state = kClosed; | 370 m_state = kClosed; |
367 networkRequestEnded(); | 371 networkRequestEnded(); |
368 | 372 |
369 dispatchEvent(Event::create(EventTypeNames::error)); | 373 dispatchEvent(Event::create(EventTypeNames::error)); |
370 } | 374 } |
371 | 375 |
372 void EventSource::contextDestroyed(ExecutionContext*) { | 376 void EventSource::contextDestroyed(ExecutionContext*) { |
| 377 InspectorInstrumentation::detachClientRequest(getExecutionContext(), this); |
373 close(); | 378 close(); |
374 } | 379 } |
375 | 380 |
376 bool EventSource::hasPendingActivity() const { | 381 bool EventSource::hasPendingActivity() const { |
377 return m_state != kClosed; | 382 return m_state != kClosed; |
378 } | 383 } |
379 | 384 |
380 DEFINE_TRACE(EventSource) { | 385 DEFINE_TRACE(EventSource) { |
381 visitor->trace(m_parser); | 386 visitor->trace(m_parser); |
382 visitor->trace(m_loader); | 387 visitor->trace(m_loader); |
383 EventTargetWithInlineData::trace(visitor); | 388 EventTargetWithInlineData::trace(visitor); |
384 ContextLifecycleObserver::trace(visitor); | 389 ContextLifecycleObserver::trace(visitor); |
385 EventSourceParser::Client::trace(visitor); | 390 EventSourceParser::Client::trace(visitor); |
386 } | 391 } |
387 | 392 |
388 } // namespace blink | 393 } // namespace blink |
OLD | NEW |