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

Unified Diff: android_webview/browser/global_tile_manager.h

Issue 643993005: Remove limit on number of resources in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no cc change Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/browser/browser_view_renderer.cc ('k') | android_webview/browser/global_tile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/global_tile_manager.h
diff --git a/android_webview/browser/global_tile_manager.h b/android_webview/browser/global_tile_manager.h
deleted file mode 100644
index bf83e9ebd5c64c96ed79af440da3d03c88c121e3..0000000000000000000000000000000000000000
--- a/android_webview/browser/global_tile_manager.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ANDROID_WEBVIEW_BROWSER_GLOBAL_TILE_MANAGER_H_
-#define ANDROID_WEBVIEW_BROWSER_GLOBAL_TILE_MANAGER_H_
-
-#include <list>
-#include "base/basictypes.h"
-#include "base/lazy_instance.h"
-#include "base/sequence_checker.h"
-#include "base/synchronization/lock.h"
-#include "content/public/browser/android/synchronous_compositor.h"
-
-namespace android_webview {
-
-class GlobalTileManagerClient;
-
-// A global tile manager that keeps track of the number of tile resources. Each
-// tile needs file descriptors (typically 2) and there is a soft limit of 1024
-// file descriptors per Android process. The GlobalTileManager does not keep
-// track of how many tiles each individual view is actually using. The purpose
-// of GlobalTileManager is to behave gracefully (as in not crashing) when the
-// embedder of webview creates a lot of webviews and draw them at the same time.
-class GlobalTileManager {
- private:
- typedef std::list<GlobalTileManagerClient*> ListType;
-
- public:
- typedef ListType::iterator Key;
- static GlobalTileManager* GetInstance();
-
- void SetTileLimit(size_t num_tiles_limit);
-
- // Requests the |new_num_of_tiles| from the available global pool. Calls
- // GlobalTileManagerClient.SetNumTiles after the manager determines how many
- // tiles are available for the client. If the number of tiles left is not
- // enough to satisfy the request, the manager will evict tiles allocated to
- // other clients.
- void RequestTiles(content::SynchronousCompositorMemoryPolicy new_policy,
- Key key);
-
- Key PushBack(GlobalTileManagerClient* client);
-
- // |key| must be already in manager. Move the tile manager client
- // corresponding to |key| to most recent. This function should be called after
- // RequestTiles.
- void DidUse(Key key);
-
- void Remove(Key key);
-
- private:
- friend struct base::DefaultLazyInstanceTraits<GlobalTileManager>;
- GlobalTileManager();
- ~GlobalTileManager();
-
- // Continues evicting the inactive views until freeing up at least amount of
- // tiles specified by |desired_num_tiles| to draw a view specified by |key|,
- // or until all inactive views have been evicted. Returns the amount of
- // memory that was actually evicted. This function is called when a
- // request cannot be satisfied.
- size_t Evict(size_t desired_num_tiles, Key key);
-
- // Check that the sum of all client's tiles is equal to
- // total_allocated_tiles_.
- bool IsConsistent() const;
-
- size_t num_tiles_limit_;
-
- size_t total_allocated_tiles_;
- ListType mru_list_;
- base::SequenceChecker sequence_checker_;
-
- DISALLOW_COPY_AND_ASSIGN(GlobalTileManager);
-};
-
-} // namespace android_webview
-
-#endif // ANDROID_WEBVIEW_BROWSER_GLOBAL_TILE_MANAGER_H_
« no previous file with comments | « android_webview/browser/browser_view_renderer.cc ('k') | android_webview/browser/global_tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698