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.h" | 9 #include "base/time.h" |
10 #include "content/public/renderer/document_state.h" | 10 #include "content/public/renderer/document_state.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 "chrome.loadTimes = function() {" | 45 "chrome.loadTimes = function() {" |
46 " native function GetLoadTimes();" | 46 " native function GetLoadTimes();" |
47 " return GetLoadTimes();" | 47 " return GetLoadTimes();" |
48 "};" | 48 "};" |
49 "chrome.csi = function() {" | 49 "chrome.csi = function() {" |
50 " native function GetCSI();" | 50 " native function GetCSI();" |
51 " return GetCSI();" | 51 " return GetCSI();" |
52 "}") {} | 52 "}") {} |
53 | 53 |
54 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction( | 54 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction( |
55 v8::Handle<v8::String> name) { | 55 v8::Handle<v8::String> name) OVERRIDE { |
56 if (name->Equals(v8::String::New("GetLoadTimes"))) { | 56 if (name->Equals(v8::String::New("GetLoadTimes"))) { |
57 return v8::FunctionTemplate::New(GetLoadTimes); | 57 return v8::FunctionTemplate::New(GetLoadTimes); |
58 } else if (name->Equals(v8::String::New("GetCSI"))) { | 58 } else if (name->Equals(v8::String::New("GetCSI"))) { |
59 return v8::FunctionTemplate::New(GetCSI); | 59 return v8::FunctionTemplate::New(GetCSI); |
60 } | 60 } |
61 return v8::Handle<v8::FunctionTemplate>(); | 61 return v8::Handle<v8::FunctionTemplate>(); |
62 } | 62 } |
63 | 63 |
64 static const char* GetNavigationType(WebNavigationType nav_type) { | 64 static const char* GetNavigationType(WebNavigationType nav_type) { |
65 switch (nav_type) { | 65 switch (nav_type) { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 181 } |
182 return v8::Null(); | 182 return v8::Null(); |
183 } | 183 } |
184 }; | 184 }; |
185 | 185 |
186 v8::Extension* LoadTimesExtension::Get() { | 186 v8::Extension* LoadTimesExtension::Get() { |
187 return new LoadTimesExtensionWrapper(); | 187 return new LoadTimesExtensionWrapper(); |
188 } | 188 } |
189 | 189 |
190 } // namespace extensions_v8 | 190 } // namespace extensions_v8 |
OLD | NEW |