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

Side by Side Diff: net/http/http_network_layer.cc

Issue 11538008: Fire SystemMonitor::{RESUME,SUSPEND}_EVENT on 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
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 "net/http/http_network_layer.h" 5 #include "net/http/http_network_layer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/system_monitor/system_monitor.h"
11 #include "net/http/http_network_session.h" 12 #include "net/http/http_network_session.h"
12 #include "net/http/http_network_transaction.h" 13 #include "net/http/http_network_transaction.h"
13 #include "net/http/http_server_properties_impl.h" 14 #include "net/http/http_server_properties_impl.h"
14 #include "net/spdy/spdy_framer.h" 15 #include "net/spdy/spdy_framer.h"
15 #include "net/spdy/spdy_session.h" 16 #include "net/spdy/spdy_session.h"
16 #include "net/spdy/spdy_session_pool.h" 17 #include "net/spdy/spdy_session_pool.h"
17 18
18 namespace net { 19 namespace net {
19 20
20 //----------------------------------------------------------------------------- 21 //-----------------------------------------------------------------------------
21 HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session) 22 HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session)
22 : session_(session), 23 : session_(session),
23 suspended_(false) { 24 suspended_(false) {
24 DCHECK(session_.get()); 25 DCHECK(session_.get());
26 base::SystemMonitor::Get()->AddPowerObserver(this);
25 } 27 }
26 28
27 HttpNetworkLayer::~HttpNetworkLayer() { 29 HttpNetworkLayer::~HttpNetworkLayer() {
30 base::SystemMonitor::Get()->RemovePowerObserver(this);
28 } 31 }
29 32
30 //----------------------------------------------------------------------------- 33 //-----------------------------------------------------------------------------
31 34
32 // static 35 // static
33 HttpTransactionFactory* HttpNetworkLayer::CreateFactory( 36 HttpTransactionFactory* HttpNetworkLayer::CreateFactory(
34 HttpNetworkSession* session) { 37 HttpNetworkSession* session) {
35 DCHECK(session); 38 DCHECK(session);
36 39
37 return new HttpNetworkLayer(session); 40 return new HttpNetworkLayer(session);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 72
70 if (session_) 73 if (session_)
71 session_->CloseIdleConnections(); 74 session_->CloseIdleConnections();
72 } 75 }
73 76
74 void HttpNetworkLayer::OnResume() { 77 void HttpNetworkLayer::OnResume() {
75 suspended_ = false; 78 suspended_ = false;
76 } 79 }
77 80
78 } // namespace net 81 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698