OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 if (executionContext->IsDocument()) { | 54 if (executionContext->IsDocument()) { |
55 return blink::ToV8(blink::Internals::Create(executionContext), global, | 55 return blink::ToV8(blink::Internals::Create(executionContext), global, |
56 scriptState->GetIsolate()); | 56 scriptState->GetIsolate()); |
57 } | 57 } |
58 if (executionContext->IsWorkerGlobalScope()) { | 58 if (executionContext->IsWorkerGlobalScope()) { |
59 return blink::ToV8(blink::WorkerInternals::Create(), global, | 59 return blink::ToV8(blink::WorkerInternals::Create(), global, |
60 scriptState->GetIsolate()); | 60 scriptState->GetIsolate()); |
61 } | 61 } |
62 return v8::Local<v8::Value>(); | 62 return v8::Local<v8::Value>(); |
63 } | 63 } |
64 } | 64 } // namespace |
65 | 65 |
66 void injectInternalsObject(v8::Local<v8::Context> context) { | 66 void injectInternalsObject(v8::Local<v8::Context> context) { |
67 registerInstallConditionalFeaturesForTesting(); | 67 registerInstallConditionalFeaturesForTesting(); |
68 | 68 |
69 blink::ScriptState* scriptState = blink::ScriptState::From(context); | 69 blink::ScriptState* scriptState = blink::ScriptState::From(context); |
70 blink::ScriptState::Scope scope(scriptState); | 70 blink::ScriptState::Scope scope(scriptState); |
71 v8::Local<v8::Object> global = scriptState->GetContext()->Global(); | 71 v8::Local<v8::Object> global = scriptState->GetContext()->Global(); |
72 v8::Local<v8::Value> internals = createInternalsObject(context); | 72 v8::Local<v8::Value> internals = createInternalsObject(context); |
73 if (internals.IsEmpty()) | 73 if (internals.IsEmpty()) |
74 return; | 74 return; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 installConditionalFeaturesForTesting); | 150 installConditionalFeaturesForTesting); |
151 } | 151 } |
152 if (!s_originalInstallPendingConditionalFeatureFunction) { | 152 if (!s_originalInstallPendingConditionalFeatureFunction) { |
153 s_originalInstallPendingConditionalFeatureFunction = | 153 s_originalInstallPendingConditionalFeatureFunction = |
154 SetInstallPendingConditionalFeatureFunction( | 154 SetInstallPendingConditionalFeatureFunction( |
155 &installPendingConditionalFeatureForTesting); | 155 &installPendingConditionalFeatureForTesting); |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 } // namespace WebCoreTestSupport | 159 } // namespace WebCoreTestSupport |
OLD | NEW |