OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/loadtimes_extension_bindings.h" | 5 #include "chrome/renderer/loadtimes_extension_bindings.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "content/public/renderer/document_state.h" | 10 #include "content/public/renderer/document_state.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 " native function GetLoadTimes();" | 47 " native function GetLoadTimes();" |
48 " return GetLoadTimes();" | 48 " return GetLoadTimes();" |
49 "};" | 49 "};" |
50 "chrome.csi = function() {" | 50 "chrome.csi = function() {" |
51 " native function GetCSI();" | 51 " native function GetCSI();" |
52 " return GetCSI();" | 52 " return GetCSI();" |
53 "}") {} | 53 "}") {} |
54 | 54 |
55 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( | 55 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( |
56 v8::Isolate* isolate, | 56 v8::Isolate* isolate, |
57 v8::Handle<v8::String> name) OVERRIDE { | 57 v8::Handle<v8::String> name) override { |
58 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetLoadTimes"))) { | 58 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetLoadTimes"))) { |
59 return v8::FunctionTemplate::New(isolate, GetLoadTimes); | 59 return v8::FunctionTemplate::New(isolate, GetLoadTimes); |
60 } else if (name->Equals(v8::String::NewFromUtf8(isolate, "GetCSI"))) { | 60 } else if (name->Equals(v8::String::NewFromUtf8(isolate, "GetCSI"))) { |
61 return v8::FunctionTemplate::New(isolate, GetCSI); | 61 return v8::FunctionTemplate::New(isolate, GetCSI); |
62 } | 62 } |
63 return v8::Handle<v8::FunctionTemplate>(); | 63 return v8::Handle<v8::FunctionTemplate>(); |
64 } | 64 } |
65 | 65 |
66 static const char* GetNavigationType(WebNavigationType nav_type) { | 66 static const char* GetNavigationType(WebNavigationType nav_type) { |
67 switch (nav_type) { | 67 switch (nav_type) { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 args.GetReturnValue().SetNull(); | 199 args.GetReturnValue().SetNull(); |
200 return; | 200 return; |
201 } | 201 } |
202 }; | 202 }; |
203 | 203 |
204 v8::Extension* LoadTimesExtension::Get() { | 204 v8::Extension* LoadTimesExtension::Get() { |
205 return new LoadTimesExtensionWrapper(); | 205 return new LoadTimesExtensionWrapper(); |
206 } | 206 } |
207 | 207 |
208 } // namespace extensions_v8 | 208 } // namespace extensions_v8 |
OLD | NEW |