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

Side by Side Diff: Source/modules/websockets/NewWebSocketChannelImpl.cpp

Issue 566533003: Mixed Content: Make MixedContentChecker completely static. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixing tests. 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 ASSERT(!m_blobLoader); 129 ASSERT(!m_blobLoader);
130 } 130 }
131 131
132 bool NewWebSocketChannelImpl::connect(const KURL& url, const String& protocol) 132 bool NewWebSocketChannelImpl::connect(const KURL& url, const String& protocol)
133 { 133 {
134 WTF_LOG(Network, "NewWebSocketChannelImpl %p connect()", this); 134 WTF_LOG(Network, "NewWebSocketChannelImpl %p connect()", this);
135 if (!m_handle) 135 if (!m_handle)
136 return false; 136 return false;
137 137
138 if (executionContext()->isDocument() && document()->frame()) { 138 if (executionContext()->isDocument() && document()->frame()) {
139 if (!document()->frame()->loader().mixedContentChecker()->canConnectInse cureWebSocket(document()->securityOrigin(), url)) 139 if (MixedContentChecker::shouldBlockWebSocket(document()->frame(), url))
140 return false; 140 return false;
141 } 141 }
142 if (MixedContentChecker::isMixedContent(document()->securityOrigin(), url)) { 142 if (MixedContentChecker::isMixedContent(document()->securityOrigin(), url)) {
143 String message = "Connecting to a non-secure WebSocket server from a sec ure origin is deprecated."; 143 String message = "Connecting to a non-secure WebSocket server from a sec ure origin is deprecated.";
144 document()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, Wa rningMessageLevel, message)); 144 document()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, Wa rningMessageLevel, message));
145 } 145 }
146 146
147 m_url = url; 147 m_url = url;
148 Vector<String> protocols; 148 Vector<String> protocols;
149 // Avoid placing an empty token in the Vector when the protocol string is 149 // Avoid placing an empty token in the Vector when the protocol string is
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 } 558 }
559 559
560 void NewWebSocketChannelImpl::trace(Visitor* visitor) 560 void NewWebSocketChannelImpl::trace(Visitor* visitor)
561 { 561 {
562 visitor->trace(m_blobLoader); 562 visitor->trace(m_blobLoader);
563 visitor->trace(m_client); 563 visitor->trace(m_client);
564 WebSocketChannel::trace(visitor); 564 WebSocketChannel::trace(visitor);
565 } 565 }
566 566
567 } // namespace blink 567 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/websockets/MainThreadWebSocketChannel.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698