| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights |
| 5 * reserved. | 5 * reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 ExecutionContext& context = m_loader->element()->document(); | 105 ExecutionContext& context = m_loader->element()->document(); |
| 106 probe::asyncTaskScheduled(&context, "Image", this); | 106 probe::asyncTaskScheduled(&context, "Image", this); |
| 107 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); | 107 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); |
| 108 v8::HandleScope scope(isolate); | 108 v8::HandleScope scope(isolate); |
| 109 // If we're invoked from C++ without a V8 context on the stack, we should | 109 // If we're invoked from C++ without a V8 context on the stack, we should |
| 110 // run the microtask in the context of the element's document's main world. | 110 // run the microtask in the context of the element's document's main world. |
| 111 if (!isolate->GetCurrentContext().IsEmpty()) { | 111 if (!isolate->GetCurrentContext().IsEmpty()) { |
| 112 m_scriptState = ScriptState::current(isolate); | 112 m_scriptState = ScriptState::current(isolate); |
| 113 } else { | 113 } else { |
| 114 m_scriptState = | 114 m_scriptState = |
| 115 ScriptState::forMainWorld(loader->element()->document().frame()); | 115 toScriptStateForMainWorld(loader->element()->document().frame()); |
| 116 DCHECK(m_scriptState); | 116 DCHECK(m_scriptState); |
| 117 } | 117 } |
| 118 m_requestURL = | 118 m_requestURL = |
| 119 loader->imageSourceToKURL(loader->element()->imageSourceURL()); | 119 loader->imageSourceToKURL(loader->element()->imageSourceURL()); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void run() { | 122 void run() { |
| 123 if (!m_loader) | 123 if (!m_loader) |
| 124 return; | 124 return; |
| 125 ExecutionContext& context = m_loader->element()->document(); | 125 ExecutionContext& context = m_loader->element()->document(); |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 } | 634 } |
| 635 | 635 |
| 636 void ImageLoader::elementDidMoveToNewDocument() { | 636 void ImageLoader::elementDidMoveToNewDocument() { |
| 637 if (m_loadDelayCounter) | 637 if (m_loadDelayCounter) |
| 638 m_loadDelayCounter->documentChanged(m_element->document()); | 638 m_loadDelayCounter->documentChanged(m_element->document()); |
| 639 clearFailedLoadURL(); | 639 clearFailedLoadURL(); |
| 640 setImage(0); | 640 setImage(0); |
| 641 } | 641 } |
| 642 | 642 |
| 643 } // namespace blink | 643 } // namespace blink |
| OLD | NEW |