| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
| 6 #include "bindings/core/v8/V8ScriptRunner.h" | 6 #include "bindings/core/v8/V8ScriptRunner.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
| 9 #include "core/fetch/ScriptResource.h" | 9 #include "core/fetch/ScriptResource.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 unsigned tagForCodeCache() const | 59 unsigned tagForCodeCache() const |
| 60 { | 60 { |
| 61 return tagForParserCache() + 1; | 61 return tagForParserCache() + 1; |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool compileScript(V8CacheOptions cacheOptions) | 64 bool compileScript(V8CacheOptions cacheOptions) |
| 65 { | 65 { |
| 66 return !V8ScriptRunner::compileScript( | 66 return !V8ScriptRunner::compileScript( |
| 67 v8String(isolate(), code()), filename(), WTF::TextPosition(), | 67 v8String(isolate(), code()), filename(), WTF::TextPosition(), |
| 68 m_resource.get(), isolate(), NotSharableCrossOrigin, cacheOptions) | 68 m_resource.get(), 0, isolate(), NotSharableCrossOrigin, cacheOptions
) |
| 69 .IsEmpty(); | 69 .IsEmpty(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void setEmptyResource() | 72 void setEmptyResource() |
| 73 { | 73 { |
| 74 m_resourceRequest = WTF::adoptPtr(new ResourceRequest); | 74 m_resourceRequest = WTF::adoptPtr(new ResourceRequest); |
| 75 m_resource = adoptPtrWillBeNoop(new ScriptResource(*m_resourceRequest.ge
t(), "text/utf-8")); | 75 m_resource = adoptPtrWillBeNoop(new ScriptResource(*m_resourceRequest.ge
t(), "text/utf-8")); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void setResource() | 78 void setResource() |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 EXPECT_FALSE(m_resource->cachedMetadata(tagForParserCache())); | 137 EXPECT_FALSE(m_resource->cachedMetadata(tagForParserCache())); |
| 138 | 138 |
| 139 // FIXME: Code caching is presently still disabled. | 139 // FIXME: Code caching is presently still disabled. |
| 140 // Enable EXPECT when code caching lands. | 140 // Enable EXPECT when code caching lands. |
| 141 // EXPECT_TRUE(m_resource->cachedMetadata(tagForCodeCache())); | 141 // EXPECT_TRUE(m_resource->cachedMetadata(tagForCodeCache())); |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace | 144 } // namespace |
| 145 | 145 |
| 146 } // namespace blink | 146 } // namespace blink |
| OLD | NEW |