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

Unified Diff: Source/core/inspector/InspectorResourceContentLoader.h

Issue 347543002: DevTools: Extract CSS resources preloading from css agent to page agent controlled loader. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 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: Source/core/inspector/InspectorResourceContentLoader.h
diff --git a/Source/core/inspector/InspectorResourceContentLoader.h b/Source/core/inspector/InspectorResourceContentLoader.h
new file mode 100644
index 0000000000000000000000000000000000000000..c781e20d032bd748b5bf527e5e99b93c7f9ede9b
--- /dev/null
+++ b/Source/core/inspector/InspectorResourceContentLoader.h
@@ -0,0 +1,47 @@
+// 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 InspectorResourceContentLoader_h
+#define InspectorResourceContentLoader_h
+
+#include "core/fetch/ResourcePtr.h"
+#include "wtf/HashSet.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class CSSStyleSheetResource;
+class Page;
+class Resource;
+class VoidCallback;
+
+class InspectorResourceContentLoader FINAL {
+ WTF_MAKE_NONCOPYABLE(InspectorResourceContentLoader);
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ InspectorResourceContentLoader(Page*);
+ void addListener(PassOwnPtr<VoidCallback>);
+ ~InspectorResourceContentLoader();
+ bool hasFinished();
+ void stop();
+
+private:
+ class ResourceClient;
+
+ void resourceFinished(ResourceClient*);
+ void checkDone();
+
+ Vector<OwnPtr<VoidCallback> > m_callbacks;
+ bool m_allRequestsStarted;
+ HashSet<ResourceClient*> m_pendingResourceClients;
+ Vector<ResourcePtr<Resource> > m_resources;
+
+ friend class ResourceClient;
+};
+
+} // namespace WebCore
+
+
+#endif // !defined(InspectorResourceContentLoader_h)
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/core/inspector/InspectorResourceContentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698