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

Side by Side Diff: webkit/tools/test_shell/simple_socket_stream_bridge.cc

Issue 10299002: Stop refcounting URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialize to NULL Created 8 years, 7 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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "webkit/tools/test_shell/simple_socket_stream_bridge.h" 7 #include "webkit/tools/test_shell/simple_socket_stream_bridge.h"
8 8
9 #include "base/atomicops.h" 9 #include "base/atomicops.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 delegate->DidClose(handle_); 216 delegate->DidClose(handle_);
217 Release(); 217 Release();
218 } 218 }
219 219
220 } // namespace 220 } // namespace
221 221
222 /* static */ 222 /* static */
223 void SimpleSocketStreamBridge::InitializeOnIOThread( 223 void SimpleSocketStreamBridge::InitializeOnIOThread(
224 net::URLRequestContext* request_context) { 224 net::URLRequestContext* request_context) {
225 g_io_thread = MessageLoop::current(); 225 g_io_thread = MessageLoop::current();
226 if ((g_request_context = request_context)) 226 g_request_context = request_context;
227 g_request_context->AddRef();
228 } 227 }
229 228
230 void SimpleSocketStreamBridge::Cleanup() { 229 void SimpleSocketStreamBridge::Cleanup() {
231 g_io_thread = NULL; 230 g_io_thread = NULL;
232 if (g_request_context)
233 g_request_context->Release();
234 g_request_context = NULL; 231 g_request_context = NULL;
235 } 232 }
236 233
237 /* static */ 234 /* static */
238 webkit_glue::WebSocketStreamHandleBridge* SimpleSocketStreamBridge::Create( 235 webkit_glue::WebSocketStreamHandleBridge* SimpleSocketStreamBridge::Create(
239 WebKit::WebSocketStreamHandle* handle, 236 WebKit::WebSocketStreamHandle* handle,
240 webkit_glue::WebSocketStreamHandleDelegate* delegate) { 237 webkit_glue::WebSocketStreamHandleDelegate* delegate) {
241 return new WebSocketStreamHandleBridgeImpl(handle, delegate); 238 return new WebSocketStreamHandleBridgeImpl(handle, delegate);
242 } 239 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/simple_resource_loader_bridge.cc ('k') | webkit/tools/test_shell/test_shell_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698