OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 DCHECK(m_lifecycle == Lifecycle::ContextInitialized); | 64 DCHECK(m_lifecycle == Lifecycle::ContextInitialized); |
65 m_lifecycle = Lifecycle::ContextDetached; | 65 m_lifecycle = Lifecycle::ContextDetached; |
66 } | 66 } |
67 | 67 |
68 void RemoteWindowProxy::initialize() { | 68 void RemoteWindowProxy::initialize() { |
69 TRACE_EVENT1("v8", "RemoteWindowProxy::initialize", "isMainWindow", | 69 TRACE_EVENT1("v8", "RemoteWindowProxy::initialize", "isMainWindow", |
70 frame()->isMainFrame()); | 70 frame()->isMainFrame()); |
71 SCOPED_BLINK_UMA_HISTOGRAM_TIMER( | 71 SCOPED_BLINK_UMA_HISTOGRAM_TIMER( |
72 frame()->isMainFrame() ? "Blink.Binding.InitializeMainWindowProxy" | 72 frame()->isMainFrame() |
73 : "Blink.Binding.InitializeNonMainWindowProxy"); | 73 ? "Blink.Binding.InitializeMainRemoteWindowProxy" |
| 74 : "Blink.Binding.InitializeNonMainRemoteWindowProxy"); |
74 | 75 |
75 ScriptForbiddenScope::AllowUserAgentScript allowScript; | 76 ScriptForbiddenScope::AllowUserAgentScript allowScript; |
76 | 77 |
77 v8::HandleScope handleScope(isolate()); | 78 v8::HandleScope handleScope(isolate()); |
78 createContext(); | 79 createContext(); |
79 setupWindowPrototypeChain(); | 80 setupWindowPrototypeChain(); |
80 } | 81 } |
81 | 82 |
82 void RemoteWindowProxy::createContext() { | 83 void RemoteWindowProxy::createContext() { |
83 // Create a new v8::Context with the window object as the global object | 84 // Create a new v8::Context with the window object as the global object |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 123 |
123 // The global object, aka window wrapper object. | 124 // The global object, aka window wrapper object. |
124 v8::Local<v8::Object> windowWrapper = | 125 v8::Local<v8::Object> windowWrapper = |
125 globalProxy->GetPrototype().As<v8::Object>(); | 126 globalProxy->GetPrototype().As<v8::Object>(); |
126 v8::Local<v8::Object> associatedWrapper = | 127 v8::Local<v8::Object> associatedWrapper = |
127 associateWithWrapper(window, wrapperTypeInfo, windowWrapper); | 128 associateWithWrapper(window, wrapperTypeInfo, windowWrapper); |
128 DCHECK(associatedWrapper == windowWrapper); | 129 DCHECK(associatedWrapper == windowWrapper); |
129 } | 130 } |
130 | 131 |
131 } // namespace blink | 132 } // namespace blink |
OLD | NEW |