| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "core/css/LocalFontFaceSource.h" | 46 #include "core/css/LocalFontFaceSource.h" |
| 47 #include "core/css/RemoteFontFaceSource.h" | 47 #include "core/css/RemoteFontFaceSource.h" |
| 48 #include "core/css/StylePropertySet.h" | 48 #include "core/css/StylePropertySet.h" |
| 49 #include "core/css/StyleRule.h" | 49 #include "core/css/StyleRule.h" |
| 50 #include "core/css/parser/CSSParser.h" | 50 #include "core/css/parser/CSSParser.h" |
| 51 #include "core/dom/DOMArrayBuffer.h" | 51 #include "core/dom/DOMArrayBuffer.h" |
| 52 #include "core/dom/DOMArrayBufferView.h" | 52 #include "core/dom/DOMArrayBufferView.h" |
| 53 #include "core/dom/DOMException.h" | 53 #include "core/dom/DOMException.h" |
| 54 #include "core/dom/Document.h" | 54 #include "core/dom/Document.h" |
| 55 #include "core/dom/ExceptionCode.h" | 55 #include "core/dom/ExceptionCode.h" |
| 56 #include "core/dom/ExecutionContext.h" |
| 56 #include "core/dom/StyleEngine.h" | 57 #include "core/dom/StyleEngine.h" |
| 57 #include "core/dom/TaskRunnerHelper.h" | 58 #include "core/dom/TaskRunnerHelper.h" |
| 58 #include "core/frame/LocalFrame.h" | 59 #include "core/frame/LocalFrame.h" |
| 59 #include "core/frame/Settings.h" | 60 #include "core/frame/Settings.h" |
| 60 #include "core/frame/UseCounter.h" | 61 #include "core/frame/UseCounter.h" |
| 61 #include "platform/FontFamilyNames.h" | 62 #include "platform/FontFamilyNames.h" |
| 62 #include "platform/Histogram.h" | 63 #include "platform/Histogram.h" |
| 63 #include "platform/RuntimeEnabledFeatures.h" | 64 #include "platform/RuntimeEnabledFeatures.h" |
| 64 #include "platform/SharedBuffer.h" | 65 #include "platform/SharedBuffer.h" |
| 65 #include "platform/WebTaskRunner.h" | 66 #include "platform/WebTaskRunner.h" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 409 } |
| 409 | 410 |
| 410 void FontFace::SetError(DOMException* error) { | 411 void FontFace::SetError(DOMException* error) { |
| 411 if (!error_) | 412 if (!error_) |
| 412 error_ = error ? error : DOMException::Create(kNetworkError); | 413 error_ = error ? error : DOMException::Create(kNetworkError); |
| 413 SetLoadStatus(kError); | 414 SetLoadStatus(kError); |
| 414 } | 415 } |
| 415 | 416 |
| 416 ScriptPromise FontFace::FontStatusPromise(ScriptState* script_state) { | 417 ScriptPromise FontFace::FontStatusPromise(ScriptState* script_state) { |
| 417 if (!loaded_property_) { | 418 if (!loaded_property_) { |
| 418 loaded_property_ = new LoadedProperty(script_state->GetExecutionContext(), | 419 loaded_property_ = new LoadedProperty(ExecutionContext::From(script_state), |
| 419 this, LoadedProperty::kLoaded); | 420 this, LoadedProperty::kLoaded); |
| 420 if (status_ == kLoaded) | 421 if (status_ == kLoaded) |
| 421 loaded_property_->Resolve(this); | 422 loaded_property_->Resolve(this); |
| 422 else if (status_ == kError) | 423 else if (status_ == kError) |
| 423 loaded_property_->Reject(error_.Get()); | 424 loaded_property_->Reject(error_.Get()); |
| 424 } | 425 } |
| 425 return loaded_property_->Promise(script_state->World()); | 426 return loaded_property_->Promise(script_state->World()); |
| 426 } | 427 } |
| 427 | 428 |
| 428 ScriptPromise FontFace::load(ScriptState* script_state) { | 429 ScriptPromise FontFace::load(ScriptState* script_state) { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 | 673 |
| 673 bool FontFace::HadBlankText() const { | 674 bool FontFace::HadBlankText() const { |
| 674 return css_font_face_->HadBlankText(); | 675 return css_font_face_->HadBlankText(); |
| 675 } | 676 } |
| 676 | 677 |
| 677 bool FontFace::HasPendingActivity() const { | 678 bool FontFace::HasPendingActivity() const { |
| 678 return status_ == kLoading && GetExecutionContext(); | 679 return status_ == kLoading && GetExecutionContext(); |
| 679 } | 680 } |
| 680 | 681 |
| 681 } // namespace blink | 682 } // namespace blink |
| OLD | NEW |