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

Unified Diff: chrome/browser/loader/resource_tracker_observer.h

Issue 2933193003: Headers for resource tracking. (Closed)
Patch Set: Update build file and ensure proper enabling of offline code. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/loader/resource_tracker_observer.h
diff --git a/chrome/browser/loader/resource_tracker_observer.h b/chrome/browser/loader/resource_tracker_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..0536cf1cdebe338e92fec141c16b83c4feb2c4e1
--- /dev/null
+++ b/chrome/browser/loader/resource_tracker_observer.h
@@ -0,0 +1,38 @@
+// Copyright 2017 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 CHROME_BROWSER_LOADER_RESOURCE_TRACKER_OBSERVER_H_
+#define CHROME_BROWSER_LOADER_RESOURCE_TRACKER_OBSERVER_H_
+
+#include <stdint.h>
+
+// This interface is used by clients who want to be notified when a resource is
+// requested or completes loading, and to report the size of the resource.
+class ResourceTrackerObserver {
Dmitry Titov 2017/06/14 19:56:37 Naming: This is an observer of resource loading. M
Dmitry Titov 2017/06/14 19:56:37 Since this is going to be used by OfflinePages, sh
Pete Williamson 2017/06/15 01:03:27 Done.
Pete Williamson 2017/06/15 01:03:27 Done.
+ public:
+ enum ResourceDataType {
+ APPLICATION,
+ MEDIA,
+ EXAMPLE,
+ IMAGE,
+ MESSAGE,
+ MODEL,
Dmitry Titov 2017/06/14 19:56:37 Similarly, lets just have the types we are going t
Pete Williamson 2017/06/15 01:03:27 Done.
+ MULTIPART,
+ TEXT_CSS,
+ TEXT_HTML,
+ TEXT_PLAIN,
+ TEXT_SCRIPT,
+ XHR,
+ OTHER,
+ RESOURCE_DATA_TYPE_COUNT,
+ };
+
+ // Report when a resource starts or completes loading.
+ virtual void ObserveResourceTracking(ResourceDataType type, bool started) = 0;
+
+ // Report how many bytes were received for a resource.
+ virtual void OnNetworkBytesChanged(int64_t received_bytes) = 0;
+};
+
+#endif // CHROME_BROWSER_LOADER_RESOURCE_TRACKER_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698