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

Side by Side Diff: chrome/browser/google_apis/request_registry.cc

Issue 17175017: Get rid of RequestRegistry (part 6): get rid of RequestRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/google_apis/request_registry.h"
6
7 namespace google_apis {
8
9 RequestRegistry::Request::Request(RequestRegistry* registry)
10 : registry_(registry), id_(-1) {
11 }
12
13 RequestRegistry::Request::~Request() {
14 }
15
16 void RequestRegistry::Request::NotifyStart() {
17 registry_->OnRequestStart(this, &id_);
18 }
19
20 void RequestRegistry::Request::NotifyFinish() {
21 registry_->OnRequestFinish(id_);
22 }
23
24 RequestRegistry::RequestRegistry() {
25 in_flight_requests_.set_check_on_null_data(true);
26 }
27
28 RequestRegistry::~RequestRegistry() {
29 }
30
31 void RequestRegistry::OnRequestStart(
32 RequestRegistry::Request* request,
33 RequestID* id) {
34 *id = in_flight_requests_.Add(request);
35 }
36
37 void RequestRegistry::OnRequestFinish(RequestID id) {
38 if (in_flight_requests_.Lookup(id))
39 in_flight_requests_.Remove(id);
40 }
41
42 } // namespace google_apis
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698