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

Side by Side Diff: chrome/browser/android/process_utils.cc

Issue 11411315: Add missing 'session->CloseIdleConnections()' in process_utils.cc (for Android). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/android/process_utils.h" 5 #include "chrome/browser/android/process_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 19 matching lines...) Expand all
30 base::Bind(&CloseIdleConnectionsForProfile, 30 base::Bind(&CloseIdleConnectionsForProfile,
31 context_getter)); 31 context_getter));
32 return; 32 return;
33 } 33 }
34 34
35 net::URLRequestContext* context = context_getter->GetURLRequestContext(); 35 net::URLRequestContext* context = context_getter->GetURLRequestContext();
36 DCHECK(context->http_transaction_factory()); 36 DCHECK(context->http_transaction_factory());
37 net::HttpNetworkSession* session = 37 net::HttpNetworkSession* session =
38 context->http_transaction_factory()->GetSession(); 38 context->http_transaction_factory()->GetSession();
39 DCHECK(session); 39 DCHECK(session);
40 session->CloseIdleConnections();
40 } 41 }
41 42
42 // Only accessed from the JNI thread by ToggleWebKitSharedTimers() which is 43 // Only accessed from the JNI thread by ToggleWebKitSharedTimers() which is
43 // implemented below. 44 // implemented below.
44 base::LazyInstance<std::vector<int /* process id */> > g_suspended_processes = 45 base::LazyInstance<std::vector<int /* process id */> > g_suspended_processes =
45 LAZY_INSTANCE_INITIALIZER; 46 LAZY_INSTANCE_INITIALIZER;
46 47
47 // Suspends timers in all current render processes. 48 // Suspends timers in all current render processes.
48 void SuspendWebKitSharedTimers(std::vector<int>* suspended_processes) { 49 void SuspendWebKitSharedTimers(std::vector<int>* suspended_processes) {
49 for (content::RenderProcessHost::iterator i( 50 for (content::RenderProcessHost::iterator i(
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 if (profile->HasOffTheRecordProfile()) { 93 if (profile->HasOffTheRecordProfile()) {
93 CloseIdleConnectionsForProfile( 94 CloseIdleConnectionsForProfile(
94 profile->GetOffTheRecordProfile()->GetRequestContext()); 95 profile->GetOffTheRecordProfile()->GetRequestContext());
95 } 96 }
96 } 97 }
97 } 98 }
98 99
99 bool RegisterProcessUtils(JNIEnv* env) { 100 bool RegisterProcessUtils(JNIEnv* env) {
100 return RegisterNativesImpl(env); 101 return RegisterNativesImpl(env);
101 } 102 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698