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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 { | 120 { |
121 ASSERT(m_state == CONNECTING); | 121 ASSERT(m_state == CONNECTING); |
122 ASSERT(!m_requestInFlight); | 122 ASSERT(!m_requestInFlight); |
123 ASSERT(executionContext()); | 123 ASSERT(executionContext()); |
124 | 124 |
125 ExecutionContext& executionContext = *this->executionContext(); | 125 ExecutionContext& executionContext = *this->executionContext(); |
126 ResourceRequest request(m_url); | 126 ResourceRequest request(m_url); |
127 request.setHTTPMethod("GET"); | 127 request.setHTTPMethod("GET"); |
128 request.setHTTPHeaderField("Accept", "text/event-stream"); | 128 request.setHTTPHeaderField("Accept", "text/event-stream"); |
129 request.setHTTPHeaderField("Cache-Control", "no-cache"); | 129 request.setHTTPHeaderField("Cache-Control", "no-cache"); |
130 request.setRequestContext(blink::WebURLRequest::RequestContextEventSource); | 130 request.setRequestContext(WebURLRequest::RequestContextEventSource); |
131 if (!m_lastEventId.isEmpty()) | 131 if (!m_lastEventId.isEmpty()) |
132 request.setHTTPHeaderField("Last-Event-ID", m_lastEventId); | 132 request.setHTTPHeaderField("Last-Event-ID", m_lastEventId); |
133 | 133 |
134 SecurityOrigin* origin = executionContext.securityOrigin(); | 134 SecurityOrigin* origin = executionContext.securityOrigin(); |
135 | 135 |
136 ThreadableLoaderOptions options; | 136 ThreadableLoaderOptions options; |
137 options.preflightPolicy = PreventPreflight; | 137 options.preflightPolicy = PreventPreflight; |
138 options.crossOriginRequestPolicy = UseAccessControl; | 138 options.crossOriginRequestPolicy = UseAccessControl; |
139 options.contentSecurityPolicyEnforcement = ContentSecurityPolicy::shouldBypa
ssMainWorld(&executionContext) ? DoNotEnforceContentSecurityPolicy : EnforceConn
ectSrcDirective; | 139 options.contentSecurityPolicyEnforcement = ContentSecurityPolicy::shouldBypa
ssMainWorld(&executionContext) ? DoNotEnforceContentSecurityPolicy : EnforceConn
ectSrcDirective; |
140 | 140 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 return event.release(); | 439 return event.release(); |
440 } | 440 } |
441 | 441 |
442 DEFINE_TRACE(EventSource) | 442 DEFINE_TRACE(EventSource) |
443 { | 443 { |
444 EventTargetWithInlineData::trace(visitor); | 444 EventTargetWithInlineData::trace(visitor); |
445 ActiveDOMObject::trace(visitor); | 445 ActiveDOMObject::trace(visitor); |
446 } | 446 } |
447 | 447 |
448 } // namespace blink | 448 } // namespace blink |
OLD | NEW |