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

Unified Diff: chrome/renderer/loadtimes_extension_bindings.h

Issue 1750893003: Convert LoadTimeExtension to gin::Wrappable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/loadtimes_extension_bindings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/loadtimes_extension_bindings.h
diff --git a/chrome/renderer/loadtimes_extension_bindings.h b/chrome/renderer/loadtimes_extension_bindings.h
index c97b0b1d6eb63df3958b60a74eeb336893773444..ce994728ad7d8c414e80fad0ae28700555de770c 100644
--- a/chrome/renderer/loadtimes_extension_bindings.h
+++ b/chrome/renderer/loadtimes_extension_bindings.h
@@ -8,15 +8,52 @@
#ifndef CHROME_RENDERER_LOADTIMES_EXTENSION_BINDINGS_H_
#define CHROME_RENDERER_LOADTIMES_EXTENSION_BINDINGS_H_
-namespace v8 {
-class Extension;
+#include "content/public/renderer/render_frame_observer.h"
+#include "gin/wrappable.h"
+#include "v8/include/v8.h"
+
+namespace blink {
+class WebFrame;
}
namespace extensions_v8 {
-class LoadTimesExtension {
+class LoadTimesExtensionHelper : public content::RenderFrameObserver {
+ public:
+ explicit LoadTimesExtensionHelper(content::RenderFrame* render_frame);
+
+ // RenderFrameObserver:
+ void DidFinishLoad() override;
+};
+
+class LoadTimesExtension : public gin::Wrappable<LoadTimesExtension> {
public:
- static v8::Extension* Get();
+ static gin::WrapperInfo kWrapperInfo;
+
+ static void Install(blink::WebFrame* frame);
+
+ private:
+ // gin::Wrappable:
+ gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
+ v8::Isolate* isolate) override;
+
+ // Returns an object containing the following members:
+ // requestTime: The time the request to load the page was received.
+ // loadTime: The time the renderer started the load process.
+ // finishDocumentLoadTime: The time the document itself was loaded
+ // (this is before the onload() method is fired).
+ // finishLoadTime: The time all loading is done, after the onload()
+ // method and all resources.
+ // navigationType: A string describing what user action initiated the
+ // load.
+ v8::Local<v8::Object> LoadTimes();
+
+ // Returns an object containing the following members:
+ // startE: The time the request to load the page was received.
+ // onloadT: The time the page finished loading.
+ // pageT: Elapsed time to load the page.
+ // tran: Page navigation type.
+ v8::Local<v8::Object> CSI();
};
} // namespace extensions_v8
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/loadtimes_extension_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698