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

Side by Side Diff: chrome/browser/background/background_contents_service.h

Issue 2281323002: Use exponential backoff for component extension reloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per atwilson@'s comments. Created 4 years, 3 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
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 #ifndef CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_ 5 #ifndef CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_
6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_ 6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/gtest_prod_util.h" 14 #include "base/gtest_prod_util.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/scoped_observer.h" 17 #include "base/scoped_observer.h"
18 #include "chrome/browser/background/background_contents.h" 18 #include "chrome/browser/background/background_contents.h"
19 #include "components/keyed_service/core/keyed_service.h" 19 #include "components/keyed_service/core/keyed_service.h"
20 #include "content/public/browser/notification_observer.h" 20 #include "content/public/browser/notification_observer.h"
21 #include "content/public/browser/notification_registrar.h" 21 #include "content/public/browser/notification_registrar.h"
22 #include "content/public/common/window_container_type.h" 22 #include "content/public/common/window_container_type.h"
23 #include "extensions/browser/extension_registry_observer.h" 23 #include "extensions/browser/extension_registry_observer.h"
24 #include "net/base/backoff_entry.h"
24 #include "ui/base/window_open_disposition.h" 25 #include "ui/base/window_open_disposition.h"
25 #include "url/gurl.h" 26 #include "url/gurl.h"
26 27
27 class PrefService; 28 class PrefService;
28 class Profile; 29 class Profile;
29 30
30 namespace base { 31 namespace base {
31 class CommandLine; 32 class CommandLine;
32 class DictionaryValue; 33 class DictionaryValue;
33 } 34 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 }; 233 };
233 234
234 // Map associating currently loaded BackgroundContents with their parent 235 // Map associating currently loaded BackgroundContents with their parent
235 // applications. 236 // applications.
236 // Key: application id 237 // Key: application id
237 // Value: BackgroundContentsInfo for the BC associated with that application 238 // Value: BackgroundContentsInfo for the BC associated with that application
238 typedef std::map<base::string16, BackgroundContentsInfo> 239 typedef std::map<base::string16, BackgroundContentsInfo>
239 BackgroundContentsMap; 240 BackgroundContentsMap;
240 BackgroundContentsMap contents_map_; 241 BackgroundContentsMap contents_map_;
241 242
243 // Map associating component extensions that have attempted to reload with a
244 // BackoffEntry keeping track of retry timing.
245 typedef std::map<extensions::ExtensionId, std::unique_ptr<net::BackoffEntry>>
246 ExtensionBackoffEntryMap;
247 ExtensionBackoffEntryMap backoff_map_;
248
242 ScopedObserver<extensions::ExtensionRegistry, 249 ScopedObserver<extensions::ExtensionRegistry,
243 extensions::ExtensionRegistryObserver> 250 extensions::ExtensionRegistryObserver>
244 extension_registry_observer_; 251 extension_registry_observer_;
245 252
246 DISALLOW_COPY_AND_ASSIGN(BackgroundContentsService); 253 DISALLOW_COPY_AND_ASSIGN(BackgroundContentsService);
247 }; 254 };
248 255
249 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_ 256 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698