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

Unified Diff: third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.h

Issue 2652973002: [scheduler] Plumb websocket information to scheduler (Closed)
Patch Set: Introduce WebFrameScheduler::ActiveConnectionHandle Created 3 years, 11 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: third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.h
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.h b/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.h
index 141ea7cbce16ba6c0637c446867e7b49afbfee68..6c4bf332a159ba14b9913f4de7b2bfc778ac5c02 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.h
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.h
@@ -9,10 +9,11 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/trace_event/trace_event.h"
#include "platform/WebFrameScheduler.h"
-#include "public/platform/scheduler/base/task_queue.h"
#include "public/platform/WebCommon.h"
+#include "public/platform/scheduler/base/task_queue.h"
namespace base {
namespace trace_event {
@@ -50,18 +51,37 @@ class WebFrameSchedulerImpl : public WebFrameScheduler {
void didStopLoading(unsigned long identifier) override;
void setDocumentParsingInBackground(bool background_parser_active) override;
void onFirstMeaningfulPaint() override;
+ std::unique_ptr<ActiveConnectionHandle> onActiveConnectionCreated() override;
void AsValueInto(base::trace_event::TracedValue* state) const;
+ bool has_active_connection() const { return active_connections_count_; }
+
private:
friend class WebViewSchedulerImpl;
+ class ActiveConnectionHandleImpl : public ActiveConnectionHandle {
+ public:
+ ActiveConnectionHandleImpl(WebFrameSchedulerImpl* frame_scheduler);
+ ~ActiveConnectionHandleImpl() override;
+
+ private:
+ base::WeakPtr<WebFrameSchedulerImpl> frame_scheduler_;
+
+ DISALLOW_COPY_AND_ASSIGN(ActiveConnectionHandleImpl);
+ };
+
void DetachFromWebViewScheduler();
void RemoveTimerQueueFromBackgroundTimeBudgetPool();
void ApplyPolicyToTimerQueue();
bool ShouldThrottleTimers() const;
void UpdateTimerThrottling(bool was_throttled);
+ void didOpenActiveConnection();
+ void didCloseActiveConnection();
+
+ base::WeakPtr<WebFrameSchedulerImpl> AsWeakPtr();
+
scoped_refptr<TaskQueue> loading_task_queue_;
scoped_refptr<TaskQueue> timer_task_queue_;
scoped_refptr<TaskQueue> unthrottled_task_queue_;
@@ -77,6 +97,9 @@ class WebFrameSchedulerImpl : public WebFrameScheduler {
bool page_throttled_;
bool frame_suspended_;
bool cross_origin_;
+ int active_connections_count_;
Sami 2017/01/26 15:53:34 nit: active_connection_count_ to avoid the double
altimin 2017/02/08 15:56:54 Done.
+
+ base::WeakPtrFactory<WebFrameSchedulerImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(WebFrameSchedulerImpl);
};

Powered by Google App Engine
This is Rietveld 408576698