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

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

Issue 68093002: Remove duplicated headers from modules/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 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 24 matching lines...) Expand all
35 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
36 #include "core/dom/ExecutionContext.h" 36 #include "core/dom/ExecutionContext.h"
37 #include "core/page/Settings.h" 37 #include "core/page/Settings.h"
38 #include "core/workers/WorkerGlobalScope.h" 38 #include "core/workers/WorkerGlobalScope.h"
39 #include "core/workers/WorkerRunLoop.h" 39 #include "core/workers/WorkerRunLoop.h"
40 #include "core/workers/WorkerThread.h" 40 #include "core/workers/WorkerThread.h"
41 #include "modules/websockets/MainThreadWebSocketChannel.h" 41 #include "modules/websockets/MainThreadWebSocketChannel.h"
42 #include "modules/websockets/ThreadableWebSocketChannelClientWrapper.h" 42 #include "modules/websockets/ThreadableWebSocketChannelClientWrapper.h"
43 #include "modules/websockets/WebSocketChannelClient.h" 43 #include "modules/websockets/WebSocketChannelClient.h"
44 #include "modules/websockets/WorkerThreadableWebSocketChannel.h" 44 #include "modules/websockets/WorkerThreadableWebSocketChannel.h"
45 #include "wtf/PassRefPtr.h"
46 #include "wtf/text/WTFString.h"
47 45
48 namespace WebCore { 46 namespace WebCore {
49 47
50 static const char webSocketChannelMode[] = "webSocketChannelMode"; 48 static const char webSocketChannelMode[] = "webSocketChannelMode";
51 49
52 PassRefPtr<WebSocketChannel> WebSocketChannel::create(ExecutionContext* context, WebSocketChannelClient* client) 50 PassRefPtr<WebSocketChannel> WebSocketChannel::create(ExecutionContext* context, WebSocketChannelClient* client)
53 { 51 {
54 ASSERT(context); 52 ASSERT(context);
55 ASSERT(client); 53 ASSERT(client);
56 54
57 if (context->isWorkerGlobalScope()) { 55 if (context->isWorkerGlobalScope()) {
58 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); 56 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
59 WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop(); 57 WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop();
60 String mode = webSocketChannelMode; 58 String mode = webSocketChannelMode;
61 mode.append(String::number(runLoop.createUniqueId())); 59 mode.append(String::number(runLoop.createUniqueId()));
62 return WorkerThreadableWebSocketChannel::create(workerGlobalScope, clien t, mode); 60 return WorkerThreadableWebSocketChannel::create(workerGlobalScope, clien t, mode);
63 } 61 }
64 62
65 Document* document = toDocument(context); 63 Document* document = toDocument(context);
66 Settings* settings = document->settings(); 64 Settings* settings = document->settings();
67 if (settings && settings->experimentalWebSocketEnabled()) { 65 if (settings && settings->experimentalWebSocketEnabled()) {
68 // FIXME: Create and return an "experimental" WebSocketChannel instead o f a MainThreadWebSocketChannel. 66 // FIXME: Create and return an "experimental" WebSocketChannel instead o f a MainThreadWebSocketChannel.
69 return MainThreadWebSocketChannel::create(document, client); 67 return MainThreadWebSocketChannel::create(document, client);
70 } 68 }
71 return MainThreadWebSocketChannel::create(document, client); 69 return MainThreadWebSocketChannel::create(document, client);
72 } 70 }
73 71
74 } // namespace WebCore 72 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/websockets/WebSocket.cpp ('k') | Source/modules/websockets/WebSocketHandshake.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698