| 60 | private: |
| 61 | |
| 62 | class AddAsyncJob : public job::JobItem |
| 63 | { |
| 64 | public: |
| 65 | |
| 66 | AddAsyncJob(TexPool *parent, uint32_t hash, uint8_t *buf, size_t bufSize) : |
| 67 | job::JobItem("TexPool::AddAsyncJob", NULL), m_parent(parent), m_hash(hash), m_buf(buf), m_bufSize(bufSize) |
| 68 | { |
| 69 | |
| 70 | } |
| 71 | |
| 72 | AddAsyncJob(TexPool *parent, uint32_t hash, const string& path) : |
| 73 | job::JobItem("TexPool::AddAsyncJob", NULL), m_parent(parent), m_hash(hash), m_buf(NULL), m_path(path) |
| 74 | { |
| 75 | |
| 76 | } |
| 77 | |
| 78 | ~AddAsyncJob() |
| 79 | { |
| 80 | |
| 81 | } |
| 82 | |
| 83 | int32_t Run() |
| 84 | { |
| 85 | bool result = false; |
| 86 | |
| 87 | if (m_buf) |
| 88 | { |
| 89 | result = m_parent->Add(m_hash, m_buf, m_bufSize, true); |
| 90 | } |
| 91 | else |
| 92 | { |
| 93 | result = m_parent->Add(m_hash, m_path.c_str(), true); |
| 94 | } |
| 95 | |
| 96 | if (result && m_parent->IsAlive() && m_parent->m_cbPlugin) |
| 97 | { |
| 98 | event::BroadcastGlobalEvent(m_parent->m_cbPlugin, ui::Handler::CB_STATE_READY_CACHEIMAGE, m_hash); |
| 99 | } |
| 100 | |
| 101 | return SCE_PAF_OK; |
| 102 | } |
| 103 | |
| 104 | void Finish(int32_t result) |
| 105 | { |
| 106 | |
| 107 | } |
| 108 | |
| 109 | private: |
| 110 | |
| 111 | TexPool *m_parent; |
| 112 | uint8_t *m_buf; |
| 113 | size_t m_bufSize; |
| 114 | uint32_t m_hash; |
| 115 | string m_path; |
| 116 | }; |
| 117 | |
| 118 | class DestroyJob : public job::JobItem |
| 119 | { |
nothing calls this directly
no outgoing calls
no test coverage detected