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

Side by Side Diff: Source/core/page/EventSource.cpp

Issue 540283003: bindings: Retires ScriptWrappable::init, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 6 years, 3 months 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 | Annotate | Revision Log
OLDNEW
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 : ActiveDOMObject(context) 63 : ActiveDOMObject(context)
64 , m_url(url) 64 , m_url(url)
65 , m_withCredentials(false) 65 , m_withCredentials(false)
66 , m_state(CONNECTING) 66 , m_state(CONNECTING)
67 , m_decoder(TextResourceDecoder::create("text/plain", "UTF-8")) 67 , m_decoder(TextResourceDecoder::create("text/plain", "UTF-8"))
68 , m_connectTimer(this, &EventSource::connectTimerFired) 68 , m_connectTimer(this, &EventSource::connectTimerFired)
69 , m_discardTrailingNewline(false) 69 , m_discardTrailingNewline(false)
70 , m_requestInFlight(false) 70 , m_requestInFlight(false)
71 , m_reconnectDelay(defaultReconnectDelay) 71 , m_reconnectDelay(defaultReconnectDelay)
72 { 72 {
73 ScriptWrappable::init(this);
74 DictionaryHelper::get(eventSourceInit, "withCredentials", m_withCredentials) ; 73 DictionaryHelper::get(eventSourceInit, "withCredentials", m_withCredentials) ;
75 } 74 }
76 75
77 PassRefPtrWillBeRawPtr<EventSource> EventSource::create(ExecutionContext* contex t, const String& url, const Dictionary& eventSourceInit, ExceptionState& excepti onState) 76 PassRefPtrWillBeRawPtr<EventSource> EventSource::create(ExecutionContext* contex t, const String& url, const Dictionary& eventSourceInit, ExceptionState& excepti onState)
78 { 77 {
79 if (url.isEmpty()) { 78 if (url.isEmpty()) {
80 exceptionState.throwDOMException(SyntaxError, "Cannot open an EventSourc e to an empty URL."); 79 exceptionState.throwDOMException(SyntaxError, "Cannot open an EventSourc e to an empty URL.");
81 return nullptr; 80 return nullptr;
82 } 81 }
83 82
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 432
434 PassRefPtrWillBeRawPtr<MessageEvent> EventSource::createMessageEvent() 433 PassRefPtrWillBeRawPtr<MessageEvent> EventSource::createMessageEvent()
435 { 434 {
436 RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(); 435 RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create();
437 event->initMessageEvent(m_eventName.isEmpty() ? EventTypeNames::message : m_ eventName, false, false, SerializedScriptValue::create(String(m_data)), m_eventS treamOrigin, m_lastEventId, 0, nullptr); 436 event->initMessageEvent(m_eventName.isEmpty() ? EventTypeNames::message : m_ eventName, false, false, SerializedScriptValue::create(String(m_data)), m_eventS treamOrigin, m_lastEventId, 0, nullptr);
438 m_data.clear(); 437 m_data.clear();
439 return event.release(); 438 return event.release();
440 } 439 }
441 440
442 } // namespace blink 441 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/loader/appcache/ApplicationCache.cpp ('k') | Source/core/page/PagePopupController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698